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

transitioning from Parallel Studio XE to oneAPI, unable to compile FORTRAN

ghylander
New Contributor I
2,233 Views

As the title says, I'm transitioning from using Parallel Studio XE to using oneAPI. I'm interested in compiling Fortran code.

With Parallel Studio, I had no trouble, but with oneAPI, I can't even create the CMake files for compilation

Running the CMake command " cmake .. -" G "Visual Studio 15 2017 Win64" ", I get the following error:

 

'''

Check for working Fortran compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/2021.4.0/windows/bin/intel64/ifort.exe
-- Check for working Fortran compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/2021.4.0/windows/bin/intel64/ifort.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/CMakeTestFortranCompiler.cmake:51 (message):
The Fortran compiler

"C:/Program Files (x86)/Intel/oneAPI/compiler/2021.4.0/windows/bin/intel64/ifort.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: <PATH TO PROJECT>/build/CMakeFiles/CMakeTmp

Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/devenv.com CMAKE_TRY_COMPILE.sln /build Debug /project cmTC_99a30 &&
Microsoft Visual Studio 2017, version 15.0.28307.1745.
Copyright (C) Microsoft Corp. All rights reserved.

Error loading package  'IFLangServicePackage'.

Error loading package 'IFLangServicePackage'.

Error loading package 'IFLangServicePackage'.

Error loading package 'IFLangServicePackage'.

Error loading package 'IFLangServicePackage'.

Project not valid

'''

 

Even if I try to compile already existing VS solutions or projects, they will not compile. Instead, i get the following message: "This project was not selected for compilation on the selected platform". This project on the exact same release/platform/environment/machine/configuration/etc used to compile with no issue with Parallel Studio XE ifort

 

I tried to uninstall Parallel Studio, oneAPI base and HPC toolkit and VS, the reinstall VS, oneAPI base and HPC toolkit (in that order)

I am still getting the same errors. I've tried this with VS 2017 and 2019 (the only 2 supported by oneAPI as reported in the step 3 of the installer)

When I navigate to the "Intel Compilers and Libraries" I do not have a "Visual Fortran" submenu, only "IFX Intel Fortran" and "IFORT Intel Fortran Classic"

 

---

 

After further testing, i found that if I create a new empty project in VS, then add the source files, then add my compiler options to the project, the target builds successfully. This is a somewhat annoying process, using cmake I can reduce this to a much more direct and faster process

Labels (2)
0 Kudos
1 Solution
Khalik_K_Intel
Moderator
1,714 Views

Hello,


New Fortran compiler ifort 2021.5.0 was released and is part of Intel oneAPI HPC Toolkit 2022.1.

This can be downloaded here: https://www.intel.com/content/www/us/en/developer/tools/oneapi/hpc-toolkit-download.html

 

I have checked your project with the released compiler and the project builds successfully on our side.


Regards,

Khalik.


View solution in original post

11 Replies
ghylander
New Contributor I
2,230 Views

Even if I try to compile already existing VS solutions or projects, they will not compile

 

These solutions and projects were generated using cmake with the parallel studio ifort compiler. I had no trouble neither generating the .sln and project files from source using cmake, nor compiling the solutions. The files were generated with the Visual Studio 15 2017 generator, specifying Win64 as the target arch

0 Kudos
JohnNichols
Valued Contributor III
2,132 Views

As it is Thanksgiving one has to assume that even our intrepid astronauts are watching the Macy's Day Parade. 

I suggest you start with 

https://docs.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=msvc-170 

 

Visual Fortran is an old name, the modern real compiler is the IFORT. The IFX is a new 64 bit compiler for test purposes.  

I do not use cmake, I have always abhorred all of the make programs, just a personal thing.  

It is a trivial task to install VS 2019, do not use the 2022 it is not supported yet and it has a number of interesting changes, I am sure we will hear a lot about it on this forum. 

0 Kudos
ghylander
New Contributor I
2,100 Views

HI,

Thanks for your reply. I have both VS 2017 and 2019 installed, both setup to develop fortran and c++ with cmake etc

