Performance Tools for Software Developers - Using Multiple Versions of Microsoft Visual C++* at the Command Line

If you have multiple versions of Microsoft Visual Studio* installed on your system, the Intel® C++ and Fortran Compilers for Windows* install command-line support for one version only (chosen during installation). If you need command-line support for other installed versions of Visual Studio, use the method described here.

Let's start by assuming you installed the Intel® C++ Compiler for Windows* with command line support for Microsoft Visual Studio 2008 on a system that also has Microsoft Visual Studio 2005. This implies that the Windows Start Menu for the Intel C++ Compiler includes the Build Environment for IA-32 Applications. Clicking this menu item opens a command window set up to run the Intel C++ Compiler from the command line using the linker, runtime include files, and runtime libraries that come with Microsoft Visual Studio 2008.

If you need command-line support for both versions of Visual Studio, follow these steps for Intel C++ Compiler 10.1 version:

  1. A default installation of the Intel C++ Compiler places the IA-32 binaries in "C:\Program Files\Intel\Compiler\C++\10.1.025\IA32\Bin"; 
    In this directory,
        copy iclvars.bat to my_vs2008.bat and to my_vs2005.bat; 
        copy icl.cfg to my_vs2008.cfg and to my_vs2005.cfg. 
  2. Update for Visual C++ 2005:
    1. Edit my_vs2005.bat in Notepad and add this line to the end of the file: 
          @call "C:\Program Files\Microsoft Visual Studio 8\VC\bin\Vcvars32.bat" ---- make sure VS2005 vcvars32.bat is called
          SET ICLCFG=my_vs2005.cfg  ---- add this line 
    2. Edit my_vs2005.cfg in Notepad and replace all with following:  
          /Qvc8
          -Qlocation,link,"C:\Program Files\Microsoft Visual Studio 8\VC\Bin"
    3. Now the "my_vs2005.bat" will set up the correct environment for Visual C++ 2005 mode.
  3. Update for Visual C++ 2008:
    1. Edit my_vs2008.bat in Notepad and add this line to the end of the file: 
          @call "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\Vcvars32.bat" ---- make sure VS2008 vcvars32.bat is called
          SET ICLCFG=my_vs2008.cfg  ---- add this line 
    2. Edit my_vs2008.cfg in Notepad and replace all with following:  
          /Qvc9
          -Qlocation,link,"C:\Program Files\Microsoft Visual Studio 9.0\VC\Bin"
    3. Now the "my_vs2008.bat" will set up the correct environment for Visual C++ 2008 mode.

 

If you need command-line support for both versions of Visual Studio, follow these steps for Intel C++ Compiler 11.0 version:

  1. A default installation of the Intel C++ Compiler is "C:\Program Files\Intel\Compiler\11.0\059\cpp\bin"; The file "iclvars.bat" is installed under this directory. It defatuls to use the latest Visual C++ compiler version. So if you have both Visual Studio 2005 and 2008 installed, it defaults to use Visual Studio 2008.
  2. Update "iclvars.bat" for Visual C++ 2005:
    1. Edit iclvars.bat in Notepad and add following to the top: 
      if {%1} EQU {ia32_vs2005} (
        @call "C:\Program Files\Intel\Compiler\11.0\xxx\cpp\bin\ia32\iclvars_ia32_vs2005.bat"
        if exist "C:\Program Files\Intel\Compiler\11.0\xxx\cpp\tbb\ia32\vc8\bin\tbbvars.bat" @call "C:\Program Files\Intel\Compiler\11.0\xxx\cpp\tbb\ia32\vc8\bin\tbbvars.bat"
        if exist "C:\Program Files\Intel\Compiler\11.0\xxx\cpp\mkl\tools\environment\mklvars32.bat" @call "C:\Program Files\Intel\Compiler\11.0\xxx\cpp\mkl\tools\environment\mklvars32.bat"
        if exist "C:\Program Files\Intel\Compiler\11.0\xxx\cpp\ipp\ia32\tools\env\ippenv.bat" @call "C:\Program Files\Intel\Compiler\11.0\xxx\cpp\ipp\ia32\tools\env\ippenv.bat"
        exit /B 0
    2. under "C:\Program Files\Intel\Compiler\11.0\xxx\cpp\bin\ia32" directory:
        copy iclvars_ia32.bat to iclvars_ia32_vs2005.bat
    3. Edit iclvars_ia32_vs2005.bat in Notepad and replace all with following:  
          @call "C:\Program Files\Microsoft Visual Studio 8\VC\bin\Vcvars32.bat" ---- make sure VS2005 vcvars32.bat is called
    4. Now the "iclvars.bat ia32_vs2005" will set up the correct environment for Visual C++ 2005 mode.

 

Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.