Intel® Fortran Compiler 18.0 Developer Guide and Reference
Before you invoke the compiler, you may need to set certain environment variables that define the location of compiler-related components.
The Intel® Fortran Compiler includes compilervars scripts to set environment variables:
The following information is operating system dependent.
Set the environment variables before using the compiler by sourcing the shell script compilervars.sh or compilervars.csh. Depending on the shell, you can use the source command or a . (dot) to source the shell script, according to the following rules:
//# Bash shell: source /<install-dir>/bin/compilervars.sh <arg> . /<install-dir>/bin/compilervars.sh <arg> //# examples: (assuming <install-dir> is /installed/compiler/) prompt> source /installed/compiler/bin/compilervars.sh ia32 prompt> . /installed/compiler/bin/compilervars.sh ia32 // OR //# C shell: source /<install-dir>/bin/compilervars.csh <arg> //# example: (assuming <install-dir> is /installed/compiler/) prompt> source /installed/compiler/bin/compilervars.csh ia32 // OR //# Dash or other POSIX-compliant shell: . /<install-dir>/bin/compilervars.sh <arg> //# example: (assuming <install-dir> is /installed/compiler/) prompt> . /installed/compiler/bin/compilervars.sh ia32
The environment script file requires a target architecture argument <arg>:
If you want the script to run automatically, add the same command to the end of your startup file.
For example, a .bash_profile entry for compilervars.sh for IA-32 architecture targets only:
# set environment vars for Intel® Fortran Compiler
source <install-dir>/bin/compilervars.sh ia32
If the proper environment variables are not set, an error similar to the following appears when attempting to execute a compiled program:
./a.out: error while loading shared libraries: libimf.so: cannot open shared object file: No such file or directory
Under normal circumstances, you do not need to run the compilervars.bat batch file. The Intel® Fortran command line sets these variables automatically.
For information on using the command line see Using the Command Line on Windows*.
The batch file inserts the directories used by the Intel® Fortran Compiler at the beginning of the existing paths. Because these directories appear first, they are searched before the directories in the path lists that are provided by Windows*. This is especially important if the existing path includes directories with files that have the same names as those needed by the Intel® Fortran Compiler.
If needed, you can run compilervars.bat each time you begin a session on Windows* systems by specifying it as the initialization file with the PIF Editor.
The batch file takes two arguments:
<install-dir>\bin\compilervars.bat <arg1> [<arg2>]
Where <arg1> is one of the following:
The <arg2> is optional. If specified, it is one of the following: