pgfortran with nmake (VS2019 community version)
Hi, I'm trying to build a fortran library using pgfortran and get the following error,
The Fortran compiler identification is PGI 19.10.0
Detecting Fortran compiler ABI info
Detecting Fortran compiler ABI info - failed
Check for working Fortran compiler: C:/Program Files/PGI/win64/19.10/bin/pgfortran.exe
Check for working Fortran compiler: C:/Program Files/PGI/win64/19.10/bin/pgfortran.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.18/Modules/CMakeTestFortranCompiler.cmake:51 (message):
The Fortran compiler
"C:/Program Files/PGI/win64/19.10/bin/pgfortran.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/me/Desktop/cmake-nmake-pgfortran/build-nmake/CMakeFiles/CMakeTmp
Run Build Command(s):nmake /nologo cmTC_63840\fast && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\nmake.exe" -f CMakeFiles\cmTC_63840.dir\build.make /nologo -L CMakeFiles\cmTC_63840.dir\build
Building Fortran object CMakeFiles/cmTC_63840.dir/testFortranCompiler.f.obj
C:\PROGRA~1\PGI\win64\19.10\bin\PGFORT~1.EXE -c C:\Users\me\Desktop\cmake-nmake-pgfortran\build-nmake\CMakeFiles\CMakeTmp\testFortranCompiler.f -o CMakeFiles\cmTC_63840.dir\testFortranCompiler.f.obj
Linking Fortran executable cmTC_63840.exe
C:\PROGRA~1\PGI\win64\19.10\bin\PGFORT~1.EXE @C:\Users\me\AppData\Local\Temp\nmBCBB.tmp
PGFORT~1-Error-Required tool link was not found
PGFORT~1... looked for link at C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64\link
PGFORT~1-Error-Tool loader was not found
NMAKE : fatal error U1077: 'C:\PROGRA~1\PGI\win64\19.10\bin\PGFORT~1.EXE' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (enable_language)
Configuring incomplete, errors occurred!
See also "C:/Users/me/Desktop/cmake-nmake-pgfortran/build-nmake/CMakeFiles/CMakeOutput.log".
See also "C:/Users/me/Desktop/cmake-nmake-pgfortran/build-nmake/CMakeFiles/CMakeError.log".`
Note that it's looking for link.exe in the following folder,
C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64\link
But CMAKE_LINKER is set the correct value,
C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/link.exe
The version # is different. Is this a bug with cmake or nmake ?