I am facing the same problem as described here:
But with version 19 (IA-32, Version 220.127.116.11 Build 20181018)
When I use the /USEENV flag of VS2017 I get the message that the ifort.exe can not be found
It used to work with older versions of the Intel Fortran compiler. Is there a way to get way to get it to work ?
I am not sure if this will work for diagnosis of the problem.
Create a Fortran program that does not use /USEENV. The content of which follows the example found in the IVF documentation under GET_ENVIRONMENT_VARIABLE that obtains and prints PATH. Name the program FOO. Test it. When working, copy FOO.EXE to current directory of the folder causing issues with /USEENV however, use the target name of ifort.exe. Then try your build. The build won't build of course, but it should display the PATH environment variable. If the substitute ifort runs, but display is suppressed, then edit the program to write the contents of PATH to a file. Note, the variable used to obtain the value of the environment variable must be large enough to hold the environment variable PATH as produced with /USEENV.
In all likelihood either a ";" or "\" is missing as a result of the appendage of paths to PATH.
Also, If PATH is buggered up, you may need to look at the other environment variables that may be affected (e.g. INCLUDE, ...)
I can reproduce this. What's puzzling about it is if I select the option to Show Environment in the build log, PATH clearly has the right folders at the front.
I did some more investigations. Using sysinternals procmon (https://docs.microsoft.com/en-us/sysinternals/downloads/procmon) I was able to see that devenv.exe (when using /useenv) attempts to access ifort.exe at the path:
"c:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.1.144\windows\mkl\ifort.exe"
where the compiler ifort.exe certainly does not exist . By using mklink.exe on a command line to make links to locations where ifort and xilib are located:
cd c:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.1.144\windows\mkl mklink ifort.exe "c:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.1.144\windows\bin\intel64_ia32\ifort.exe" mklink xilib.exe "c:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.1.144\windows\bin\intel64_ia32\xilib.exe" cd c:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.1.144\windows\ mklink /d intel64 "c:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.1.144\windows\bin\intel64\"
Then compilation with /useenv works
I guess there must be some errors in the vs2017 integration