As I said in the OP, I used to work with parallel studio xe ifort with no trouble. The problem I'm having seems to be related to a bug with the latest version of ifort, 2021.4 and version 2021.3, as there are reports of this issue not happening in 2021.2, only after updating (https://gitlab.kitware.com/cmake/cmake/-/issues/22773)

 

Visual Fortran is an old name, the modern real compiler is the IFORT. The IFX is a new 64 bit compiler for test purposes.  

I suspected as much, when googling my problem and I found some results making references to Visual Fortran.

0 Kudos
JohnNichols
Valued Contributor III
2,034 Views

Visual Fortran is from the days of the last owner of the Fortran Compiler, from before Intel bought the code and then continued to develop it.  Visual Fortran is a catchy name, where as IFORT is a non- catchy name.  Mostly I see IF when you see references to it on 3rd party sites that offer libraries, such as DISLIN as one simple example. 

It often happens that updates break some Fortran code, I find from experience since the mid 80's it is due to improved error finding.  

What you experienced is not unusual, the best place to ask questions is here or the Fortran Language discussion groups that are often mentioned by FortranFan.  Observation is that you will get your fastest reply here, but that is just my observation.  

I know Intel has people who monitor this site most of the time, if the problem is one that affects the compiler working to the standard then they will escalate the problem quickly, but you may have to wait for a solution with the next rounds of compiler release.  Other problems are solved by the resident gurus, who are definitely and formally not water cooler people so keep it brief and to the point and they are happy. 

I have a small problem that the oneAPI is not playing nicely with Windows 11 as another simple example, there are two solutions, remove Windows 11 or use an earlier version of the Parallel Studio that does play nice with Windows 11.  A simple binary choice, if one leaves out the LINUX option, and I am not that desperate.  It is simplest to use the last PS as Windows 11 is worth the short term pain, but at least one of the gurus will disagree, which is then merely an equivalent extension of the famous Plato discussion on rhetoric and Socrates, if the reference is obscure then you could listen to BBC Radio 4 as you code as I do.  

I have a long aversion to the makes, they never make sense with the arcane language, in the late 80's it was much simpler to use VEDIT, which provided a simple IDE for MS Fortran.  So I just never used them. 

Anyway good luck.  

 

Khalik_K_Intel
Moderator
1,985 Views

Hello,


Thank you for contacting Intel Support.

