Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29280 Discussions

LNK1104: cannot open file 'LIBC.lib'

ssmeulders
Beginner
1,453 Views

Ineed to install 8.1 for IA-32 processors (only)

As the prerequisite software, I am using Microsoft Visual C++ 2005 Express

The Fortran build I am using is: w_fc_pc_8[1].1.042.exe

As indicated elsewhere in this forum, I fixed the paths inifortvars.bat and ifort.cfg

My attempt to compile is then met with:

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

libc.lib does not reside on my system. It is my understanding that I only need

the Microsoft Platform SDK for IA-64 applications.

Why then is ifort in need of libc.lib and is there a workaround?

0 Kudos
7 Replies
TimP
Honored Contributor III
1,453 Views
http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/ explains the steps you need to prepare for ifort installation. Both 32- and 64-bit SDKs are separate downloads.
I wouldn't call that a workaround; it's the documented procedure.
The workaround comes in that the location of the linker in the SDK has to be edited into ifort.cfg in the ifort in installation directory. If you are lucky, it may occur automatically if you repeat the installation, which you can do by starting the install in the download directory which was created the first time you tried. In my case, the path was not complete, although enough of it was present to show that the installer found the SDK automatically.
0 Kudos
Steven_L_Intel1
Employee
1,453 Views
First, as I think you understand, VS2005 is not supported for use with 8.1. You found the instructions as to how you can make it work. One issue is that VS2005 no longer includes the static, single-threaded library (LIBC.LIB), but 8.1 doesn't know that. Build with /MT or any of the options other than /ML to avoid this problem. IVF 9.1 defaults to /MT (/libs:static /thread) if VS2005 is being used.
0 Kudos
Nick_H_2
Beginner
1,453 Views

I have installed VS2005(using vcsetup.exe version 2.0.50727.42)and PSDK (PSDK-x86.exe version 6.0.2600.0) in order to use IVF 9.1 (Build 20070322Z installed without the IDE).

I had previously been using .NET 2003 to provide the stuff that is needed to use IVF (flames suppressed) but switched to the free VS2005 because my university stopped licensing .NET 2003. I removed .NET 2003 and related materials before installing VC2005 and PSDK.

Attempts to compile from the command lineproduces this error:

ifort /nologo /nbs /w /4Yportlib /Gs /Ob1gyti /Qprec_div /Fetheopd FSUBS.for @link.txt
LINK : fatal error LNK1104: cannot open file 'LIBC.lib'

Despite the previous message in this thread it seems on my installation that the /MT default doesn't work to suppress the linker attempting to open LIBC.lib. I have tried adding /MT with/link /NODEFAULTLIB:LIBC to ifort.cfg like this:

# Enable Microsoft Visual C++* .NET 7.1 compatibility
-Qvc7.1

# Path to Microsoft Visual C++* .NET 7.1 linker
-Qlocation,link,"C:Program FilesMicrosoft Visual Studio 8VCBin"

# Suppress linker search for unneeded LIBC.lib
/MT /link /NODEFAULTLIB:LIBC

This works to suppress the linker error message. /MT alone was not enough - I had to have both extra options in order to make it work.

So does IVF 9.1 somehow remember it was installed with .NET 2003 and thendoes not use the proper switches when it is used with VS 2005?

0 Kudos
TimP
Honored Contributor III
1,453 Views
My experience has been that VS2005 Express requires ifort.cfg edits. I'd be a little surprised by ifort 9.1 requiring the NODEFAULTLIB, unless you have a .obj which was built without /MT.
0 Kudos
Steven_L_Intel1
Employee
1,453 Views
Open the compiler's IA32BINifort/cfg file and look for a line that starts /Qvc. Change it to read:

/Qvc8

0 Kudos
Nick_H_2
Beginner
1,453 Views

Steve, I tried changing ifort.cfg from the original setting:

-Qvc7

to

/Qvc8

but this caused the same LNK1104: cannot open file 'LIBC.lib' error.

I have to add

# Suppress linker search for unneeded LIBC.lib
/MT /link /NODEFAULTLIB:LIBC

for a successful compilation.

0 Kudos
Steven_L_Intel1
Employee
1,453 Views
You have to recompile all the sources with the new setting.
0 Kudos
Reply