Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Unable to link library files

Vishnu
Novice
1,737 Views

I'm using Archlinux, and installed the intel oneAPI toolkit via this package:

https://aur.archlinux.org/packages/intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic/

 

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?

0 Kudos
7 Replies
RahulV_intel
Moderator
1,712 Views

Hi,


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.


Regards,

Rahul


0 Kudos
Vishnu
Novice
1,704 Views

Hi Rahul,

 

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.

0 Kudos
RahulV_intel
Moderator
1,691 Views

Hi,

 

Could you try providing the full pathname during linking explicitly and let me know if it helps?

 

For example

icc filename.obj /path/to/lib_name1.so /path/to/lib_name.so

 

Thanks,

Rahul

 

0 Kudos
Vishnu
Novice
1,674 Views

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
0 Kudos
RahulV_intel
Moderator
1,658 Views

Hi,


As per the oneAPI toolkit software requirements, Archlinux distribution is not supported currently.


Kindly refer to the links below for more information:

https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-base-toolkit-system-requirements.html

https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-hpc-toolkit-system-requirements.html


Apologies for the inconvenience caused.


Regards,

Rahul


0 Kudos
RahulV_intel
Moderator
1,603 Views

Hi,


Could you try with a supported OS and let me know if you face any issues?


Thanks,

Rahul


0 Kudos
RahulV_intel
Moderator
1,587 Views

Hi,


I have not heard back from you; we won’t be monitoring this thread. If you need further assistance, please post a new thread.


Regards,

Rahul


0 Kudos
Reply