I'm using Archlinux, and installed the intel oneAPI toolkit via this package:
When compiling an executable, I end up with linker errors, even though I've sourced the "setvars.sh" file.
$ icc -xHost -O2 test.c ld: cannot find -limf ld: cannot find -lsvml ld: cannot find -lirng
This seems to happen even though both the environment variables `LIBRARY_PATH` as well as `LD_LIBRARY_PATH` contain the directory that has the relevant library files: `/opt/intel/oneapi/compiler/2021.2.0/linux/compiler/lib/intel64_lin`.
What might be the issue?
Since the required library paths are present in LD_LIBRARY_PATH, I could think of two possible reasons for this behavior:
- If the required libraries have the suffix libname.so.version, the linker might not be able to find the symlink to libname.so. In this case, creating a symlink to libname.so could help. (Linker generally looks for libname.so)
- The linker might not have read access to those libraries. Although less likely, try compiling with root access and see if it helps.
The file names do not have version suffixes, and the file permissions also look fine:
$ ls -la /opt/intel/oneapi/compiler/2021.2.0/linux/compiler/lib/intel64_lin/ drwxr-xr-x 4 root root 4096 Jun 6 13:13 ./ drwxr-xr-x 3 root root 40 Jun 6 13:06 ../ . . -rwxr-xr-x 1 root root 4751920 Jun 6 13:02 libimf.so* -rwxr-xr-x 1 root root 1483584 Jun 6 13:02 libirng.so* -rwxr-xr-x 1 root root 26202096 Jun 6 13:02 libsvml.so* . .
The owner is 'root', but everyone has read & execution permissions. And the directories also have the correct permissions.
Compiling with `sudo` does not help, and gives the same linker errors.
Could you try providing the full pathname during linking explicitly and let me know if it helps?
icc filename.obj /path/to/lib_name1.so /path/to/lib_name.so
Nope. That does not work either:
$ icc -c -xHost -O2 test.c $ icc test.o /opt/intel/oneapi/compiler/2021.2.0/linux/compiler/lib/intel64_lin/libimf.so /opt/intel/oneapi/compiler/2021.2.0/linux/compiler/lib/intel64_lin/libsvml.so /opt/intel/oneapi/compiler/2021.2.0/linux/compiler/lib/intel64_lin/libirng.so ld: cannot find -limf ld: cannot find -lsvml ld: cannot find -lirng
As per the oneAPI toolkit software requirements, Archlinux distribution is not supported currently.
Kindly refer to the links below for more information:
Apologies for the inconvenience caused.