IntelLLVM: Error linking with Intel Fortran 2023 for Windows
Versions of software I am using. CMake version 3.25.1 Intel Fortran compiler version 2023.0 Microsoft Visual Studio version 2017
I am trying to build Lapack for windows by using their provided CMake build files (v3.10.1 of Lapack though I don't think it's a Lapack problem). It makes calls to the FortranCInterface functions, specifically FortranCInterface_VERIFY, which fails with the error message
C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin\ifx.exe CMakeFiles\VerifyFortran.dir\VerifyFortran.f.obj -fuse-ld=llvm-lib -o VerifyFortran.lib /machine:x64
ifx: error #10037: could not find 'C:\PROGRA~2\Intel\oneAPI\compiler\latest\windows\bin-llvm\llvm-lib'
It looks as if ifx
is trying to use llvm-lib
, which seems to be an LLVM linker, to link the test library and failing, and sure enough that linker is not present at the path specified or in my install at all, even after I tried repairing it. The line responsible for this argument in CMake is line 60 in Windows-IntelLLVM.cmake which attempts to use llvm-lib
for any compiler besides fortran versions less than 2022.1. I couldn't find too much info on it besides a small amount on LLVM's website. Switching to fuse-ld=lld
which is in the folder referenced gets closer but still fails:
lld-link: error: undefined symbol: MAIN__
>>> referenced by libifcoremd.lib(for_main.obj):(main)
Omitting the -fuse-ld
argument altogether does the same, maybe I need to provide a different linker.
It could be possible Intel forgot to ship this llvm-lib
tool, or did some other update, as I am assuming it existed in the 2022.1 version at least. If so, maybe Windows-IntelLLVM.cmake should be altered to cope with this change for this version?