Before you first invoke the compiler, you need to be sure certain environment variables are set. These environment variables define the location of the various compiler-related components.
The Intel Fortran Compiler installation includes a file that you can run to set environment variables.
The following information is operating system-dependent.
Linux and Mac OS:
You need to run the shell script called ifortvars.sh or ifortvars.csh before using the compiler. Use the source command to execute the shell script from the command line. For example, to execute this script file for the bash shell:
source /opt/intel/fc/10.0/bin/ifortvars.sh
If you use the C shell, use the .csh version of this script file:
source /opt/intel/fc/10.0/bin/ifortvars.csh
If you want ifortvars.sh to run automatically when you start Linux or Mac OS, edit your .bash_profile file and add the line above to the end of your file. For example:
# set up environment for Intel compiler
source /opt/intel/fc/10.0/bin/ifortvars.sh
If you compile a program without 'sourcing' ifortvars.sh, you will see the following error when you execute the compiled program:
./a.out: error while loading shared libraries:
libimf.so: cannot open shared object file: No such file or directory
Windows:
Under normal circumstances, you do not need to run the ifortvars.bat batch file. The Fortran command-line window sets these variables for you automatically. To activate this command-line window, select Fortran Build Environment for applications... available from the Intel Fortran program folder.
You will need to run the batch file if you open a command-line window without using the provided Build Environment for applications... menu item in the Intel Fortran program folder or if you want to use the compiler from a script of your own.
The batch file inserts the directories used by Intel Fortran at the beginning of the existing paths. Because these directories appear first, they are searched before any directories in the path lists provided by Windows. This is especially important if the existing path includes directories with files having the same names as those needed by Intel Fortran.
If needed, you can run ifortvars.bat each time you begin a session on Windows* systems by specifying it as the initialization file with the PIF Editor.