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

VS22 Community edition, ifort, nmake cannot open file 'ifconsol.lib'

lszcz
Beginner
1,716 Views

Using Visual Studio 2022 community edition (17.3.2), classic ifort, and nmake to compile software along with MPICH2. Everything should be mapped correctly in my system's environment paths. However, I keep receiving the error: LINK : fatal error LNK1104: cannot open file 'ifconsol.lib'. 

Really at a loss, been spending days on this and keep receiving the same error. Any suggestions would really be appreciated. 

 

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

LINK : fatal error LNK1104: cannot open file 'ifconsol.lib'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Intel\oneAPI\compiler\2022.1.0\windows\bin\intel64\ifort.EXE"' : return code '0x450'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\Hostx64\x64\nmake.EXE"' : return code '0x2'
Stop.

0 Kudos
6 Replies
Steve_Lionel
Honored Contributor III
1,698 Views

Oh - you're using NMAKE? That was not at all clear from your earlier complaints. How have you established the compiler environment? Please do a "set lib" and show the output.

0 Kudos
Ron_Green
Moderator
1,698 Views

you are compiling from the command line, right?  Nmake would indicate that.  You didn't tell us this in your previous posts and I assumed you were using the VS IDE.

 

When you installed VS Community 2022, You did also install the C++ Components for Visual Studio?  Help -> About Microsoft Visual Studio should show "Visual C++ 2022"

 

Did you open a regular terminal window OR (preferred)  Start -> Intel oneAPI -> Intel oneAPI command prompt for Intel 64?

 

The error you show is from the link step, LINK.exe.   it doesn't know about intel fortran so you have to give it the path to our libraries OR WAY EASIER - in you configuration change the linker from LINK.EXE to IFORT.exe.  yes, it can link also and it knows where to look for libraries.  You did not say what software you are trying to compile, maybe someone here is expert on it if you care to share with us what you are doing.

 

Also, why MPICH2?  you know Intel MPI is installed as part of oneAPI HPC Kit.  And it is based on MPICH.  Change your compiler from ifort to mpiifort and you get MPI linked in automatically along with all the Fortran libs.  Yes, you can use mpiifort as your linker also.

 

Finally, you really need to start simple.  Can you compile and run hello.f90, a simple hello world?  You're killing yourself starting with a complex application.  Start simple and work up.

 

 

 

0 Kudos
lszcz
Beginner
1,672 Views

Yes! Here is my Visual Studio setup:

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

Microsoft Visual Studio Community 2022
Version 17.3.2
VisualStudio.17.Release/17.3.2+32819.101
Microsoft .NET Framework
Version 4.8.04084

Installed Version: Community

Visual C++ 2022 00476-80000-00000-AA710
Microsoft Visual C++ 2022

ASP.NET and Web Tools 17.3.376.3011
ASP.NET and Web Tools

Azure App Service Tools v3.0.0 17.3.376.3011
Azure App Service Tools v3.0.0

C# Tools 4.3.0-3.22412.4+c97184bafab9a34d61e85f1c1ef34f25283ce9ba
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Intel Libraries for oneAPI Package ID: w_oneAPI_2022.1.1.278
Intel Libraries for oneAPI – toolkit version: 2022.2.1, extension version 22.0.0.17, Package ID: w_oneAPI_2022.1.1.278, Copyright © 2019-2022 Intel Corporation. All rights reserved.
* Other names and brands may be claimed as the property of others.

Intel® C++ Compiler Package ID: w_oneAPI_2022.1.1.278
Intel® C++ Compiler – toolkit version: 2022.2.1, extension version 22.0.17, Package ID: w_oneAPI_2022.1.1.278, Copyright © 2002-2022 Intel Corporation. All rights reserved.
* Other names and brands may be claimed as the property of others.

Intel® C++ Compiler Classic Package ID: w_oneAPI_2022.1.1.278
Intel® C++ Compiler Classic – toolkit version: 2022.2.1, extension version 19.2.10.17, Package ID: w_oneAPI_2022.1.1.278, Copyright © 2002-2022 Intel Corporation. All rights reserved.
* Other names and brands may be claimed as the property of others.

