I am trying to build a simple Fortran program with oneAPI in wsl (Ubuntu 20.04). I use vscode to connect to wsl for code editing, use cmake to configure compiling, and the compiler is ifort in oneAPI.
When I configure the project, I got errors said ifort is not able to compile a simple test program. The full cmake output is:
[cmake] -- The Fortran compiler identification is Intel 2021.3.0.20210609 [cmake] -- Detecting Fortran compiler ABI info [cmake] -- Detecting Fortran compiler ABI info - failed [cmake] -- Check for working Fortran compiler: /opt/intel/oneapi/compiler/2021.3.0/linux/bin/intel64/ifort [cmake] -- Check for working Fortran compiler: /opt/intel/oneapi/compiler/2021.3.0/linux/bin/intel64/ifort - broken [cmake] CMake Error at /usr/local/lib/python3.8/dist-packages/cmake/data/share/cmake-3.21/Modules/CMakeTestFortranCompiler.cmake:54 (message): [cmake] The Fortran compiler [cmake] [cmake] "/opt/intel/oneapi/compiler/2021.3.0/linux/bin/intel64/ifort" [cmake] [cmake] is not able to compile a simple test program. [cmake] [cmake] It fails with the following output: [cmake] [cmake] Change Dir: /home/user/programs/helloworld/build/CMakeFiles/CMakeTmp [cmake] [cmake] Run Build Command(s):/usr/bin/make -f Makefile cmTC_04e59/fast && /usr/bin/make -f CMakeFiles/cmTC_04e59.dir/build.make CMakeFiles/cmTC_04e59.dir/build [cmake] make: Entering directory '/home/user/programs/helloworld/build/CMakeFiles/CMakeTmp' [cmake] Building Fortran object CMakeFiles/cmTC_04e59.dir/testFortranCompiler.f.o [cmake] /opt/intel/oneapi/compiler/2021.3.0/linux/bin/intel64/ifort -c /home/user/programs/helloworld/build/CMakeFiles/CMakeTmp/testFortranCompiler.f -o CMakeFiles/cmTC_04e59.dir/testFortranCompiler.f.o [cmake] Linking Fortran executable cmTC_04e59 [cmake] /usr/local/lib/python3.8/dist-packages/cmake/data/bin/cmake -E cmake_link_script CMakeFiles/cmTC_04e59.dir/link.txt --verbose=1 [cmake] /opt/intel/oneapi/compiler/2021.3.0/linux/bin/intel64/ifort CMakeFiles/cmTC_04e59.dir/testFortranCompiler.f.o -o cmTC_04e59 [cmake] ld: /opt/intel/oneapi/compiler/2021.3.0/linux/bin/intel64/../../bin/intel64/../../lib/icx-lto.so: error loading plugin: libimf.so: cannot open shared object file: No such file or directory [cmake] make: *** [CMakeFiles/cmTC_04e59.dir/build.make:99: cmTC_04e59] Error 1 [cmake] make: Leaving directory '/home/user/programs/helloworld/build/CMakeFiles/CMakeTmp' [cmake] make: *** [Makefile:127: cmTC_04e59/fast] Error 2 [cmake] [cmake] [cmake] [cmake] [cmake] [cmake] CMake will not be able to correctly generate this project. [cmake] Call Stack (most recent call first): [cmake] CMakeLists.txt:2 (project) [cmake] [cmake] [cmake] -- Configuring incomplete, errors occurred! [cmake] See also "/home/user/programs/helloworld/build/CMakeFiles/CMakeOutput.log". [cmake] See also "/home/user/programs/helloworld/build/CMakeFiles/CMakeError.log".
The fact that same configuration works on other machine shows that it may be a corrupted installation on this specific machine.
The libimf library is not found in your case. Could you please check if you have it on your machine? If yes then the environment is not set correctly. Do you run setvars.sh file before starting the compilation?