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

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

_dk_
Novice
1,545 Views

I have installed Visual studio 2022, then Intel oneAPI base toolkit, oneAPI HPC, intel fortran compiler, intel ifort runtime.

When i try to run ifort, i get this error. Previously I had parallel studio 2015 (i guess) and visual studio 2013. I uninstalled everything. I probably deleted intel64 environment variable and don't know how to fix it (or if that causes a problem at all). This was because I was getting error with dll and going through forums, they mentioned on editing variable but I deleted few intel shared library related environment variable (i dont remember all of them, one of them was intel64). Now I have reinstalled everything for atleast 3 times. When i launc intel OneAPI 64 bit environment, I get the following window:

 

:: initializing oneAPI environment...
Initializing Visual Studio command-line environment...
Visual Studio version 17.10.1 environment configured.
"C:\Program Files\Microsoft Visual Studio\2022\Community\"
Visual Studio command-line environment initialized for: 'x64'
: advisor -- latest

C:\Program Files (x86)\Intel\oneAPI\advisor\latest\env>

 



But, in other forums, the directory is

 

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

 

Something is causing it to go to this particular directory everytime and I could not resolve it. And I dont see other libraries like:

 

:  compiler -- latest
:  debugger -- latest
:  dpl -- latest
:  mpi -- latest
:  tbb -- latest

 

probably, due to it going to \env directory (i guess).

 

I do need to run fortran compiler to create executables for my research work. I am not very familiar with compiler related stuff and I was using parallel studio earlier. Now transitioning to oneAPI is giving me a lot of trouble. I would be very grateful if someone could help me resolve this issue.

Labels (2)
0 Kudos
10 Replies
Mark_Lewy
Valued Contributor I
1,471 Views

There should be an "Intel oneAPI command prompt for Intel 64 for Visual Studio 2022" entry in your start menu, if you are only getting advisor when you are using it then something is up.

This is something like what you should see:

:: initializing oneAPI environment...
Initializing Visual Studio command-line environment...
Visual Studio version 17.9.2 environment configured.
"C:\Program Files\Microsoft Visual Studio\2022\Professional\"
Visual Studio command-line environment initialized for: 'x64'
: compiler -- latest
: dal -- latest
: debugger -- latest
: dev-utilities -- latest
: dpcpp-ct -- latest
: dpl -- latest
: inspector -- latest
: ipp -- latest
: ippcp -- latest
: itac -- latest
: mkl -- latest
: mpi -- latest
: ocloc -- latest
: tbb -- latest
:: oneAPI environment initialized ::

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

 

I note that you have VS 17.10.1 installed; I believe 17.9.2 is the version that was validated with oneAPI 2024.1.  It is not unknown for there to be issues when using versions later than the validated version.

If you do have the compiler correctly installed you should get something like:

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

ifort: remark #10448: Intel(R) Fortran Compiler Classic (ifort) is now deprecated and will be discontinued late 2024. Intel recommends that customers transition now to using the LLVM-based Intel(R) Fortran Compiler (ifx) for continued Windows* and Linux* support, new language support, new language features, and optimizations. Use '/Qdiag-disable:10448' to disable this message.
ifort: command line error: no files specified; for help type "ifort /help"

 

 

 

 

ChrisC2
Novice
1,420 Views
I have also started launching Visual Studio from the oneAPI command prompt ('start devenv'), as that seems more robust for setting omeAPI env variables vs whatever script VS runs to set them.
0 Kudos
_dk_
Novice
1,400 Views

When I use start 'devenv' in cmd, it opens visual studio 2022. How does it open visual studio now, but oneAPI is not able to detect visual studio 2022. I have reinstalled everything 4 times already.

0 Kudos
_dk_
Novice
1,401 Views

Thanks for you reply. I do not have visual studio 2017. The PC I'm using currently used to have visual studio 2013. But I have uninstalled it completely. I do have microsoft visual c++ 2015-2022 redistributable. I only have visual studio community 2022 installed. For some random reasons, oneAPI is not able to find visual studio 2022 in my computer. I am launching through Intel OneAPI comand prompt for intel 64 for Visual Studio 2022.  I have even tried running setvars.bat in oneAPI folder.

I firstly installed visual studio 2022 completely along with C++ development environment. After that I have installed oneAPI base toolkit which displayed "integrate with visual studio 2022". Then I did the same with oneAPI HPC, which also showed integrate message. Then I installed intel fortran compiler followed by fortran runtime. But even when i do so, it always shows visual studio 17.10.1 and always goes to \advisor\latest\env directory. Because in Intel\oneAPI\> dirtectory, everything mentioned (dal,debugger,dpl,tbb,mpi etc.,) are present. I really believe it has something to do with environment variables. I am doing this as a part of my research work where I have to use fortran compiler so I am not very familiar. It would be of great help if someone could get a solution.

0 Kudos
Mark_Lewy
Valued Contributor I
1,366 Views

If you haven't worked it out already, 17.10.1 is the version of Visual Studio 2022 that you have installed, so that looks OK.  My initial concern was that this is too recent to use with oneAPI 2024.1, but @Steve_Lionel shows that it appears to integrate in the topic I linked to below.  I'm still unclear why your install hasn't succeeded; you shouldn't need to install the Fortran runtime libraries, but I would be surprised if they interfere with an existing installed compiler.

