Software Archive
Read-only legacy content
17061 Discussions

Unable to compile for coprocessor on native mode due to issues with custom library linking

Keval_S_
Beginner
308 Views

I am successfully able to compile and execute my code on Xeon, but when I try to compile it for executing on a co-processor (natively by adding a -mmic flag), I get the following error:

x86_64-k1om-linux-ld: cannot find -lpardiso500-GNU481-X86-64
x86_64-k1om-linux-ld: cannot find -lblas
x86_64-k1om-linux-ld: cannot find -llapack
x86_64-k1om-linux-ld: cannot find -lgfortran

My .sh file for compilation:

export LD_LIBRARY_PATH=/usr/local/lib:/opt/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/intel64_lin_mic/:$LD_LIBRARY_PATH
icc -mmic PIC.c -o PIC -pg -g -lpardiso500-GNU481-X86-64 -lblas -llapack -lgfortran -fopenmp -lpthread -lm -O2 -vec-report2

$LD_LIBRARY_PATH looks like:

/usr/local/lib:
/opt/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/intel64_lin_mic/:
/opt/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/intel64:
/opt/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/intel64_lin:
/opt/intel/compilers_and_libraries_2016.3.210/linux/mpi/intel64/lib:
/opt/intel/compilers_and_libraries_2016.3.210/linux/mpi/mic/lib:
/opt/intel/compilers_and_libraries_2016.3.210/linux/ipp/lib/intel64:
/opt/intel/mic/coi/host-linux-release/lib:
/opt/intel/mic/myo/lib:
/opt/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/intel64:
/opt/intel/compilers_and_libraries_2016.3.210/linux/mkl/lib/intel64:
/opt/intel/compilers_and_libraries_2016.3.210/linux/tbb/lib/intel64/gcc4.4:
/opt/intel/debugger_2016/libipt/intel64/lib:
/opt/intel/compilers_and_libraries_2016.3.210/linux/daal/lib/intel64_lin:
/opt/intel/compilers_and_libraries_2016.3.210/linux/daal/../compiler/lib/intel64_lin

Looking at previous posts on the forum, I tried adding '/usr/lib64/' to the $LD_LIBRARY_PATH but then it gives me the following error when I try to compile:-

relocation error: /usr/lib64/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference

Also, it was suggested to avoid adding '/usr/lib64/'.

What sould I do next?

Regards

Keval Shah

0 Kudos
4 Replies
TimP
Honored Contributor III
308 Views

There is no gfortran for k1om architecture.  You must use the MKL libraries for k1om provided with icc, found in a subdirectory of intel64_lin_mic.  Even if you were building for host, the MKL should be preferable to generic linux x86-64 gcc libraries.  MKL link advisor should show  you most of what you need.

I don't know whether -fopenmp -mmic will be interpreted as equivalent to -qopenmp.

If you haven't mounted the MKL libraries on MIC, you will need to copy them over at run time.

0 Kudos
SergeyKostrov
Valued Contributor II
308 Views
>>I don't know whether -fopenmp -mmic will be interpreted as equivalent to -qopenmp. It should not. -mmic is not related to OpenMP. -fopenmp is for Gcc-like compiler on a Linux -qopenmp is for Msc-compatible compilers on Windows and Icc-compatible compilers on Linux.
0 Kudos
SergeyKostrov
Valued Contributor II
308 Views
>>...relocation error: /usr/lib64/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 >>with link time reference... Try to scan all *.so files on the system and look for _dl_starting_up substring. It would help to understand if there is another module with that symbol.
0 Kudos
Keval_S_
Beginner
308 Views

Hello,

Tim and Sergey, thank you very much for your advise. I moved over to the mkl for integrating pardiso in my code. I compiled the application natively using -mmic, -liomp5 and linked statically. It is working now.

Regards

Keval

0 Kudos
Reply