Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26758 Discussions

ifort not recognized as an internal or external command

Valencia__Miguel
Beginner
2,339 Views

Good afternoon 

I have Parallel Studio XE 2019 Cluster Edition, and now I am trying to run a *.bat file in my computer, I am a beginner the use of this kind of files. My computer has two units a SSD (C:) and  a HDD (D:). Parallel Studio was installed in the D: unit, and when I want to run ifort form the batch file I get the message "ifort is not recognized as an internal or external command". I find the ifort.exe file in "Program Files" folder. I do not know what could be bad. 

Thanks

Miguel

0 Kudos
1 Solution
Steve_Lionel
Black Belt Retired Employee
2,338 Views

You need to add this in your .bat file:

call "%IFORT_COMPILER19%bin\ipsxe-comp-vars.bat" intel64 vs2017

This establishes the proper command line environment for the ifort command.

Replace "intel64" with "ia32" if you want 32-bit, and/or "vs2017" by the VS version you have.

View solution in original post

11 Replies
Steve_Lionel
Black Belt Retired Employee
2,339 Views

You need to add this in your .bat file:

call "%IFORT_COMPILER19%bin\ipsxe-comp-vars.bat" intel64 vs2017

This establishes the proper command line environment for the ifort command.

Replace "intel64" with "ia32" if you want 32-bit, and/or "vs2017" by the VS version you have.

View solution in original post

Francesco
Beginner
2,040 Views

even though more than a year has passed, I wanted to kindly ask two things about the same problem:
1) how can you do the same thing from the Powershell of Windows?
2) How can you do the same thing from Visual Studio? (I need to install a local python package from the "python environment" of VS2017, but this package needs ifort. The instruction to install a local python packages is to copy and paste the path of the (local) package into the python Environmet for installing packages. But it does find ifort. (I get an error " Could not locate executable ifort")

many thanks and best regards

 

Steve_Lionel
Black Belt Retired Employee
2,027 Views

The answer to your Powershell question is harder than I anticipated. I am looking into this. I can get the script to run, but the environment variables don't stick. It is a brave new world....

As for VS, I don't understand your question. What is the "Python environment" of VS2017?

Steve_Lionel
Black Belt Retired Employee
2,025 Views

The simple answer to the Powershell question is to first type:

cmd.exe

and then proceed as shown earlier. If I find another solution, I will update this thread.

Steve_Lionel
Black Belt Retired Employee
2,020 Views

Here's an alternative, done from a cmd.exe window:

call "%IFORT_COMPILER20%bin\ipsxe-comp-vars.bat" intel64 vs2019
powershell

You will now be in Powershell and can use the ifort command.

JohnNichols
Valued Contributor II
1,970 Views

 

call "%IFORT_COMPILER20%bin\ipsxe-comp-vars.bat" intel64 vs2019
powershell

This is great - I did not know this would work.

JMN

Francesco
Beginner
1,997 Views

many thanks, the solutions you suggested worked perfectly.

VS2017: may be I should post this question on a dedicated site. I'm working on a Python project.

I write everything just to be clear (I'm not yet familiar with Python):

From VS2017: Tools > Python > Python Environments: it allows to install python packages from VS. Normally one can search PyPI packages. When installing a local package (e.g. downloaded from a git repository), one can simply add the local path to the search bar of the Packages (PyPI)... but in the output I get an error (that is the same obtained when installing the same package from cmd or powershell): "Could not locate executable ifort".

 

Steve_Lionel
Black Belt Retired Employee
1,982 Views

I am not familiar with using Python from inside VS, but I am not surprised by this behavior. Building a Fortran project in VS has the Intel Fortran paths added, but any non-Fortran projects or command scripts run won't know about the Intel Fortran paths. I do recommend asking about this in a Python-related community. 

Valencia__Miguel
Beginner
2,338 Views

Thanks, it works perfectly!!.

jayasundara__chathur
2,338 Views

How to Fix “not recognized as an internal or external command” in Windows?

 

set path=c:\foo;%path%
call "%IFORT_COMPILER19%bin\ipsxe-comp-vars.bat" intel64 vs2013
abq2019 job=plas_exp_axidisp user=code_exp cpus=4 interactive
 

This is my bat file. It is not working

Steve_Lionel
Black Belt Retired Employee
2,338 Views

I'm a bit surprised that the .bat file even accepts "vs2013" as an option as that isn't supported by the 19.0 compiler.

What happens if you type:

ifort

after the call command completes?

Reply