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

Intel Fortran Library and Linker problems after Visual Studio Update

Mike-E2376
Beginner
3,342 Views

I work for a commercial engineering and science company.  Our company policies require our software to be routinely and automatically updated.  This morning, Visual Studio 2022 was updated to version 17.8.3.  After that, the Fortran and C++ Windows MDI application that I have been working on stopped compiling with different linking errors.  Initially, the error was "error LNK1104: cannot open file 'ifconsol.lib' ", which I found this KN article addressing.  However, the instructions in the article did not work.  I have the 2024 version of the Intel OneAPI and HPC installed.  But the macro from the article does not resolve to the correct location:

'$(IFORT_COMPILER24)\compiler\lib\ia32' gets resolved to the following location:

C:\Program Files (x86)\Intel\oneAPI\compiler\2024.0\windows\\compiler\lib\ia32

which does not exist on my computer.  The correct location appears to be:

C:\Program Files (x86)\Intel\oneAPI\compiler\2024.0\lib32.  I manually added this path and my application was able to compile again.  Is there a way to correct the MACRO $(IFORT_COMPILER24)?  I have other developers I am working with and we do not all necessarily have the Intel OneAPI installed in the same location, so I would prefer to use the MACRO rather than having to have each person adjust the project properties everytime someone else needs to compile the application.

The attached build log was before I found the correct path.

 

0 Kudos
1 Solution
Devorah_H_Intel
Moderator
2,679 Views

@Mike-E2376 wrote:

I work for a commercial engineering and science company.  Our company policies require our software to be routinely and automatically updated.  This morning, Visual Studio 2022 was updated to version 17.8.3.  After that, the Fortran and C++ Windows MDI application that I have been working on stopped compiling with different linking errors.  Initially, the error was "error LNK1104: cannot open file 'ifconsol.lib' ", which I found this KN article addressing.  However, the instructions in the article did not work.  I have the 2024 version of the Intel OneAPI and HPC installed.  But the macro from the article does not resolve to the correct location:

'$(IFORT_COMPILER24)\compiler\lib\ia32' gets resolved to the following location:

C:\Program Files (x86)\Intel\oneAPI\compiler\2024.0\windows\\compiler\lib\ia32

which does not exist on my computer.  The correct location appears to be:

C:\Program Files (x86)\Intel\oneAPI\compiler\2024.0\lib32.  I manually added this path and my application was able to compile again.  Is there a way to correct the MACRO $(IFORT_COMPILER24)?  I have other developers I am working with and we do not all necessarily have the Intel OneAPI installed in the same location, so I would prefer to use the MACRO rather than having to have each person adjust the project properties everytime someone else needs to compile the application.

The attached build log was before I found the correct path.

 


The macro issue is fixed in the upcoming 2024.1 HPC Toolkit release.  We appreciate your report. 

View solution in original post

0 Kudos
15 Replies
jimdempseyatthecove
Honored Contributor III
3,324 Views

>>I have other developers I am working with and we do not all necessarily have the Intel OneAPI installed in the same location,

You may be able to use the pre-build event to preset the desired environment variables.

Barring that, create a batch file containing the desired SET's, then execute the program devenv (MS VS startup program).

You can place a shortcut to this batch file on your desktop (or task bar). You could also set the icon to that of MS VS.

 

Jim Dempsey

 

 

0 Kudos
Steve_Lionel
Honored Contributor III
3,317 Views

This is fascinating. I can confirm that the environment variable IFORT_COMPILER24 points to a non-existent folder. That path did exist in the 2023.2.0 version. Evidently the directory structure got rearranged - AGAIN - but the environment variable did not keep up.

But when I look at the compiler settings in VS, I don't see IFORT_COMPILER24 used at all - instead it references $(IFortInstallDir) which is set correctly. As you are using a mixed-language application, you very likely added a reference to IFORT_COMPILER24 so that MSVC could locate the Fortran libraries. 

I'm not seeing that an update of VS did anything here (the IFORT_COMPILER24 value was the same before and after the VS update), but rather you did a relink of the application after the update.

You could change the value of IFORT_COMPILER24 at the system level, but a new install of Intel Fortran might overwrite it. I do wish that Intel would come up with a more robust scheme for other languages and build scripts to find the compiler and its libraries/includes. This has been a pain point for many years.

