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.
On Linux* OS and Mac OS* X, the file is a shell script called compilervars.sh or compilervars.csh.
On Windows* OS, the file is a batch file called compilervars.bat.
The following information is operating system-dependent.
Set the environment variables before using the compiler. You can use the source command to execute the shell script, compilervars.sh or compilervars.csh, from the command line to set them.
The script takes an architecture argument:
ia32: Compiler and libraries for IA-32 architecture only
intel64: Compiler and libraries for Intel® 64 architecture only
For example, to execute this script file for the bash shell:
The user should use /opt/intel/bin/compilervars.sh ia32 if it is a "root" install or <path>/intel/bin/compilervars.sh ia32 if it is personal install. Or as in other file <install dir> notation.
source <install-dir>/bin/compilervars.sh <arg>
source <install-dir>/bin/compilervars.sh ia32
If you use the C shell, use the .csh version of this script file:
source <install-dir>/bin/compilervars.csh ia32
If you want compilervars.sh to run automatically when you start Linux OS or Mac OS X, you can 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 <install-dir>/bin/compilervars.sh ia32
If you compile a program without ensuring the proper environment variables are set, you will see an error similar to the following 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
Under normal circumstances, you do not need to run the compilervars.bat batch file. The Fortran command-line window sets these variables for you automatically.
To activate this command-line window, select the desired command line mode such as IA-32 Visual Studio 2008 mode available from the Start>All Programs><your installed product> menu item.
You will need to run the batch file if you open a command-line window without using one of the provided menu items in the Intel Compiler 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 OS. 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 compilervars.bateach 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>]
<arg1> is one of the following
ia32: Compiler and libraries for IA-32 architecture only
ia32_intel64: Compiler running on IA-32 architecture that generates code for Intel® 64 architecture; uses Intel® 64 architecture libraries
intel64: Compiler and libraries for Intel® 64 architecture only
<arg2>, if specified, is one of the following:
If <arg2> is not specified, the script uses the version of Visual Studio that was detected during the installation procedure.
Copyright © 1996-2010, Intel Corporation. All rights reserved.