- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
When I type "ifort" in the Windows command line I get the following error:
C:\Users\aledi>ifort
'ifort' is not recognized as an internal or external command,
operable program or batch file.
However, if I first change directory to the folder wher ifort.exe is located in my PC,
C:\Users\aledi>cd C:\Program Files (x86)\Intel\oneAPI\compiler\2022.2.1\windows\bin\intel64
and *then* I type ifort, everything is fine (of course I get an error because I did not specify a file, but at least the PC recognizes the ifort command)
My question: how can I do this once and for all, i.e. how do I add the command ifort to my windows path?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to open a command window configured for ifort. There are two shortcuts on the oneapi start menu one for 32bit environment and one for 64bit. There is much more environment needed than just the path for the ifort command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your reply. I know that the is a shortcut "Intel oneapi command promt" etc. but I would like ifort (and its related libraries) to be callable by the Windows command line. The reason is that I am using VSCode (not the Visual studio IDE that comes with Intel OneApi) and VSCode cannot find ifort because ifort is not on the path or smth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The "Intel oneapi command prompt" is the same command prompt as the Windows command prompt, with the addition of setting up the additional environment variables needed for ifort (32-bit or 64-bit) and ifx (64-bit).
So you can either:
a) select the appropriate oneAPI command prompt
.or.
b) Open CMD, then run the appropriate setvars batch file from the oneAPI folder.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
then you would need to look at the C:\Program Files (x86)\Intel\oneAPI\compiler\2023.2.0\env\vars.bat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
RE: VSCode
You can create a batch file that runs the appropriate environment variables setup, then runs the VSCode execuitable.
And then place a shortcut to this batch file on your desktop or task bar. Something like the following untested batch file
: VSCodeLaunch.bat
call $(ONEAPI_ROOT)\compiler\latest\env\vars.bat intel64
Start VSCode
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page