0 Kudos
Barbara_P_Intel
Employee
3,299 Views

@Mike-E2376, the fact that IFORT_COMPILER24 is undefined was reported recently by another developer. @Devorah_H_Intel filed a bug.

@Steve_Lionel, yes, the directory structure changed with the 2024.0 release. I did a copy/paste from the Fortran RNs to here.

 

Directory Layout Change

Directory layout is improved across all products to streamline installation and setup.

The Unified Directory Layout is implemented in 2024.0. If you have multiple toolkit versions installed, the Unified layout ensures that your development environment contains the correct component versions for each installed version of the toolkit. The directory layout used before 2024.0, the Component Directory Layout, is still supported on new and existing installations.

For detailed information about the Unified layout, including how to initialize the environment and advantages with the Unified layout, refer to Use the setvars and oneapi-vars Scripts with Linux and Use the setvars and oneapi-vars Scripts with Windows.

 

David_Billinghurst
New Contributor III
3,273 Views

The page Configuring Visual Studio for Mixed-Language Applications is related to this.  It hasn't been updated for directory layout changes for the 2024.0 release.  It was still useful as it gave me the clues I needed to update stuff.

Devorah_H_Intel
Moderator
2,679 Views

@David_Billinghurst wrote:

The page Configuring Visual Studio for Mixed-Language Applications is related to this.  It hasn't been updated for directory layout changes for the 2024.0 release.  It was still useful as it gave me the clues I needed to update stuff.


The article has been updated. Thank you for your report.

0 Kudos
Barbara_P_Intel
Employee
3,030 Views

WORKAROUND

Follow these steps to modify the IFORT_COMPILER24 variable at the system level to point to the correct folder:

  1. Right-click the Start button
  2. Select System
  3. Click Advanced system settings
  4. Click the Advanced tab
  5. Click Environment Variables
  6. Find the IFORT_COMPILER24 variable under System Variables
  7. Select the variable and click Edit
  8. The correct directory is C:\Program Files (x86)\Intel\oneAPI\compiler\2024.0
0 Kudos
Devorah_H_Intel
Moderator
2,680 Views

@Mike-E2376 wrote:

I work for a commercial engineering and science company.  Our company policies require our software to be routinely and automatically updated.  This morning, Visual Studio 2022 was updated to version 17.8.3.  After that, the Fortran and C++ Windows MDI application that I have been working on stopped compiling with different linking errors.  Initially, the error was "error LNK1104: cannot open file 'ifconsol.lib' ", which I found this KN article addressing.  However, the instructions in the article did not work.  I have the 2024 version of the Intel OneAPI and HPC installed.  But the macro from the article does not resolve to the correct location:

'$(IFORT_COMPILER24)\compiler\lib\ia32' gets resolved to the following location:

C:\Program Files (x86)\Intel\oneAPI\compiler\2024.0\windows\\compiler\lib\ia32

which does not exist on my computer.  The correct location appears to be:

C:\Program Files (x86)\Intel\oneAPI\compiler\2024.0\lib32.  I manually added this path and my application was able to compile again.  Is there a way to correct the MACRO $(IFORT_COMPILER24)?  I have other developers I am working with and we do not all necessarily have the Intel OneAPI installed in the same location, so I would prefer to use the MACRO rather than having to have each person adjust the project properties everytime someone else needs to compile the application.

The attached build log was before I found the correct path.

 


The macro issue is fixed in the upcoming 2024.1 HPC Toolkit release.  We appreciate your report. 

0 Kudos
NFKirkby
Novice
449 Views

Morning All,

Yesterday I updated VS to Version 17.11.3 (Windows 11) and the linking process stopped working with an error message saying Path not found, so I update oneAPI to 2024.2 and the error persists

Linking...
Link: error #10449: Expected linker not found, please check PATH settings.

 

I also have my own scripts that call xilink directly, I corrected those to point to the new 2024.2 version of xilink and that now tells me

NFKirkby_0-1726133361456.png

Here is an extract from my current path using oneapi_vars.bat which I guess is the new version of setvars.bat

(I inserted carriage returns)

