Nmake and ifort are not recognized from a command window, however using Intel® Fortran Compiler under Microsoft Visual Studio* works perfectly.
Follow below checklist to troubleshooting Visual Studio command environmental issues:
1. Verify whether ifort and nmake are installed correctly:
For Visual Studio 2017, nmake is installed at:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64\nmake.exe
Find this by running below commands from a system ifort or nmake setup correctly:
> where nmake > where ifort
Also check whether the location is included from PATH environment:
> echo %PATH%
2. If nmake can be found, verify if Visual Studio setup script runs properly.
Start a cmd window, and run Visual Studio setup script manually:
> "C:\Program Files (x86)\Microsoft Visual Studio\2017 \Professional\VC\Auxiliary\Build\vcvars64.bat"
An expected output is as below
> "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvars64.bat" \Common was unexpected at this time.
> set VSCMD_DEBUG=3
> "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvars64.bat" > setup.log 2>&1
5.If you got the same error as above, there are some references from Visual Studio community: