Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Compile and Link CBLAS

jbensonjr
Beginner
547 Views
I'm trying to compile and link some level-2 and level-3 CBLAS functions such as cblas_dgemmx.c from Intel's Math Kernel Library.

I created a project in Microsoft Visual Studio 2008, converted to an Intel project to use Intel compiler and linker. My project consists of just some examples from the Intel's MKL examples directory (i.e. directory: C:\Program Files\Intel\MKL\10.0.2.019\examples\cblas\source)

I can compile ok, but can't link successfully.

Could you please tell me which options and libraries are required for static linking for IA32 machines?

I've tried:

- Compiler option /MT for multi threaded

- Use libraries mkl_intel_c.lib, mkl_intel_thread.lib, mkl_core.lib, libguide.lib

By the way I can compile and link level 1 CBLAS functions by using just mkl_intel_c.lib and mkl_core.lib when linking.

Thank you a lot for your time.
0 Kudos
1 Reply
TimP
Honored Contributor III
547 Views

You hint that you're having difficulty linking threaded MKL BLAS functions. As you say you're using an Intel compiler, my preference would be to use that compiler to drive the link, and use -Qopenmp or -Qparallel to allow it to select the OpenMP support libraries. This would help assure that you select an OpenMP libary consistent with your compilation. If you want threading only in MKL, -Qopenmp will not affect your own code when there are no OpenMP directives there. If you don't want threading in MKL, use the mkl_sequential rather than the mkl_thread library. You shouldn't mix scripts which invoke several mkl_dll libraries along with explicit specification of an mkl static library. If this information isn't sufficient, you may need to be more explicit about your compile and link commands and error messages.

0 Kudos
Reply