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

'ifort' is not recognized as an external or internal command.

Brian_Allison
Beginner
748 Views
I am getting an error when trying to compile in VS2008.
'ifort' is not recognized as an external or internal command.
ifort command works fine in the IFC command prompt window.
my nmake command is: nmake -f makerw(makefile) opt="winintl"(tells the nmake weather to use IFC or CFC.) debug="yes"
0 Kudos
5 Replies
Steven_L_Intel1
Employee
748 Views
You have to run your nmake command from a "Fortran Command Prompt" window, or run ifortvars.bat (with the ia32 or intel64 argument) from the window you want to use.
0 Kudos
Brian_Allison
Beginner
748 Views
so instead ofnmake -f makerw opt="winintl" debug="yes" in VS2008 under the solution properties, i should put
ifortvars.bat ia32 -f makerw opt="winintl" debug="yes"
0 Kudos
Steven_L_Intel1
Employee
748 Views
Um, no, that won't help. You are invoking nmake from inside VS as a custom build step? Is this in a Fortran project?

ifortvars.bat sets up PATH and other environment variables so that the compiler can be located. This is not needed in VS for a Fortran project as the Fortran project system establishes these using the settings under Tools > Options > Intel Fortran.
0 Kudos
Brian_Allison
Beginner
748 Views
It is a fortran code developedoriginallyusing CFC. Now we are using IFC. It compiles fine from the IFC CMD window. Now I want to try an compile it using VS2008. I went in created a new makefile project.
set up the debug config settings
set my NMake build command line as: nmake -f makerw opt="winintl" debug="yes"
try to build and it does not know what ifort is.
I checked tools > options > Intel Fortran and all of the path information is there. What do I need to do with the ifortvars.bat then?
0 Kudos
Steven_L_Intel1
Employee
748 Views
I see - the problem is the use of a "makefile project". This won't use the settings from Tools > Options > Intel Fortran. I can think of two approaches.

1) Start VS from a Fortran Command Prompt window (devenv.exe). This will pick up PATH and other variables and that should do the trick.
2) Add the Fortran Executable, Include and Library paths to Tools > Options> Projects and Solutions > VC++ Directories. I'm unsure if this works for makefile projects.

Any particular reason you can't use a Fortran project for this instead of the makefiles?
0 Kudos
Reply