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

ifort11.1 install, ifconsol.lib

h_i_gassmann
Beginner
2,249 Views

I downloaded and installed an evaluation copy of the ifort 11.1 fortran compiler. I wrote a very simple "hello world" program that I cannot manage to link. I am running in a virtual Windows XP box under VMWare on a Windows Vista host and get linker error

LNK1104: Cannot open file 'ifconsol.lib'.

I located several versions of this file and made sure that the path to one of them (Intel\\Compiler\\11.1\\060\\lib\\ia32) is included in the Lib environment variable. (I even went back to make sure that there was no confusion between 'zero' and the letter 'O' --- to no

avail.) What am I doing wrong?

0 Kudos
10 Replies
Steven_L_Intel1
Employee
2,249 Views
If you are building in Visual Studio, the LIB environment variable is not used. Look instead at Tools > Optiona > Intel Visual Fortran > Compilers, and then at the setting for Library file paths. You can try clicking the Reset button to see if that solves the issue.

You should see $(IFortInstallDir)lib\ia32 in the list. IFortInstallDir is created by the VS integration and won't be visible outside VS.

I assume that you installed into this virtual machine.
0 Kudos
h_i_gassmann
Beginner
2,249 Views
I am actually building at the command line. This was a simple test to make sure I can access the compiler.
Ultimately, I am trying to build an open source C++ project under MSYS. The project uses some third-party code written in fortran, hence the need for ifort.
0 Kudos
Steven_L_Intel1
Employee
2,249 Views
Please show the output of the command (and the command itself) you use to link the program. Which Visual Studio version are you using that supplies the linker? Does adding /libdir: with the path to the folder help?
0 Kudos
h_i_gassmann
Beginner
2,249 Views
First, the program:

Y:> type test.f90

program test
print *,"Hello world"
stop
end program


Next the output:

Y:>ifort test.f90

Intel Visual Fortran Compiler Professional for applications running on IA-32,

Version 11.1 Build 20100203 Package ID: w_cprof_p_11.1.060

Copyright (C) 1985-2010 Intel Corporation. All rights reserved.

Microsoft Incremental Linker Version 9.00.21022.08

Copyright (C) Microsoft Corporation. All rights reserved.

-out:junk.exe

-subsystem:console

junk.obj

LINK : fatal error LNK1104: cannot open file 'ifconsol.lib'


Here is what happens if I use the /libdir: directive:

Y:>ifort test.f90 /libdir:c:\program files\Intel\Compiler\11.1\060\lib\ia32

Intel Visual Fortran Compiler Professional for applications running on IA-32,

Version 11.1 Build 20100203 Package ID: w_cprof_p_11.1.060

Copyright (C) 1985-2010 Intel Corporation. All rights reserved.

ifort: command line error: Unrecognized keyword 'c:\program' for option '/libdir'


Using forward slashes did not help, either:

Y:>ifort test.f90 /libdir:/c/program files/Intel/Compiler/11.1/060/lib/ia32

Intel Visual Fortran Compiler Professional for applications running on IA-32,

Version 11.1 Build 20100203 Package ID: w_cprof_p_11.1.060

Copyright (C) 1985-2010 Intel Corporation. All rights reserved.

ifort: command line error: Unrecognized keyword '/c/program' for option '/libdir'

What else can I try?

Thanks

gus gassmann

0 Kudos
Steven_L_Intel1
Employee
2,249 Views
Add at the end of the command line:

/link /libdir:"c\program files\Intel\Compiler\11.1\060\lib\ia32"

How did you start this command prompt session? Did you use the "Fortran Build Environment" shortcut installed by Intel Fortran?
0 Kudos
h_i_gassmann
Beginner
2,249 Views
Add at the end of the command line:

/link /libdir:"c\program files\Intel\Compiler\11.1\060\lib\ia32"

----

Here is what I did:

Y:>ifort junk.f90 /link /libdir:"c:\program files\Intel\Compiler\11.1\060\lib\ia32"

Intel Visual Fortran Compiler Professional for applications running on IA-32,

Version 11.1 Build 20100203 Package ID: w_cprof_p_11.1.060

Copyright (C) 1985-2010 Intel Corporation. All rights reserved.

Microsoft Incremental Linker Version 9.00.21022.08

Copyright (C) Microsoft Corporation. All rights reserved.

-out:junk.exe

-subsystem:console

"/libdir:c:\program files\Intel\Compiler\11.1\060\lib\ia32"

junk.obj

LINK : warning LNK4044: unrecognized option
'/libdir:c:\program files\Intel\Compiler\11.1\060\lib\ia32'; ignored

LINK : fatal error LNK1104: cannot open file 'ifconsol.lib'

As you can see, the quotes did not make a difference.

-------------

How did you start this command prompt session? Did you use the "Fortran Build Environment" shortcut installed by Intel Fortran?


No. It is a standard DOS command box. I am not sure what you mean by "Fortran Build Environment".

0 Kudos
h_i_gassmann
Beginner
2,249 Views
OK. I am making some progress. By using /libpath: instead of /libdir: I managed to get the porgram to compile and link. However, I would like to store the library path in an environment variable, so I do not have to type all this stuff in every time. Would you happen to know which variable to use? I thought it should be Lib, but this does not seem to work.
0 Kudos
TimP
Honored Contributor III
2,249 Views
The quotes would need to be as Steve suggested, around the path only. He refers to the DOS command box which you would open by clicking on the shortcut on the Start > Intel Software Development... > Intel Fortran > Fortran Build environment
That is the one which has built in the paths which the installer came up with.
According to your results, your Windows global environment path settings for ifort may be messed up. You might want to correct or remove any references there, using the Windows System Properties > Advanced > Environment Variables (or equivalent, depending on your Windows version).
0 Kudos
h_i_gassmann
Beginner
2,249 Views
Thanks a lot to Steve Lionel and tim18 for helping me solve the problem. In the end it was a boneheaded mistake I made: Somehow I managed to introduce a trailing blank into the environment variable. What I am a bit puzzled about, though,is why I had to edit the environment variable at al. I would have thought that the install process should take care of that for me.

Anyway, thanks again.
0 Kudos
Steven_L_Intel1
Employee
2,249 Views
My mistake - the option is /LIBPATH not /LIBDIR.

The install does not modify the system LIB environment variable, as there are multiple build environments you might use. The best way to set up the environment, as Tim suggests, is to use the provided "Build Environment" shortcuts which set up everything as needed. For these, you need to specify whether you are building for IA-32 or Intel 64, and optionally, which VS version you want to use for its tools and libraries. For more information, please read the compiler documentation on Building Applications from the Command Line.

What I usually do is drag a copy of the shortcut I want to my desktop.
0 Kudos
Reply