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

ifort not recognized as an internal or external command

Valencia__Miguel
Beginner
9,637 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
Honored Contributor III
9,636 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

0 Kudos
15 Replies
Steve_Lionel
Honored Contributor III
9,637 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.

0 Kudos
Francesco
Beginner
9,338 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

 

0 Kudos
Steve_Lionel
Honored Contributor III
9,325 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?

0 Kudos
Steve_Lionel
Honored Contributor III
9,323 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.

0 Kudos
Steve_Lionel
Honored Contributor III
9,318 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 III
9,256 Views

 

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

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

JMN

0 Kudos
Francesco
Beginner
9,295 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".

 

0 Kudos
Steve_Lionel
Honored Contributor III
9,280 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. 

0 Kudos
Ever
Novice
2,876 Views

Until today, I had VS2019 and an earlier version of IntelOneApi installed (IFORT_COMPILER16), and I used to be able to compile the Abaqus software together with my own USER subroutines (mysourcecode.for) by doing this:

abaqus make library=mysourcecode.for

 

but for some unknown reason now I get the message:

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

 

Trying to solve the problem, today I updated to IntelOneApi 2023, but I continue to get the same error. So, I added this to my "abaqus.bat" file:

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

 

Now I get this error:

"C:\Program Files (x86)\Intel\oneAPI\compiler\2023.1.0\windows\bin\ipsxe-comp-vars.bat"' is not recognized as an internal or external command, operable program or batch file.

 

What can I do?

PS. abaqus.bat

@Echo off
call "%IFORT_COMPILER23%bin\ipsxe-comp-vars.bat" intel64 vs2019
"C:\SIMULIA\Commands\abq2020.bat" %*

 

PS. abq2020.bat

@Echo off
setlocal
set ABA_COMMAND=%~nx0
set ABA_COMMAND_FULL=%~f0
"C:\SIMULIA\EstProducts\2020\win_b64\code\bin\ABQLauncher.exe" %*
endlocal

 

0 Kudos
Valencia__Miguel
Beginner
9,636 Views

Thanks, it works perfectly!!.

0 Kudos
jayasundara__chathur
9,636 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

0 Kudos
Steve_Lionel
Honored Contributor III
9,634 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?

0 Kudos
Steve_Lionel
Honored Contributor III
2,840 Views

Replace the path of the .bat file with "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"

0 Kudos
Ever
Novice
2,750 Views

Already have setvars.bat in the abq2020.bat that is used to start Abaqus. 

I have now identified the problem (the PATH becomes too long) but don't know how to solve it.

Let me explain. 

On an old computer I have the oneAPY compiler 2021.2.0 installed and everything works great because the 2021.2.0 API only added one line to the PATH environment, namely "Program Files (x86)\Intel\oneAPY compiler 2021.2.0\env" 

Now, on a new computer, I installed exactly the same API components that I installed in 2021, following the instruction in my own textbook!

I could not find the 2021.2.0 API, so I installed the current 2023 version, which added a bunch of lines to my PATH, thus making it very long but barely to exceeding the limit, whatever that is.

Now when the abq2020.bat calls setvars.bat and setvars-vcvarsall.bat it blows the limit for the PATH length and that kills everything.

I don't know what to delete in the PATH. Everything there seems legit, from Intel, Microsoft, pretty much that's it. 

I am now trying to remove components, such as MPI, etc., one at a time, and deleting those entries from the PATH, but really I don't know what I am doing.

Any help is appreciated. 

 

0 Kudos
Ever
Novice
2,748 Views

Adding to my previous reply, the message from Abaqus is 

 

The input line is too long.
The syntax of the command is incorrect.

 

I wonder if anybody knows what is the absolute minimum set of API components that I need to run Abaqus in single processor mode?

 

0 Kudos
Reply