Using the compilervars File to Specify Location of Components

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 product includes a batch file that you can run to set environment variables.

The following information is operating system-dependent.

Linux OS and Mac OS X:

To source an environment script, enter one of the following on the command line:

source <install-dir>/bin/compilervars.sh <arg>

or

source <install-dir>/bin/compilervars.csh <arg>

If you want the script to run automatically, add the same command to the end of your startup file.

Sample .bash_profile entry for compilervars.sh:

# set environment vars for Intel C++ compiler
source <install-dr>/bin/compilervars.sh ia32

With some Linux* distributions, if you source compilervars.sh from your .bash_profile, the location of LIBRARY_PATH may not be set as you would expect. It may be necessary to source compilervars.sh after starting your terminal session. This affects the Intel C++ compiler (icpc) only.

Windows OS:

Under normal circumstances, you do not need to run the batch file. The Intel C++ command-line window sets these variables for you automatically.

Note iconNote

You will need to run the batch file if you open a command-line window instead of using the provided one or if you want to use the compiler from a script of your own.

The batch file inserts the directories used by the Intel C++ compiler 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.

The batch file takes two arguments:

<install-dir>\bin\compilervars.bat <arg1> [<arg2>]

<arg1> is one of the following

<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.


Submit feedback on this help topic

Copyright © 1996-2011, Intel Corporation. All rights reserved.