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

Intel Fortran Library and Linker problems after Visual Studio Update

Mike-E2376
Beginner
2,479 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
1,816 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
7 Replies
jimdempseyatthecove
Honored Contributor III
2,461 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
2,454 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
2,436 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
2,410 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
1,816 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
2,167 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
1,817 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
Reply