If you can run VS 2022, try looking at Help->About Microsoft Visual Studio:

Mark_Lewy_0-1717511947540.png

 

Can you see the Fortran compiler in your list of installed products?  If not, I'd follow Steve's instructions and re-install.  Otherwise, you should be able to create and build Fortran projects with the Visual Studio IDE.

 

0 Kudos
_dk_
Novice
1,336 Views

These are the stuff that are installed along with visual studio 2022. I do have everything that you have shown in your screenshot.

Microsoft Visual Studio Community 2022
Version 17.10.1
VisualStudio.17.Release/17.10.1+34928.147
Microsoft .NET Framework
Version 4.8.09037

Installed Version: Community

Visual C++ 2022   00482-90000-00000-AA713
Microsoft Visual C++ 2022

ASP.NET and Web Tools   17.10.338.1105
ASP.NET and Web Tools

Azure App Service Tools v3.0.0   17.10.338.1105
Azure App Service Tools v3.0.0

C# Tools   4.10.0-3.24270.2+e8f775c1d8a73dee7ad02408712d714251e708ea
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Cookiecutter   17.0.24064.1
Provides tools for finding, instantiating and customizing templates in cookiecutter format.

GitHub Copilot   0.2.889.30432
GitHub Copilot is an AI pair programmer that helps you write code faster and with less work.

Intel® Advisor 2024   1.3.25
Intel® Advisor 2024, (Plugin Version 1.3.25),  Copyright © 2009-2023 Intel Corporation. All rights reserved.

Intel® C++ Compiler   2024.1
Intel® C++ Compiler 2024.1, Copyright © 2002-2024 Intel Corporation. All rights reserved.

Intel® DPC++ Compatibility Tool   2024.1
Intel® DPC++ Compatibility Tool 2024.1, Copyright © 2019-2024 Intel Corporation. All rights reserved.

Intel® Fortran Compiler   2024.1
Intel® Fortran Compiler 2024.1, Copyright © 2002-2024 Intel Corporation. All rights reserved.

Intel® Libraries for oneAPI   2024.1
Intel® Libraries for oneAPI 2024.1, Copyright © 2019-2024 Intel Corporation. All rights reserved.

Intel® oneAPI DPC++ Compiler   2024.1
Intel® oneAPI DPC++ Compiler 2024.1, Copyright © 2019-2024 Intel Corporation. All rights reserved.

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

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

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

Python - Profiling support   17.0.24064.1
Profiling support for Python projects.

Python with Pylance   17.0.24064.1
Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.

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.

TypeScript Tools   17.0.30327.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   4.10.0-3.24270.2+e8f775c1d8a73dee7ad02408712d714251e708ea
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 IntelliCode   2.2
AI-assisted development for Visual Studio.

And I have clean installed visual studio 2022, intel oneapi base toolkit, hpc, fortran compiler for the 5th time. It still did not solve any of my issue. I did follow the steps given by @Steve_Lionel and deleting the folder did not help in anyway. By the time had uninstalled visual studio, that folder was empty anyways. But I still did delete it and it did not seem to help. I don't know why but I really do think that this is related to environment variables as I followed some random forum and deleted two or three of them. My issue still persists. Please let me know why command window goes to

C:\Program Files (x86)\Intel\oneAPI\advisor\latest\env>

 if somebody can find out. I think that it is occuring due to some issue as I tried installing in my personal laptop and this issue did not happen. It straight up went to

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

like every other user out there.

0 Kudos
Mark_Lewy
Valued Contributor I
1,468 Views

Also see this topic: Intel HPC Toolkit integration with VS 2022 version 17.10.1 - Intel Community

It looks like oneAPI 2024.1 will work with VS 17.10.1

_dk_
Novice
1,336 Views

I tried all the steps suggested in that conversation, it did not solve my issue.

0 Kudos
Mark_Lewy
Valued Contributor I
1,324 Views

What happens if you:

1) Open a command prompt

2) cd "\Program Files (x86)\Intel\oneAPI"

3) C:\Windows\System32\cmd.exe /E:ON /K ""C:\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64 vs2022"

(This should be doing the same as the  "Intel oneAPI command prompt for Intel 64 for Visual Studio 2022"  shortcut)

4) ifort

_dk_
Novice
1,115 Views
Microsoft Windows [Version 10.0.19045.4412]
(c) Microsoft Corporation. All rights reserved.

C:\Users\dk>cd "\Program Files (x86)\Intel\oneAPI"

C:\Program Files (x86)\Intel\oneAPI>C:\Windows\System32\cmd.exe /E:ON /K ""C:\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64 vs2022"
:: initializing oneAPI environment...
   Initializing Visual Studio command-line environment...
   Visual Studio version 17.10.1 environment configured.
   "C:\Program Files\Microsoft Visual Studio\2022\Community\"
   Visual Studio command-line environment initialized for: 'x64'
:  advisor -- latest

C:\Program Files (x86)\Intel\oneAPI\advisor\latest\env>ifort
'ifort' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files (x86)\Intel\oneAPI\advisor\latest\env>

Thanks for you suggestion but as it is same as running cmd prompt for Intel 64,  it did not give me any different result. Same issue remains.

0 Kudos
Reply