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

IFORT.EXE not found when using USEENV flag of VS2017

Michael_J_4
Beginner
1,030 Views

I am facing the same problem as described here:

https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/737642

But with version 19 (IA-32, Version 19.0.1.144 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 ?

 

 

 

0 Kudos
6 Replies
jimdempseyatthecove
Honored Contributor III
1,030 Views

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, ...)

Jim Dempsey

0 Kudos
Steve_Lionel
Honored Contributor III
1,030 Views

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.

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,030 Views

It should be obvious that if the above shows a problem with PATH, INCLUDE, ... that the fix is to correct the missing token.

Jim Dempsey

0 Kudos
Steve_Lionel
Honored Contributor III
1,030 Views

In my tests, PATH is fine in the build log, matching what I see from the command line. I recommend opening a support ticket on the problem.

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,030 Views
0 Kudos
Michael_J_4
Beginner
1,030 Views

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

0 Kudos
Reply