Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Configuring C++ library to use MKL

agrim_p_
Beginner
342 Views

I'm trying to configure Opt++ to use MKL on Debian 8. Their document (https://software.sandia.gov/opt++/opt++2.4_doc/html/InstallDoc.html#blas) indicates to use the syntax

./configure --with-blas=/path/to/blas/blaslibraryname.a

however, when I checked the following two paths, there are several .a files

/opt/intel/mkl/lib/intel64/

/opt/intel/compilers_and_libraries/linux/mkl/lib/intel64

Which library do I use? I tried a couple, but it doesn't appear to work according to the configure.log, which points out undefined reference to sgemm_.

Thanks.

0 Kudos
4 Replies
TimP
Honored Contributor III
342 Views

At least one of those paths should be a symlink, both pointing to the specific version installation folder.  Guessing that you may use icpc and are looking for the simplest way to link MKL, there is the option icpc -mkl which you could include in your configuring for icpc. At least 3 libraries are needed; there are additional ways of doing it.   If you wish to use other compilers, such as g++, or have more complicated requirements, you should use the MKL link advisor tool.
 

0 Kudos
agrim_p_
Beginner
342 Views

Tim P. wrote:

At least one of those paths should be a symlink, both pointing to the specific version installation folder.  Guessing that you may use icpc and are looking for the simplest way to link MKL, there is the option icpc -mkl which you could include in your configuring for icpc. At least 3 libraries are needed; there are additional ways of doing it.   If you wish to use other compilers, such as g++, or have more complicated requirements, you should use the MKL link advisor tool.
 

Unfortunately, I don't have icpc as I'm using MKL under the community license, so I plan to use g++.

I've identified the 3 libraries required using the link tool, however, it appears Opt++ is only looking for 1.

0 Kudos
TimP
Honored Contributor III
342 Views

I didn't realize that MKL community would use the same install directories as icpc.

If opt++ is so limited, you may be able to provide a partial ld linker script as the target of --with-blas, or make a custom library from MKL.  If you use MKL parallel, I believe you must replace -lgomp (if used, possibly implicitly) by -liomp5.

0 Kudos
Gennady_F_Intel
Moderator
342 Views

Agrim,  1) pls use libraries from /opt/intel/compilers_and_libraries/linux/mkl/lib/intel64.  2) use mkl linkier adviser to check which mkl's libraries you need to link follow this link:https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/. ;

 

0 Kudos
Reply