- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I may often have several instances of Visual Studio open and changing compiler setting in one changes it in all of them !
My main use of it is maintenance of old releases of our software. I must load the old solution, change the compiler setting, compile and hopefully remember to change it back afterwards.
Can we have the compiler version setting as part of the solution or even project settings instead?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Write a .bat file that invokes the ifortvars.bat for the compiler version you want and then does:
devenv /useenv
This will start Developer Studio with that particular compiler's environment set and won't use the global settings. So you can have multiple VS copies open, each with their own compiler environment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My bat file contains:
call "C:\Program Files (x86)\Intel\Compiler\11.1\065\bin\ifortvars.bat"
devenv /useenv
But Visual Studio starts up using the last version I was using, i.e. 11.0.074
It is inconveniant to have to customise your software to make use of multiple compiler versions.
It is the project that requires the compiler version and that is the most conveniant place to store that information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a couple oficons inthe QuickStart toolbarfrom the Start Programs->Intel Software Development Tools ->Fortran Build Environment etc and set the "start in"to the directory where my login batch files reside.
Here is part of the login32.bat file which asks me to choose fromversion 054,60 or 65
rem #****************************************************
rem # Compiler
rem #****************************************************
echo Compiler Version
echo 1 ivf 065
echo 2 ivf 060
echo 3 ivf 054
set /p ans=Select compiler [1]
if '%ans%'=='' set ans=1
if '%ans%'=='1' set IFORT_COMPILER11="c:\Program Files (x86)\Intel\Compiler\11.1\065"
if '%ans%'=='2' set IFORT_COMPILER11="c:\Program Files (x86)\Intel\Compiler\11.1\060"
if '%ans%'=='3' set IFORT_COMPILER11="c:\Program Files (x86)\Intel\Compiler\11.1\054"
set IfortInstallDir=%IFORT_COMPILER11%\
%IfortInstallDir%\bin\ifortvars ia32 vs2008
set PATH=%path%;%vspath%
As you can see the default is version 065
I have just opened a shell and selected 054 then I ran devenv with /useenv here is the output:
c:\les\code\Intel_Support_and_Tests\test>devenv /useenv ivftest.sln /rebuild "debug|win32"
Microsoft Visual Studio Version 9.0.30729.1.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Rebuild All started: Project: ivftest, Configuration: Debug Win32 ------
1>Deleting intermediate files and output files for project 'ivftest', configuration 'Debug|Win32'.
1>Compiling with "C:\Program Files (x86)\Intel\Compiler\11.1\054\Bin\ia32\ifort.exe"...
1>ivf.f90
1>Linking...
1>Embedding manifest...
1>
1>Build log written to "file://c:\les\code\Intel_Support_and_Tests\test\Debug\BuildLog.htm"
1>ivftest - 0 error(s), 0 warning(s)
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
Showing it was compiled with version 054 and linked OK
Hope this helps
Les
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
echo off
rem #****************************************************
rem # Compiler
rem #****************************************************
echo Compiler Version
echo 1 ivf 11.1.065
echo 2 ivf 11.0.074
set /p ans=Select compiler [1]
if '%ans%'=='' set ans=1
if '%ans%'=='1' set IFORT_COMPILER11="C:\Program Files (x86)\Intel\Compiler\11.1\065"
if '%ans%'=='2' set IFORT_COMPILER11="C:\Program Files (x86)\Intel\Compiler\11.0\074\fortran"
set IfortInstallDir=%IFORT_COMPILER11%\
call %IfortInstallDir%\bin\ifortvars ia32 vs2008
set PATH=%path%;%vspath%
devenv /useenv
Here is out from running the script:
D:\dev\FortranDevBranch>echo off
Compiler Version
1 ivf 11.1.065
2 ivf 11.0.074
Select compiler [1]2
Intel Visual Fortran Compiler Professional for applications running on IA-32, Version 11.0.074
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.
Setting environment for using Microsoft Visual Studio 2008 x86 tools.
Visual studio started up using "Latest" which is 11.1.065
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maybe this can be fixed?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page