PATH=C:\Program Files (x86)\Intel\oneAPI\tbb\latest\env\..\bin\\;
C:\Program Files (x86)\Intel\oneAPI\ocloc\latest\bin;
C:\Program Files (x86)\Intel\oneAPI\mpi\latest\env\\..\opt\mpi\libfabric\bin;
C:\Program Files (x86)\Intel\oneAPI\mpi\latest\env\\..\bin;
C:\Program Files (x86)\Intel\oneAPI\mkl\latest\bin;
C:\Program Files (x86)\Intel\oneAPI\itac\2022.0\bin;
C:\Program Files (x86)\Intel\oneAPI\itac\2022.0\dll;
C:\Program Files (x86)\Intel\oneAPI\ippcp\latest\bin;
C:\Program Files (x86)\Intel\oneAPI\ipp\latest\bin;
C:\Program Files (x86)\Intel\oneAPI\dpcpp-ct\latest\env\..\bin;
C:\Program Files (x86)\Intel\oneAPI\dnnl\latest\env\..\bin;
C:\Program Files (x86)\Intel\oneAPI\dev-utilities\latest\bin;
C:\Program Files (x86)\Intel\oneAPI\debugger\latest\env\\..\opt\debugger\bin;
C:\Program Files (x86)\Intel\oneAPI\dal\latest\bin;
C:\Program Files (x86)\Intel\oneAPI\compiler\latest\lib\ocloc;
C:\Program Files (x86)\Intel\oneAPI\compiler\latest\bin;
C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin\;
C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin\release\;
C:\Program Files (x86)\Intel\oneAPI\mpi\latest\libfabric\bin\;
C:\Program Files (x86)\Intel\oneAPI\mpi\latest\libfabric\bin\utils\;
C:\Program Files (x86)\Intel\oneAPI\tbb\latest\redist\intel64\vc_mt\;
C:\Program Files (x86)\Intel\oneAPI\tbb\latest\redist\ia32\vc_mt\;
C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\redist\intel64_win\compiler;
C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\redist\ia32_win\compiler;

I am curious about this because it does not mention the 2024.2 subdirectory

Messy, irritating and probably my fault, so apologies in advance.

Norman

 

 

0 Kudos
NFKirkby
Novice
445 Views

PS compilation i8s working and VS is compiling with the newly installed version of ifx

 

Compiling with Intel® Fortran Compiler 2024.2.1 [Intel(R) 64]...

 

Thanks

N

Steve_Lionel
Honored Contributor III
411 Views

"latest" is a softlink to the latest version. I'm not seeing an issue with my own combination of 17.11.3 and oneAPI 2024.2. You wouldn't happen to be building from a Cygwin or WSL environment perhaps?

0 Kudos
NFKirkby
Novice
393 Views

Hi Steve,

No Cygwin or WSL, just vanilla Windows 11, but you have made me wonder if, in the installation process, the "latest" softlink got corrupted, how might I check that? (BTW I was expecting something like %latest%, so I will also go away and read about softlinks)

Thanks 

N

0 Kudos
NFKirkby
Novice
352 Views

OK Folks

Have read about softlinks and my blood has run cold, what a fantastic way to turn a file system into a Gordian Knot.

But the xilink.exe links do seem to be pointing at the real application xilink.exe.  The problem seem to be that xilink does not know where to find the "real" (MS?) linker.  What am I looking for, where might it be lurking and what is the linker called? Does it have dependencies I have to know about?

Thanks for your help

Norman

0 Kudos
andrew_4619
Honored Contributor III
330 Views

C:\Program Files (x86)\Intel\oneAPI\compiler\latest\bin

on my sysstem aka

C:\Program Files (x86)\Intel\oneAPI\compiler\2024.2\bin

is where xilink.exe resides. 

The link.exe and config is at:

C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\Hostx64\x64

 

0 Kudos
NFKirkby
Novice
266 Views

Thanks, that helps.

On my most recent install of VS "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools" exists but the only sub-dir is Llvm and that does not contain link.exe. Using both "where" and explorer, I have found a copy of link.exe and there are some dependencies missing.

I suspect I should reinstall everything.

Thanks for your help

 

 

Steve_Lionel
Honored Contributor III
231 Views

Ah - I suggest you read and follow the instructions in Installing Microsoft Visual Studio* for Use with Intel® Compilers

Reply