Fortran compilation on Linux
1. gfortran
Type
Then, it will create yourfile.x in the same directory.
Simply type yourfile.x will execute it.
See more examples at https://gcc.gnu.org/wiki/GFortranGettingStarted
2. Intel Fortran
Students as well as instructors can receive free copy of intel compilers at https://software.intel.com/en-us/qualify-for-free-software/student
Once you installed it, you should put the following lines in your .cshrc file. for c shell.
If you use b shell, compilervars.csh should be replaced with compilervars.sh.
After this, you should run .cshrc by typing
Type
fortran yourfile.f90 -o yourfile.x
Then, it will create yourfile.x in the same directory.
Simply type yourfile.x will execute it.
See more examples at https://gcc.gnu.org/wiki/GFortranGettingStarted
2. Intel Fortran
Students as well as instructors can receive free copy of intel compilers at https://software.intel.com/en-us/qualify-for-free-software/student
Once you installed it, you should put the following lines in your .cshrc file. for c shell.
If you use b shell, compilervars.csh should be replaced with compilervars.sh.
<install_dir>/bin/compilervars.csh intel64
where <install_dir> is the directory structure containing the compiler /bin directory
The default path for <install_dir> is /opt/intel/
setenv LD_LIBRARY_PATH "/usr/lib64"
set path=( $path /opt/intel/bin )
After this, you should run .cshrc by typing
source .cshrc
Then you can compile your file as
Comments
Post a Comment