For now, this looks like the same issue as you have referred to earlier (https://gitlab.kitware.com/cmake/cmake/-/issues/22773), which is already known to Intel development team. That issue is in ifort 2021.4 + CMake, so maybe that is why when you "create a new empty project in VS, then add the source files, then add compiler options to the project, the target builds successfully."


Now, we just need to ensure this is the same issue.

Could you please pass the whole output you are getting, so I can check it?

Could you also then try to interrupt CMake process in the middle of execution and check the project name in one of generated files as the user has done here https://community.intel.com/t5/Intel-Fortran-Compiler/CMake-fails-at-the-Fortran-compiler-ABI-info-detection-with/m-p/1319088 ?


Thank you for your cooperation.


Regards,

Khalik.


0 Kudos
ghylander
New Contributor I
1,968 Views

Here's the output of running 'cmake .. -G "Visual Studio 16 2019" -A x64':

'''

-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044.
-- The Fortran compiler identification is Intel 20.2.4.20210910
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - failed
-- Check for working Fortran compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/2021.4.0/windows/bin/intel64/ifort.exe
-- Check for working Fortran compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/2021.4.0/windows/bin/intel64/ifort.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/CMakeTestFortranCompiler.cmake:51 (message):
The Fortran compiler

"C:/Program Files (x86)/Intel/oneAPI/compiler/2021.4.0/windows/bin/intel64/ifort.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: <PATH-TO-PROJECT>/build/CMakeFiles/CMakeTmp

Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/devenv.com CMAKE_TRY_COMPILE.sln /build Debug /project cmTC_cf976 &&
Microsoft Visual Studio version 2019 16.11.7.

Copyright (C) Microsoft Corp. All rights reserved.

Error loading package  'IFLangServicePackage'.

Error loading package 'IFLangServicePackage'.

Can't complete operation. Parameter not valid.

'''

Then there's an explanation on how to use the 'devenv' command, with arguments and syntax. Finally:

'''

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)


-- Configuring incomplete, errors occurred!
See also "<PATH-TO-PROJECT>/build/CMakeFiles/CMakeOutput.log".
See also "<PATH-TO-PROJECT>/build/CMakeFiles/CMakeError.log".

'''

Regarding the "interrupting cmake process", these are the files created by CMake:

CMAKE_TRY_COMPILE.sln

cmTC_505c7.vfproj

 

0 Kudos
Khalik_K_Intel
Moderator
1,951 Views

Hello,


Thank you for the quick feedback. Is it possible for us to get the sources of you project, so we can check it on our end?

If it is not possible, then at least could you try to do the following on your end and tell us the result?


cd "<PATH-TO-PROJECT>/build/CMakeFiles/CMakeTmp"

"devenv CMAKE_TRY_COMPILE.sln /build Debug /project cmTC_505c7.vfproj"


Regards,

Khalik.


0 Kudos
ghylander
New Contributor I
1,946 Views

Hi Khalik,

The source I'm trying to compile is the following:

ROSCO/ROSCO at main · NREL/ROSCO (github.com)

 

I ran the command you posted in the Developer Command Prompt for VS2019, as i do not have devenv in my PATH:

'''

1>Compiling with Intel® Fortran Compiler Classic 2021.4.0 [Intel(R) 64]...
1>CMakeFortranCompilerABI.F
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Linking...
1>Microsoft (R) Incremental Linker Version 14.29.30137.0
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>/OUT:<PATH-TO-PROJECT>\build\CMakeFiles\CMakeTmp\Debug\cmTC_505c7.exe
1>/VERSION:0.0
1>/MANIFEST
1>/MANIFESTFILE:cmTC_505c7.dir\Debug\cmTC_505c7.exe.intermediate.manifest
1>"/MANIFESTUAC:level='asInvoker' uiAccess='false'"
1>/DEBUG
1>/PDB:<PATH-TO-PROJECT>\build\CMakeFiles\CMakeTmp\Debug/cmTC_505c7.pdb
1>/SUBSYSTEM:CONSOLE
1>/IMPLIB:<PATH-TO-PROJECT>\build\CMakeFiles\CMakeTmp\Debug\cmTC_505c7.lib
1>/machine:x64
1>/debug
1>/INCREMENTAL
1>cmTC_505c7.dir\Debug\CMakeFortranCompilerABI.obj
1>cmTC_505c7.dir\Debug\cmTC_505c7.exe.embed.manifest.res
1>Embedding manifest...
1>Microsoft (R) Manifest Tool
1>Copyright (c) Microsoft Corporation.
1>All rights reserved.
1>
1>Build log written to "file://<PATH-TO-PROJECT>\build\CMakeFiles\CMakeTmp\cmTC_505c7.dir\Debug\BuildLog.htm"
1>cmTC_505c7 - 0 error(s), 0 warning(s)
========== Compliling: 1 correct, 0 incorrect, 0 updated, 0 skipped==========

'''

 

0 Kudos
Khalik_K_Intel
Moderator
1,922 Views

Thanks for the sources provided.


I have now checked it on my end and it looks like the same issue as the one we talked about.

This problem has already been reported to Intel development team and the fix should be available in the next major oneAPI release.


Regards,

Khalik.


Khalik_K_Intel
Moderator
1,715 Views

Hello,


New Fortran compiler ifort 2021.5.0 was released and is part of Intel oneAPI HPC Toolkit 2022.1.

This can be downloaded here: https://www.intel.com/content/www/us/en/developer/tools/oneapi/hpc-toolkit-download.html

 

I have checked your project with the released compiler and the project builds successfully on our side.


Regards,

Khalik.


Khalik_K_Intel
Moderator
1,583 Views

This issue has been resolved and we will no longer respond to this thread. If you require additional assistance from Intel, please start a new thread.

Any further interaction in this thread will be considered community only.


0 Kudos
Reply