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

Fortran compiler (ifort.exe) cannot be found visual studio 2019

Anjankumar
Novice
4,476 Views

Hi,

I installed Visual Studio 2019 (with the desktop C++ workload selected) and installed intel oneAPI HPC Toolkit (the newest version with Fortran compiler selected) to Visual Studio 2019. When I create a project and build a program it shows following error came out after I build the project.

Build started...
1>The Fortran compiler (ifort.exe) cannot be found.

 

As suggestions found in the community, I have also tried updating and reinstalling Visual Studio 2019. I checked that both intel64 and intel64_ia32 folder have ifort.exe present. I have also reset both architecture compilers in Tools > Options > Intel Compilers and Libraries > IFORT Intel Fortran Classic > Compilers, but unfortunately, to no avail. But in c++ programs executed successfully. In Fortran, above error was shown.

Please help me in this regard. Thank you very much.

 

Regards

Anjan Kumar

0 Kudos
1 Solution
mecej4
Honored Contributor III
4,382 Views

I suggest that you should first verify that you can build a simple console program with Intel Fortran before attempting projects that use MPI, etc.

See this page; about a third of the way down, you can see a screenshot of the Visual Studio options panel (titled "Microsoft Visual Studio 2019 Dialog"). Check that the "Libraries:" setting contains the path in which IFCONSOL.LIB is located on your PC.

View solution in original post

10 Replies
mecej4
Honored Contributor III
4,454 Views

Try the following approach.

From the Start Menu, open the Intel OneAPI 2021 Command Prompt (32-bit or 64-bit, your choice).  Type the command ifort.

If you get a couple of lines of output, showing the compiler version, proceed to the next step.

Type the command devenv, Create a test Fortran console project and try building. If you see error messages at any step, report those here.

0 Kudos
DavidWhite
Valued Contributor II
4,077 Views

I don't have all of the Intel OneAPI options, and it appears that the paths are not set up for Visual Studio.  How do I resolve this?

Screenshot 2021-09-20 135032.png

0 Kudos
Anjankumar
Novice
4,442 Views

Hello Sir,

if follow the same process that you mentioned above, Now it shown error as fatal error LNK1104: cannot open file 'ifconsol.lib'.  I added a impi.lib in linker. Can you share the environment settings and configuration setting a visual studio project. the settings work for c++ program., but Fortran its not working.

Please guide me in this  regard.

Anjan Kumar

0 Kudos
mecej4
Honored Contributor III
4,383 Views

I suggest that you should first verify that you can build a simple console program with Intel Fortran before attempting projects that use MPI, etc.

See this page; about a third of the way down, you can see a screenshot of the Visual Studio options panel (titled "Microsoft Visual Studio 2019 Dialog"). Check that the "Libraries:" setting contains the path in which IFCONSOL.LIB is located on your PC.

Steve_Lionel
Honored Contributor III
4,367 Views

Please show us, not tell us, what you are doing. For a Fortran project, put the buildlog.htm (from the Debug or Release folder, depending on the configuration you are building) into a Zip file and attach the Zip to a reply here. 

Anjankumar
Novice
4,338 Views

Sir,

I am using simple code (hello world). By using command prompt, intel Fortran compiler (ifort) and intel API (mpiifort) both are working. But in visual studio 2019 on windows platform, after selecting build solution it shows errors (like sometimes ifort.exe not found, ifconsol.lib not found, check include paths). After installing Fortran compiler 2021.2, ifconsol.lib was removed. 

I install both Fortran compilers (2021.2 and 2021.3) for tool selection along with oneAPI and HPC.  I found the problems in executables , directories and includes settings. In any modifications required in settings, please share for both intel compiler and one API separately.  For c++ its working. Problem only for Fortran.

 

Please help me in this regard.

Anjan Kumar

0 Kudos
Steve_Lionel
Honored Contributor III
4,329 Views

The error I see here is that the compiler cannot find mpif.h. The compiler was found. If you want to use the MPI files, you must add the path for them to "Additional Include Directories". 

I suggest that you start with a simple "Hello World" program to ensure that the compiler and linker are installed correctly.

Anjankumar
Novice
4,272 Views

Dear Sir, 

After reinstallation of all the software and adding path for them, Finally both Cpp and Fortran codes executed successfully in visual studio 2019. Thank you for supporting us and quick response.

 

regards

Anjan kumar

0 Kudos
Anjankumar
Novice
4,065 Views

Hello David,

 

Please check the disc space requirements for one API installation and reinstall.  If available, first install visual studio latest version, once visual studio successfully installation completed, then install one API. During installation of one API toolkit, by default it will ask visual studio with version number (if installed) integrate with one API. In my setting it was shown below?. 

 

intelone api.jpg

0 Kudos
Reply