Intel® DPC++ Compatibility Tool Package ID: w_oneAPI_2022.1.0.183
Intel® DPC++ Compatibility Tool – toolkit version: 2022.2.0, extension version 2022.1.0.17, Package ID: w_oneAPI_2022.1.0.183, Copyright © 2019-2022 Intel Corporation. All rights reserved.
* Other names and brands may be claimed as the property of others.

Intel® Fortran Compiler Package ID: w_oneAPI_2022.1.1.278
Intel® Fortran Compiler – toolkit version: 2022.2.1, extension version 22.0.0066.17, Package ID: w_oneAPI_2022.1.1.278, Copyright © 2002-2022 Intel Corporation. All rights reserved.
* Other names and brands may be claimed as the property of others.

Intel® oneAPI DPC++ Compiler Package ID: w_oneAPI_2022.1.1.278
Intel® oneAPI DPC++ Compiler – toolkit version: 2022.2.1, extension version 22.0.0.17, Package ID: w_oneAPI_2022.1.1.278, Copyright © 2019-2022 Intel Corporation. All rights reserved.
* Other names and brands may be claimed as the property of others.

Intel® oneAPI Menu & Samples 10.10.392.9731
Intel® oneAPI Visual Studio Menu & Samples Extension

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers

NuGet Package Manager 6.3.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Test Adapter for Boost.Test 1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test 1.0
Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory.

TypeScript Tools 17.0.10701.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 4.3.0-3.22412.4+c97184bafab9a34d61e85f1c1ef34f25283ce9ba
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual Studio IntelliCode 2.2
AI-assisted development for Visual Studio.

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

For compiling I am using a regular terminal window! 

I am compiling a numerical model called SWASH and I am using MPICH2 because SWASH states I need to use MPICH2.

Yes I agree, I think it is an issue with link. However, I cannot find a LINK.exe in my Intel OneApi structure. When I am looking at my model configuration make file and the macros file, I also do not see a link or linker variable where I can toggle the path/the executable. Do you know where these options may be located?

Yes I agree I need to start simple, bit off more than I can chew that's for sure! I will try to compile and run hello.f90.

Cheers!

0 Kudos
Ron_Green
Moderator
1,643 Views

you can indeed use intel mpi instead of mpich.  i found this on the SWASH website under installtions doc

 

all this is done after the configure.  after configure there is a file macros.inc created edit that file like this

clear out any path in INCS_MPI to C:\Program Files (x86)\Intel\oneAPI\mpi\latest\include  

clear out LIBS_MPI to C:\Program Files (x86)\Intel\oneAPI\mpi\2021.6.0\lib\release

that is, remove any paths in INCS_MPI and LIBS_MPI.  mpiifort will find them by default

 

change F90_MPI to mpiifort

 

Alternatively, the Intel MPI library may be employed instead of MPICH2 to build SWASH. This library is a part of Intel

 Fortran Compiler 14.0 or higher. In this respect, the following modifications need to be made

  • adapt the file macros.inc where the variables INCS_MPI and LIBS_MPI, referring to the directories include and lib of MPICH2, respectively, are emptied,
  • change the value of the variable F90_MPI by replacing ifort by mpiifort, and
  • the bin folder of MPICH2 must be removed from your PATH.
0 Kudos
lszcz
Beginner
1,631 Views

Gotcha, tried both approaches in a variety of flavors, no such luck. The build also seemed to require that I provide an include path because as soon as I removed it, the error demanded a path to be set. 

The workaround that I reverted to for my purposes was to install an ubuntu terminal environment and compile MPICH2 and SWASH in there. It was very straightforward, but I definitely betrayed any windows loyalty  

 

Thank you for providing all your suggestions, definitely learned a lot throughout this process.

 

Cheers!

0 Kudos
Ron_Green
Moderator
1,653 Views

Intel MPI is MPICH2, just repackaged with a few enhancements.  It should work just fine.

 

My PC seems to be corrupted.  I can't get a simple

ifort -V

 

to work.  investigating.

0 Kudos
Reply