Community
cancel
Showing results for 
Search instead for 
Did you mean: 
siyuliben
Beginner
2,497 Views

The Fortran compiler (ifort.exe) cannot be found.

Jump to solution

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.

Then I created a new project that prints 'Hello World'.

But the following error came out after I build the project.

Build started...
1>------ Build started: Project: Console1, Configuration: Debug x64 ------
1>The Fortran compiler (ifort.exe) cannot be found.
1>
1>Build log written to "file://H:\Console1\x64\Debug\BuildLog.htm"
1>Console1 - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Can anyone help me with this problem? Thank you very much.

0 Kudos
1 Solution
Alina_S_Intel
Employee
2,341 Views

Yes,oneAPI HPC Toolkit requires oneAPI Base Toolkit: https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-hpc-toolkit-system-requir...


Upgrades sometimes lead to integration issues. So, I would recommend uninstalling the previous version and after that install a new one.


If your issue is resolved, please mark the post containing the solution to help others. 


View solution in original post

19 Replies
Alina_S_Intel
Employee
2,466 Views

Have you installed Base ToolKit before installing HPC Toolkit?

How did you create a project? New - Project - Fortran - Main program code or Empty project?


siyuliben
Beginner
2,447 Views

I didn't install Base Toolkit. Do I need to install Base ToolKit before HPC Toolkit?

 

I clicked 'File-New-Project-Fortran-Main program code'.

I also did the 'Empty project' for my own scripts too.

Steve_Lionel
Black Belt Retired Employee
2,443 Views

In Visual Studio (the full interface, not the start page), click Help > About, then Copy Info. Paste the result into a reply here.

You can also try an uninstall and reinstall of the oneAPI Toolkits. Installing the Base or not would not have an effect on the ability to find ifort.exe.

 
siyuliben
Beginner
2,434 Views

Microsoft Visual Studio Community 2019
Version 16.8.4
VisualStudio.16.Release/16.8.4+30907.101
Microsoft .NET Framework
Version 4.8.04084

Installed Version: Community

Visual C++ 2019 00435-60000-00000-AA934
Microsoft Visual C++ 2019

ASP.NET and Web Tools 2019 16.8.557.25636
ASP.NET and Web Tools 2019

C# Tools 3.8.0-5.20604.10+9ed4b774d20940880de8df1ca8b07508aa01c8cd
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Intel Libraries for oneAPI Package ID: w_oneAPI_2021.1.1.99
Intel Libraries for oneAPI – toolkit version: 2021.1.1, extension version 21.1.0.16, Package ID: w_oneAPI_2021.1.1.99, Copyright © 2019-2020 Intel Corporation. All rights reserved.
* Other names and brands may be claimed as the property of others.

Intel® C++ Compiler Package ID: w_oneAPI_2021.1.1.99
Intel® C++ Compiler – toolkit version: 2021.1.1, extension version 21.0.16, Package ID: w_oneAPI_2021.1.1.99, Copyright © 2002-2020 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_2021.1.1.99
Intel® C++ Compiler Classic – toolkit version: 2021.1.1, extension version 19.2.5.16, Package ID: w_oneAPI_2021.1.1.99, Copyright © 2002-2020 Intel Corporation. All rights reserved.
* Other names and brands may be claimed as the property of others.

Intel® Fortran Compiler Package ID: w_oneAPI_2021.1.1.99
Intel® Fortran Compiler – toolkit version: 2021.1.1, extension version 19.2.0061.16, Package ID: w_oneAPI_2021.1.1.99, Copyright © 2002-2020 Intel Corporation. All rights reserved.
* Other names and brands may be claimed as the property of others.

Intel® Inspector 2021.1 604894
Intel® Inspector 2021.1, (build 604894), Copyright © 2009-2020 Intel Corporation. All rights reserved.

Intel® oneAPI DPC++ Compiler Package ID: w_oneAPI_2021.1.1.99
Intel® oneAPI DPC++ Compiler – toolkit version: 2021.1.1, extension version 21.1.0.16, Package ID: w_oneAPI_2021.1.1.99, Copyright © 2019-2020 Intel Corporation. All rights reserved.
* Other names and brands may be claimed as the property of others.

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

IntelliCode Extension 1.0
IntelliCode Visual Studio Extension Detailed Info

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

Microsoft Visual C++ Wizards 1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio VC Package 1.0
Microsoft Visual Studio VC Package

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

ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

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.

Visual Basic Tools 3.8.0-5.20604.10+9ed4b774d20940880de8df1ca8b07508aa01c8cd
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 Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for CMake 1.0
Visual Studio Tools for CMake

siyuliben
Beginner
2,421 Views

Hi Steve,

I did reinstall the oneAPI Toolkits several times (also VS 2019 too). 

The problem still exists. 

Steve_Lionel
Black Belt Retired Employee
2,410 Views

Ok - that all looks reasonable. The first thing I note is that you're one update back from current, which is 2021.1.2. I'd suggest downloading and installing the latest update - though when I try to do so, the web site puts me into a loop of "registering" for Intel Developer Zone, even though I am already registered. (It didn't do this previously.)

If that doesn't help (or you can't complete the step), look in C:\Program Files (x86)\Intel\oneAPI\compiler\2021.1.1\windows\bin\intel64_ia32 (or 2021.1.2 if you installed the update) and see if ifort.exe is there. There is also an "intel64" last folder for targeting x64.) If it is, next step.

In VS2019, select Tools > Options > Intel Compilers and Libraries > IFORT Intel Fortran Classic > Compilers. With the Win32 tab highlighted, click Reset... Now click on the x64 tab and click Reset... there.

