Community
cancel
Showing results for 
Search instead for 
Did you mean: 
agrim_p_
Beginner
41 Views

Configuring C++ library to use MKL

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
Black Belt
41 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.
 

agrim_p_
Beginner
41 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.

TimP
Black Belt
41 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.

Gennady_F_Intel
Moderator
41 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/. ;