Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
Announcements
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.

Unable to link library files

Vishnu
Novice
1,020 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
995 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


Vishnu
Novice
987 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.

RahulV_intel
Moderator
974 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

 

Vishnu
Novice
957 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
RahulV_intel
Moderator
941 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


RahulV_intel
Moderator
886 Views

Hi,


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


Thanks,

Rahul


RahulV_intel
Moderator
870 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


Reply