Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Compiler version setting

Andrew_Smith
Valued Contributor I
949 Views
Whilst it is useful to enable use of compiler versions it is very awkward having this setting part of the global settings.

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?
0 Kudos
7 Replies
Steven_L_Intel1
Employee
949 Views
You can do this today.

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.
0 Kudos
Andrew_Smith
Valued Contributor I
949 Views
It is not working.

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.

0 Kudos
Andrew_Smith
Valued Contributor I
949 Views
When using the batch file VS2008 now says "Intel librarian xlink.exe is not found"
0 Kudos
Les_Neilson
Valued Contributor II
949 Views
I use batch files. I have a login32.bat and login64.bat
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

0 Kudos
Andrew_Smith
Valued Contributor I
949 Views
I modified your batch file as follows to allow me to start up VS and inserted call before %IfortInstallDir%\bin\ifortvars ia32 vs2008 so that the script could continue past this point.

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
0 Kudos
Andrew_Smith
Valued Contributor I
949 Views
It appears that the Tools> Options> Intel Visual Fortran> Compilers shows a different version from that which it actually uses since it shows "Latest" or whatever was last set, but actually compiles using the version from the environment.

Maybe this can be fixed?
0 Kudos
Steven_L_Intel1
Employee
949 Views
I previously asked the VS integration developers if there was something they could do about it, and I believe that this information will be improved in the next major release when /useenv is used.
0 Kudos
Reply