"ERROR: Visual Studio 2005, 2008 or 2010 is not found in the system" when launching Intel 64 command prompt from Start menu

Problem : "ERROR: Visual Studio 2005, 2008 or 2010 is not found in the system" when launching the Intel 64 command prompt from Start menu


Environment :

  • OS: Windows IA32 or Intel-64OS
    • like Microsoft *Windows 7*, Windows XP*, Microsoft Windows Vista*, Microsoft Windows Server 2003*, Microsoft Windows Server 2008* or Microsoft Windows HPC Server 2008*
  • Product:
    • Intel C++ Composer XE for Windows 2011
      • On systems only Visual C++ 2008 express edition or Visual C++ 2010 express edition and Microsoft Windows SDK for Windows 7 are installed.
    • Intel C++ Composer XE for Windows 2013
      • On systems only Visual C++ 2008 express edition or Visual C++ 2010 express edition and Microsoft Windows SDK for Windows 7 are installed.

Root Cause :
This feature is not implemented since begining because Visual C++ 2008 or 2010 express edition does not come with the Intel-64 compiler and tools. But if the Microsoft Windows SDK for Windows 7 does come with the x64 compiler and tools.

To implement the feature has big risk because it will need to change many files in the installation program. So we publish this article to work-around the problem for now.

Without the work-around the error "ERROR: Visual Studio 2005, 2008 or 2010 is not found in the system" will be emitted when launch the command prompt from the highlighed menu item beloe "Intel 64 Visual Studio 2010 mode" or "Intel 64 Visual Studio 2008 mode".

cmd_prompt.png

 

Resolution 1:

Please follow the instructions below for work-around.

  1. Locate the file "compilervars_arch.bat" at "<intelc-install-dir>\ComposerXE-2011\bin\compilervars_arch.bat": default installation is "c:\Program Files (x86)\ComposerXE-2011\bin\compilervars_arch.bat" on an Intel-64 system or "c:\Program Files\ComposerXE-2011\bin\compilervars_arch.bat" on an IA32 system.
  2. For setting up to use the "Intel 64 Visual Studio 2010 mode" command prompt:
      1. Open above file "compilervars_arch.bat" with Notepad:
     
      1. Add the following code snipet before "::default" label:

    ::detect installed VS
    set MSVS_VAR_SCRIPT=
    if /i "%WindowsSDKDir%"=="" (
    set WindowsSDKDir=%ProgramFiles%\Microsoft SDKs\Windows\v7.1\
    )

    ::default
    .......

     
      1. Add the following code snipet under "::VS2010" label:

    ......
    ::VS2010
    if /i "%TARGET_VS%"=="vs2010" (
      if defined WindowsSDKDir (
        if exist "%WindowsSDKDir%\Bin\SetEnv.cmd" (
          set MSVS_VAR_SCRIPT="%WindowsSDKDir%\Bin\SetEnv.cmd"
          goto Calls
        )
      )
      call :no_vs 2010
      goto End
    )
    .......

    1. Create a new set_icl64_env.bat file under "C:\Program Files (x86)\Intel\ComposerXE-2011\bin" with following:
      rem on IA32 OS, add following line
      "%~dp0compilervars_arch.bat" ia32_intel64 vs2010

      rem on x64 OS, add following line
      "%~dp0compilervars_arch.bat" intel64 vs2010
    2. Add a new command prompt menu item "My Intel-64 Visual Studio 2010 mode": the instructions on how to add can be found on msdn site. Search "adding new items to start menu". Or follow the instructions below for how to add to Windows 7 [Start] menu:
      1. Click [Start], then right click on [All programs], select "Open All Users": this brings up an explorer like window, navigate to [Programs > Intel Parallel Studio XE 2011 > Command Prompt > Parallel Studio XE with intel Compiler XE..]
      2. Do a copy/paste the shortcut "IA-32 Visual Studio 2010 mode" at the same folder
      3. Rename the new shortcut to "My Intel-64 Visual Studio 2010 mode"
      4. Right click on new shortcut and select "Properties", and use the following cmd as the "Target":
        C:\Windows\System32\cmd.exe /E:ON /V:ON /K ""%ICPP_COMPILER12%bin\set_icl64_env.bat""
      5. Now the start menu shortcut is ready to use.
  3. If you use "Intel 64 Visual Studio 2008 mode": the steps are very similar to above, but replace "vs2010" with "vs2008" 
      1. Open above file "compilervars_arch.bat" with Notepad:
        Add the following code snipet under "::VS2008" label and before "call :no_vs 2008"
     
      1. Add the following code snipet before "::default" label:

    ::detect installed VS
    set MSVS_VAR_SCRIPT=
    if /i "%WindowsSDKDir%"=="" (
    set WindowsSDKDir=%ProgramFiles%\Microsoft SDKs\Windows\v7.1\
    )

    ::default
    .......

     
      1. Add the following code snipet under "::VS2008" label:

    ......
    ::VS2008
    if /i "%TARGET_VS%"=="vs2008" (
      if defined WindowsSDKDir (
        if exist "%WindowsSDKDir%\Bin\SetEnv.cmd" (
          set MSVS_VAR_SCRIPT="%WindowsSDKDir%\Bin\SetEnv.cmd"
          goto Calls
        )
      )
      call :no_vs 2008
      goto End
    )
    .......

    1. Create a new set_icl64_env.bat file under "C:\Program Files[ (x86)]\Intel\ComposerXE-2011\bin" with following:
      rem on IA32 OS, add following line
      "%~dp0compilervars_arch.bat" ia32_intel64 vs2008

      rem on x64 OS, add following line
      "%~dp0compilervars_arch.bat" intel64 vs2008
    2. Add a new command prompt menu item "My Intel-64 Visual Studio 2008 mode": the instructions on how to add can be found on Microsoft msdn* site. Or follow the instructions below for how to add to Windows 7 [Start] menu:
      1. Click [Start], then right click on [All programs], select "Open All Users": this brings up an explorer like window, navigate to [Programs > Intel Parallel Studio XE 2011 > Command Prompt > Parallel Studio XE with Intel Compiler XE..]
      2. Do a copy/paste the shortcut "IA-32 Visual Studio 2008 mode" at the same folder
      3. Rename the new shortcut to "My Intel-64 Visual Studio 2008 mode"
      4. Right click on new shortcut and select "Properties", and use the following cmd as the "Target":
        C:\Windows\System32\cmd.exe /E:ON /V:ON /K ""%ICPP_COMPILER12%bin\set_icl64_env.bat""
      5. Now the start menu shortcut is ready to use.

Resolution 2: the script file is created for Intel C++ Composer XE 2013 and for Visual Studio 2010 express edition users only. Similar file could be created for Visual Studio 2008 express edition.

  1. Download this script file "compilervars_arch_x64_bat.txt", rename it to "compilervars_arch_x64.bat".
    1. verify all the path in the script file match what your system has.
  2. Follow the instruction above 3.b on adding the new command prompt menu item but with following cmd: 
    1. C:\Windows\System32\cmd.exe /E:ON /V:ON /K ""%ICPP_COMPILER12%bin\compilervars_arch_x64.ba""
For more complete information about compiler optimizations, see our Optimization Notice.