MKL shared libraries not "found" in the accepted lication

Open discussion for MAGMA library (Matrix Algebra on GPU and Multicore Architectures)

MKL shared libraries not "found" in the accepted lication

Postby Klausb » Sun Oct 08, 2017 9:22 am

Hello,

even so the shared and static libraries are not properly installed (see previous thread), I identified another issue of the shared library when I tried to make the examples.

Apparently, the path to the Intel MKL is wrong. The magma shared library looks for the Intel MKL shared libraries in /usr/bin but they are located in:
/opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/lib/intel64_lin

I added:
Code: Select all
                    -L$/opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/lib/intel64_lin -lmkl_core -lmkl_gnu_thread -lmkl_gf_lp64

to the example Makefile in the following section:
Code: Select all
MAGMA_LIBS       := -L$(MAGMADIR)/lib -lmagma_sparse -lmagma \
                               -L$(CUDADIR)/lib64 -lcublas -lcudart -lcusparse \
                               -L$(OPENBLASDIR)/lib -lopenblas \
                               -L$/opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/lib/intel64_lin -lmkl_core -lmkl_gnu_thread -lmkl_gf_lp64


but as you can see below, that doesn't help:

Code: Select all
make all
gcc -Wall -DADD_ -I/usr/local/magma/include -I/usr/local/magma/sparse/include -I/usr/local/cuda-9.0/include -c -o example_v1.o example_v1.c
gcc -Wall  -o example_v1 example_v1.o -L/usr/local/magma/lib -lmagma_sparse -lmagma -L/usr/local/cuda-9.0/lib64 -lcublas -lcudart -lcusparse -L/usr/include/openblas/lib -lopenblas -Lopt/intel/compilers_and_libraries_2018.0.128/linux/mkl/lib/intel64_lin -lmkl_core -lmkl_gnu_thread -lmkl_gf_lp64
/usr/bin/ld: cannot find -lmkl_core
/usr/bin/ld: cannot find -lmkl_gnu_thread
/usr/bin/ld: cannot find -lmkl_gf_lp64
collect2: error: ld returned 1 exit status
Makefile:74: die Regel für Ziel „example_v1“ scheiterte
make: *** [example_v1] Fehler 1


The Intel MKL directory is the default: /opt/intel/mkl

How can I figure out which path needs to be set and where?

Klaus
Klausb
 
Posts: 18
Joined: Thu Oct 05, 2017 3:04 pm

Re: MKL shared libraries not "found" in the accepted licatio

Postby mgates3 » Sat Oct 14, 2017 3:17 am

It seems from later posts that you figured out something that works.

In this case, I'm a bit confused what you're trying to do. The example/Makefile is setup to use OpenBLAS. If you want to use MKL instead, change

Code: Select all
-L$(OPENBLASDIR)/lib -lopenblas


to whatever MKL libraries you want, e.g., if using gcc and gfortran:

Code: Select all
-L$(MKLROOT)/lib/intel64 -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lpthread -lstdc++ -lm -lgfortran


I would follow the order of libraries listed in the make.inc-example/make.inc.mkl-*, as the order can matter.

-mark
mgates3
 
Posts: 750
Joined: Fri Jan 06, 2012 2:13 pm


Return to User discussion

Who is online

Users browsing this forum: No registered users and 1 guest