User Guide

  • XX.XX
  • 04/09/2020
  • Public Content

Using compilervars File

Before you invoke the compiler component of the Intel® System Studio, you must set certain environment variables that define the location of compiler-related components.
The Intel® C++ Compiler includes the
compilervars
scripts that you can run to set environment variables.
  • On Linux*, the file is a shell script called
    compilervars.sh
    or
    compilervars.csh
    .
  • On Windows*, the file is a batch file called
    compilervars.bat
    .
Using the
compilervars
script does not set the environment variables for the shared libraries used by your application. You must set the
LD_LIBRARY_PATH
environment variable on your target system.
The following information is operating system dependent.

On Linux Host Systems

Set up the Intel® C++ Compiler environment with the following command:
  • Dash or other POSIX-compliant shell
    :
    $ . <install-dir>/bin/compilervars.sh -arch <arch> -platform <platform>
  • C shell
    :
    $ source <install-dir>/bin/compilervars.csh -arch <arch> -platform <platform>
  • Bash shell
    :
    • $ source <install-dir>/bin/compilervars.sh -arch <arch> -platform <platform>
    • $ . <install-dir>/bin/compilervars.sh -arch <arch> -platform <platform>
The environment script file requires an architecture argument
<arch>
for the
-arch
option, which takes the following values:
  • intel64
    : Compiler and libraries for Intel® 64 architecture-based target systems
  • ia32
    : Compiler and libraries for IA-32 architecture-based target systems
The environment script file also takes a target platform argument
<platform>
for the
-platform
option, which can have the following value:
  • linux
    : sets environment variables for the compiler and libraries for Linux targets only. This is the default target platform. So if the
    -platform
    option is not used, the target platform is assumed to be Linux.
The default install path is
/opt/intel/bin/
if the installation is conducted by the root user.
//# Example
prompt>
source /opt/intel/bin/compilervars.sh -arch intel64 -platform linux //for Linux targets

On Windows Host Systems

Under normal circumstances, you do not need to run the
compilervars.bat
batch file. The Intel® C++ Compiler command-line window sets these variables for you automatically.
For information on using the command-line window, see the Intel® C++ Compiler 19.1 Developer Guide and Reference.
You need to run the batch file if a command-line window is opened without using one of the provided menu items in the
Start
menu, 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. This is especially important if the existing path includes directories with files having the same names as those needed by the Intel® C++ 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 syntax for using the
compilervars
batch file is as follows:
> compilervars.bat -arch <arch> -platform <platform>
The environment batch file requires an architecture argument
<arch>
for the
-arch
option, which takes the following values:
  • intel64
    : Compiler and libraries for Intel® 64 architecture-based target systems
  • ia32
    : Compiler and libraries for IA-32 architecture-based target systems
The environment batch file requires a platform argument
<platform>
for the
-platform
option, which takes the following value:
  • linux
    : sets up variables for Linux targets

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804