I have tried to compile a simple helloworld.f95 on my Mac, using emacs. The root of emacs was set in the directory containing helloworld.f95. I used the following commands
M-x compile gfortran -o helloworld helloworld.f95
I got the following error:
-*- mode: compilation; default-directory: "~/Desktop/fortran/" -*- Compilation started at Wed Sep 4 17:37:51 gfortran -o helloworld helloworld.f95 /bin/bash: gfortran: command not found Compilation exited abnormally with code 127 at Wed Sep 4 17:37:51
I have previously been able to compile with the same command on the terminal. Fortran was installed on my mac by following the instructions on this link: http://www.lapk.org/gfortran/gfortran.php?OS=7
The location in which gfortran is installed is at:
Desktop$ which gfortran /usr/local/bin/gfortran
How do I compile .f95 files from emacs, as well as run them?
PATHcorrectly for terminals, not for GUI applications.