I am using gfortran on a Mac Mini, and have got the compiler by untaring the gfortran-intel-bin.tar package. The compilers are located in /usr/local/bin. I am running Mac OS X Version 10.4.10 Whenever I invoke this compiler without specifying a cource file I get the expected error message: gfortran: no input files From this I deduce that the compiler is in the correct place and is able to detect this simplest of errors Whenever I invoke the compiler with a valid fortran source file I get the error message: gfortran: error trying to exec 'f951': execvp: No such file or directive. I detected this error while trying to compile the sources for OpenGl, and I could not make sense of the message. I then discovered that the error message was the same for all the input files that I tried. Eventually I tried compiling a program that compiled successfully with g77 using the command line: /usr/local/bin/g77 -ffixed-form -ffixed-line-length-132 -fbounds-check-ffortran-bounds-check -w -ff90 -0 strauss strauss.f with the command line: /usr/local/bin/gfortran -ffixed-form -ffixed-line-length-132 -fbounds-check -fmax-errors-0 -o strauss strauss.f This caused the response (as before) "gfortran: error trying to exec 'f951' : execvp" I have searched the known bugs file for f951 without any response. I admit that I am new to Mac systems but have experience of Linux and SGI systems from which the above source files are derived. I have tried out trivially simple source programs for testing and got the same error message in response
> Whenever I invoke this compiler without specifying a cource file I get the > expected error message: > gfortran: no input files [...] > Whenever I invoke the compiler with a valid fortran source file I get the error > message: > gfortran: error trying to exec 'f951': execvp: No such file or directive. gfortran (and gcc, g++ etc.) are wrappers around the actual compiler. Seemingly, the wrapper "gfortran" cannot find the actual compiler; on my Linux system they are at: /usr/bin/gfortran /usr/lib64/gcc/x86_64-suse-linux/4.2.2/f951 You could try '-v', e.g. gfortran -v -c someFortranFile.f this gives more information, which might help.
Thank you for the prompt response I have taken your suggestion about including "-v" in the command line. I have compiled the source of the program (strauss.f) with both the g77 nd gfortran compilers. Incidently the code has compiled succesfully on linux systems both 32 bit and 64 bit. With the added "-v" the results were as follows: With g77: Driving: /usr/local/bin/g77 -ffixed-form -ffixed-line-length-132 -fbounds-check -ffortran-bounds-check -v -w -ff90 -o strauss strauss.f -lfrtbegin -lg2c Reading specs from /usr/local/lib/gcc/i686-apple-darwin8.8.1/3.4.0/specs Configured with: ../gcc-3.4.0/configure --enable-languages=f77 Thread model: posix gcc version 3.4.0 /usr/local/libexec/gcc/i686-apple-darwin8.8.1/3.4.0/f771 strauss.f -fPIC -quiet -dumpbase strauss.f -mtune=pentiumpro -auxbase strauss -w -version -ffixed-form -ffixed-line-length-132 -fbounds-check -ffortran-bounds-check -ff90 -o /var/tmp//ccT7pus3.s GNU F77 version 3.4.0 (i686-apple-darwin8.8.1) compiled by GNU C version 3.4.0. GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 as -arch i386 -o /var/tmp//ccbScj9o.o /var/tmp//ccT7pus3.s /usr/local/libexec/gcc/i686-apple-darwin8.8.1/3.4.0/collect2 -arch i386 -dynamic -w -o strauss -lcrt1.o -lcrt2.o -L/usr/local/lib/gcc/i686-apple-darwin8.8.1/3.4.0 -L/usr/local/lib/gcc/i686-apple-darwin8.8.1/3.4.0/../../.. /var/tmp//ccbScj9o.o -lfrtbegin -lg2c -lgcc -lSystem | c++filt With gfortran: Driving: /usr/local/bin/gfortran -mmacosx-version-min=10.4 -ffixed-form -ffixed-line-length-132 -fbounds-check -fmax-errors-0 -v -o strauss strauss.f90 -lgfortranbegin -lgfortran -shared-libgcc Using built-in specs. Target: i386-apple-darwin8.10.1 Configured with: ../gcc-4.3-20070810/configure --enable-threads=posix --enable-languages=fortran Thread model: posix gcc version 4.3.0 20070810 (experimental) f951 strauss.f90 -fPIC -quiet -dumpbase strauss.f90 -mmacosx-version-min=10.4 -mtune=generic -auxbase strauss -version -ffixed-form -ffixed-line-length-132 -fbounds-check -fmax-errors-0 -fintrinsic-modules-path finclude -o /var/tmp//ccZtzWga.s gfortran: error trying to exec 'f951': execvp: No such file or directory
Hi Peter, The following: > f951 strauss.f90 -fPIC -quiet -dumpbase strauss.f90 -mmacosx-version-min=10.4 > -mtune=generic -auxbase strauss -version -ffixed-form -ffixed-line-length-132 > -fbounds-check -fmax-errors-0 -fintrinsic-modules-path finclude -o > /var/tmp//ccZtzWga.s > gfortran: error trying to exec 'f951': execvp: No such file or directory shows that it's a packaging problem and not a problem with the compiler codebase. Because you talk about "gfortran-intel-bin.tar", I suppose you use the binaries from http://hpc.sourceforge.net/, so you should report the problem to them. Meanwhile, there are 2 things you can do to get a working compiler: 1. Add /usr/local/libexec/gcc/i686-apple-darwin8.8.1/4.3.0 to you PATH environment variable. If packaging was correct, this shouldn't be needed, but in the current situation this will get the compiler working. (NB: the last two components of the path above may be slightly different; the bottom line is, find what is the subdirectory of /usr/local/libexec that contains an executable file named f951) 2. You can alternatively try downloading the binaries provided by the gfortran team (well, by me, in fact), at http://gcc.gnu.org/wiki/GFortranBinaries They come as an Apple installer (which might be better or worse, depending on your point of view!) and should work out of the box. Since this is not a bug in GCC/gfortran, I'm closing this bug-report.
I followed the instructions in the 3rd comment, actually I installed the suggested binary from the link in point 2 first but the problem persists. Looking at the contents of /usr/local/libexec/gcc/i686-apple-darwin8/4.2.3/ may give an answer, it contains an empty folder called "install-tools". Any other suggestions for getting gfortran to run on OSX (Lion)?