See if this helps.

 
siyuliben
Beginner
2,405 Views

Hi Steve,

Both interl64 and interl64_ia32 folder have ifort.exe. And I reset both Compilers in the Tools, but it is still not working. Please let me know if anything else can help with this problem. 

Thank you very much.

Best Regards

Siyu

Steve_Lionel
Black Belt Retired Employee
2,399 Views

Let's try some diagnostics.

From the Windows Start menu, select Intel oneAPI 2021 > Intel oneAPI command prompt for IA32 for Visual Studio. When the window opens, type: 

ifort

Copy the entire window contents and paste into a reply here.

 
siyuliben
Beginner
2,393 Views

I cannot find Intel oneAPI 2021 in the Start menu. Is the command prompt ok?

 

command prompt gave me

 'ifort' is not recognized as an internal or external command,
operable program or batch file.

siyuliben
Beginner
2,382 Views

Hi Steve,

After I reinstalled HPC again. I found the command prompt.

Please read the entire window:

:: initializing oneAPI environment...
initializing Visual Studio command-line environment...
Visual Studio version 16.8.4 environment configured.
Visual Studio environment initialized for: 'x86'
: compiler -- latest
: dev-utilities -- latest
: inspector -- latest
: itac -- latest
: mpi -- latest
: tbb -- latest
:: oneAPI environment initialized ::

C:\Program Files (x86)\Intel\oneAPI>ifort

Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on IA-32, Version 2021.1 Build 20201112_000000
Copyright (C) 1985-2020 Intel Corporation. All rights reserved.

ifort: command line error: no files specified; for help type "ifort /help"

Steve_Lionel
Black Belt Retired Employee
2,362 Views

That's as it should be from the command line. Now what does VS do?

siyuliben
Beginner
2,347 Views

Hi Steve,

 

VS works fine now. At least for the Main program code. I am not sure why.

Thank you very much for your help.

DavidWhite
Black Belt
597 Views

Hi Steve,

 

If I don't have the Intel oneAPI command prompt option under Intel oneAPI 2021, does this mean that the install did not complete properly?  I can see the compilers in VS, but I have the ifort not found error.

 

Thanks

 

David

Alina_S_Intel
Employee
2,342 Views

Yes,oneAPI HPC Toolkit requires oneAPI Base Toolkit: https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-hpc-toolkit-system-requir...


Upgrades sometimes lead to integration issues. So, I would recommend uninstalling the previous version and after that install a new one.


If your issue is resolved, please mark the post containing the solution to help others. 


View solution in original post

bontoft__elliot
Beginner
1,872 Views

Dear all,

I am facing the same problem. I have installed oneAPI base kit and HPC kit after my Parallel Studio XE licence expired. I removed the Parallel Studio XE compiler from my system as it was taking up space. Since I have been receiving the same error as above: 'the Fortran compiler (ifort.exe) cannot be found'. I have tried 'repairing' the base kit and HPC kit from the oneAPI GUI. I have also tried updating and reinstalling Visual Studio 2019. As suggested above, 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. 

Below is the Intel oneAPI command prompt for IA32 for Visual Studio 2019 output when started and after inputting the 'ifort' command:

:: initializing oneAPI environment...
initializing Visual Studio command-line environment...
Visual Studio version 16.9.4 environment configured.
Visual Studio environment initialized for: 'x86'
: advisor -- latest
Error: Product installation not found.
Please launch script within product installation directory
: compiler -- latest
: dal -- latest
: debugger -- latest
: dev-utilities -- latest
: dnnl -- latest
: dpcpp-ct -- latest
: dpl -- latest
: inspector -- latest
: intelpython -- latest
: ipp -- latest
: ippcp -- latest
: itac -- latest
: mkl -- latest
: mpi -- latest
: tbb -- latest
: vpl -- latest
: vtune -- latest
Error: Product installation not found.
Please launch script within product installation directory
:: oneAPI environment initialized ::

C:\Program Files (x86)\Intel\oneAPI>ifort
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on IA-32, Version 2021.2.0 Build 20210228_000000
Copyright (C) 1985-2021 Intel Corporation. All rights reserved.

ifort: command line error: no files specified; for help type "ifort /help"

Thanks in advance for any advice that can be offered.

Steve_Lionel
Black Belt Retired Employee
1,855 Views

@bontoft__elliot , no, this is not the same problem as this thread. Your Fortran compiler is working fine. setvars.bat is complaining about some other component whose name, alphabetically, follows vtune. I can't think offhand of what it might be, but if you look at the list of subfolders in C:\Program Files (x86)\Intel\oneAPI, the one after vtune will be the culprit. If you don't care about that component, ignore the message.

bontoft__elliot
Beginner
1,837 Views

Hi Steve, thanks for your response. I assumed it was the same issue as we were getting the same error response when trying to build ('the Fortran compiler (ifort.exe) cannot be found.'). I uninstalled the oneAPI base and HPC kit, and reinstalled them, and this has resolved the issue. Best, Elliot

Steve_Lionel
Black Belt Retired Employee
1,817 Views

But that's not the error you showed. If it was that the compiler could not be found, you would not have seen the version banner. The error you DID get was "no files specified" because you just typed "ifort" without a source file name.

Glad to hear a reinstall helped.

Steve_Lionel
Black Belt Retired Employee
564 Views

David, be sure you have done what is asked in Installing Microsoft Visual Studio* 2019 for Use with Intel® Compilers

Are you sure you are seeing the 2021 compiler in VS? You'll certainly get "ifort not found" if you try to use it from a generic command prompt.

Reply