Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26733 Discussions

Strange problem with nmake and Intel Fortran

Arjen_Markus
Valued Contributor III
197 Views

Hello,

I have run into a rather peculiar problem with nmake and ifort. I have a makefile to build a library and two programs. When I run nmake, all goed well except when building the programs. However, when I use exactly the same command via the command prompt, these steps succeed. Here is the output to the screen:

D:\flibs\tests\sqlite>nmake

Microsoft (R) Program Maintenance Utility Version 12.00.21005.1
Copyright (C) Microsoft Corporation.  All rights reserved.

        ifort  /exe:test_sqlite.exe csvtable.obj libfsqlite.lib
Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Inte
l(R) 64, Version 15.0.1.148 Build 20141023
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

Microsoft (R) Incremental Linker Version 12.00.40629.0
Copyright (C) Microsoft Corporation.  All rights reserved.

-out:test_sqlite.exe
-subsystem:console
csvtable.obj
libfsqlite.lib
LINK : fatal error LNK1104: cannot open file 'ifconsol.lib'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Intel\Composer XE 2015\bin\i
ntel64\ifort.EXE"' : return code '0x450'
Stop.

D:\flibs\tests\sqlite>ifort /exe:test_sqlite.exe csvtable.obj libfsqlite.lib
Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Inte
l(R) 64, Version 15.0.1.148 Build 20141023
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

Microsoft (R) Incremental Linker Version 12.00.40629.0
Copyright (C) Microsoft Corporation.  All rights reserved.

-out:test_sqlite.exe
-subsystem:console
csvtable.obj
libfsqlite.lib

D:\flibs\tests\sqlite>

I have tried to identify the difference via the option /watch:all, but apart from the names of temporary object files and the like, there is no difference that I can detect.

What can I do about this?

0 Kudos
2 Replies
IanH
Black Belt
197 Views

My guess is that your makefile happens to have a variable called LIB, which ends up being exported into the environment when the ifort compiler driver is invoked by nmake, and which then mucks up the search path for libraries.

Arjen_Markus
Valued Contributor III
197 Views

Oh dear, spot on! I do define a macro LIB to take care of platform dependencies - I had not realised that this might interfere with the environment variables

Thanks, this makes sense.

Reply