gfortran

Automatic width integer descriptor in fortran 90

我的未来我决定 提交于 2019-12-07 09:13:49
问题 I wanted to use automatic integer width descriptor in fortran 90. I referred to Output formatting: too much whitespace in gfortran This question says that I can use I0 and F0,0 for "auto" width. Here is my sample code (complied with GNU Fortran Compiler): PROGRAM MAIN IMPLICIT NONE INTEGER :: i REAL :: j WRITE (*,*) 'Enter integer' READ (*,100) i 100 FORMAT (I0) WRITE (*,*) 'Enter real' READ (*,110) j 110 FORMAT (F0.0) WRITE (*,100) 'Integer = ',i WRITE (*,110) 'Real = ',j END PROGRAM There

library not found for -lbundle1.o when installing python packages (ffnet, spacepy) on my mac

青春壹個敷衍的年華 提交于 2019-12-07 07:00:02
问题 I have the anaconda python distribution installed on my mac (10.9). I'm trying to install the ffnet package and the SpacePy package, but having trouble in doing so. Here is the error I get when doing sudo easy_install ffnet : ld: library not found for -lbundle1.o collect2: erreur: ld a retourné 1 code d'état d'exécution ld: library not found for -lbundle1.o collect2: erreur: ld a retourné 1 code d'état d'exécution error: Setup script exited with error: Command "/usr/local/bin/gfortran -Wall

Reading a string with spaces in Fortran

雨燕双飞 提交于 2019-12-06 19:19:21
问题 Using read(asterisk, asterisk) in Fortran doesn't seem to work if the string to be read from the user contains spaces. Consider the following code: character(Len = 1000) :: input = ' ' read(*,*) input If the user enters the string "Hello, my name is John Doe", only "Hello," will be stored in input; everything after the space is disregarded. My assumption is that the compiler assumes that "Hello," is the first argument, and that "my" is the second, so to capture the other words, we'd have to

installing gfortran in cygwin: gfortran: cyglto_plugin.dll not found

混江龙づ霸主 提交于 2019-12-06 11:45:58
I'm trying to get the gfortran compiler with cygwin. When attempting to compile a hello world program, I get the following error: gfortran: fatal error: -fuse-linker-plugin, but cyglto_plugin.dll not found compilation terminated. To install the compiler, I used the cygwin setup and selected gcc-fortran: GNU compiler collection libgfortran3: GCC fortran runtime library I also mistakenly selected the toolchains for mingw, even though I don't have the mingw compiler (as far as I'm aware). g++, which I installed awhile ago, works fine. What do I need to do to compile/find the library? It is

gfortran can't find library that IS there

若如初见. 提交于 2019-12-06 04:46:59
问题 I'm having trouble linking my program to a library. I've never done this before so I'm probably doing something stupid, but as far as I can tell I'm doing the right thing. I need to link my program foo.f90 to a library libbar.a which is in a directory elsewhere below my home directory. I enter the command: gfortran -c foo.f90 gfortran -o foo foo.f90 -L/directory/of/library -llibbar.a But this throws: ld: library not found for -llibhealpix.a Where of course libhealpix.a is the real library

Linking fortran module: “undefined reference”

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 03:22:18
问题 I'm trying to write some functions/subroutines in a module that call another function in the same module and running into linker errors. A toy example displaying the same behavior: !in test.f module m1 implicit none contains real function mult(a, b) real :: a real :: b mult = a * b return end function mult real function sq(a) real :: a, mult sq = mult(a, a) return end function sq end module m1 program main use m1 write(*,*) sq(2.0) end program When I try to compile this, I run into trouble:

`Relocation truncated to fit` error in Fortran with large arrays

£可爱£侵袭症+ 提交于 2019-12-06 01:52:13
问题 I have written a Fortran 90 code to extract angles from molecular simulation data. In this code I used a module with name all_parameter . In this module I defined an array such as: CH_Angles INTEGER,PARAMETER :: totalFrames = 32000 INTEGER,PARAMETER :: AAA=75 REAL,DIMENSION(45:AAA,1:256,1:totalFrames) :: CH_Angles If I use the value of AAA = 75 , I can compile this code without any error and I can get the values I wanted. But if I change the value of AAA to be AAA=105 , then I get some error

gfortran: error trying to exec 'f951': execvp: No such file or directory

江枫思渺然 提交于 2019-12-06 01:11:20
问题 I'm trying to compile a code found on the internet. Actually I'm trying to compile the code found at http://www.cs.berkeley.edu/~fowlkes/BSE/. I tried to install gfortran and all the other libraries that are needed for compiling it in my MAC. But when I run the command make I get the following error: $ make (cd trlan && make -f Makefile.gcc) gfortran -O3 -ffixed-line-length-132 -c dsort2.f gfortran: error trying to exec 'f951': execvp: No such file or directory make[1]: *** [dsort2.o] Error 1

MinGW / gcc: The application was unable to start correctly (0xc000007b)

删除回忆录丶 提交于 2019-12-06 00:36:47
问题 I have been using MinGW and the GNU Fortran compiler for a while in order to compile Fortran programs on Windows, which has always been a successful method. However, I have been getting the following error for the past 4 days: The application was unable to start correctly (0xc000007b). Click OK to close the application. The error only happens when running applications that I wrote myself, and that I compiled using the MinGW/gfortran combo. When compiling using Visual Studio and iFort, I have

fortran operator overloading (=)

柔情痞子 提交于 2019-12-06 00:29:46
Is there a way to overload the = operator so that you can write an assignment like in this example: module constants_mod integer,parameter :: dpn = selected_real_kind(14) end module module vectorField_mod use constants_mod implicit none private public :: vectorField public :: allocateX,allocateY,allocateZ public :: delete ! public :: operator(=) type vectorField integer,dimension(3) :: sx,sy,sz real(dpn),dimension(:,:,:),allocatable :: x,y,z end type interface delete module procedure deallocateVectorField end interface ! interface operator (=) ! module procedure vectorAssign ! end interface