Software Archive
Read-only legacy content
17061 Discussions

shared library load issue

Azamat_M_
Beginner
1,468 Views

Hi,

I'm trying to run an executable in mic. I built it in a host with the following command: 

icpc -mmic -std=c++0x main.cpp.

The code uses _Cilk_spawn and _Cilk_sync functions. When I copied the executable to the mic, and tried to run it, saw following error: 

./a.out: error while loading shared libraries: libcilkrts.so.5: cannot open shared object file: No such file or directory

I set LD_LIBRARY_PATH env variable:

[root@mic0 tmp]# echo $LD_LIBRARY_PATH
/opt/intel/intel_software/composer_xe_2015.1.133/compiler/lib/intel64/:/usr/lib64/:/lib64/

Following is the output of 'ldd' command in the host if I built main.cpp without -mmic flag:

[root@xphidev2 sort]# ldd a.out 
    linux-vdso.so.1 =>  (0x00007fff457d8000)
    libm.so.6 => /lib64/libm.so.6 (0x00007f8c9bd26000)
    libcilkrts.so.5 => /opt/intel/intel_software/composer_xe_2015.1.133/compiler/lib/intel64/libcilkrts.so.5 (0x00007f8c9bae6000)
    libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f8c9b7df000)
    libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f8c9b5c9000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f8c9b207000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007f8c9b003000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f8c9ade7000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f8c9c034000)

And this is the output of 'ldd' command for the executable in mic which is built with -mmic flag:

[root@mic0 tmp]# ldd a.out 
    linux-vdso.so.1 =>  (0x00007fff3ffff000)
    libm.so.6 => /lib64/libm.so.6 (0x00007fdff0577000)
    libcilkrts.so.5 => not found
    libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fdff027d000)
    libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fdff006b000)
    libc.so.6 => /lib64/libc.so.6 (0x00007fdfefd13000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007fdfefb0f000)
    /lib64/ld-linux-k1om.so.2 (0x00007fdff07a6000)

Tried even to copy libcilkrts.so.5 library manually to /lib64/, /usr/lib64/, but didn't help. Struggling with this for 2 days. I'd appreciate if somebody helped me.

Thanks

0 Kudos
4 Replies
Artem_R_Intel1
Employee
1,468 Views

Hi,
Have you tried to copy to the MIC card libcilkrts.so.5 with correct architecture (elf64-k1om)?
There's compiler/lib/mic/ folder with MIC specific compiler libraries.

0 Kudos
Kevin_D_Intel
Employee
1,468 Views

With your /opt/intel area available on the card, as Artem eluded to, set the LD_LIBRARY_PATH to refer to the “mic” libraries. The “intel64” to which you pointed to are for use on the host only.

So, use the path: /opt/intel/intel_software/composer_xe_2015.1.133/compiler/lib/mic

0 Kudos
Azamat_M_
Beginner
1,468 Views

Thanks a lot Artem and Kevin! After setting  LD_LIBRARY_PATH to /opt/intel/intel_software/composer_xe_2015.1.133/compiler/lib/mic, it worked.

0 Kudos
Kevin_D_Intel
Employee
1,468 Views

Glad to hear that.

0 Kudos
Reply