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

First step to MKL

smtp12357
Beginner
503 Views
Hi

I'm jast now installed Intel C++ Compiler on linux machine and have problems with mkl.

1. I wrote simple code and tried to compile it with the line command
/opt/intel/Compiler/11.0/081/bin/ia32/icc first.c -lmkl_lapack -o first

but I got catastrophic error: could not open source file "mkl.h" (I used #include "mkl.h").
What is wrong?

2. The second question is not urgent for me, but it's interesting too. One gay said me that parallel
computations with mkl works on 64bit linux machine only, but I use 32bit one now. Is it true?
If not, could anybody show me a line commad for parallel start for Core 2 Duo.

Thanks
0 Kudos
5 Replies
TimP
Honored Contributor III
503 Views
1. You didn't specify the -I path to your MKL include directory in your compile command, such as -I/opt/intel/Compiler/11.0/081/mkl/include/
2. assuming that aspersion is a typo, there is a complete MKL installation in your 32-bit 11.0 compiler installation, saving you some of the headaches about choosing the 32-bit support in past versions of MKL. There are a few differences in the names of the libraries required; there is no support for 64-bit integers, since those aren't efficient in 32-bit mode. Please look at the docs for example compile commands.
0 Kudos
Gennady_F_Intel
Moderator
503 Views
The first question:
If you use intel compiler.plese try to use the following lbraries:
libmkl_intel.a libmkl_intel_thread.a libmkl_core.a libiomp5.so

The second question:
thats not correct. MKL performs parallel computations on IA32, Intel64 and IA64 platforms.
<> You have to link threaded libraries and by default thats all you have to do.
You application will be running on all treads available on your system.
More info about treading in MKL and how you can manage you can find in userquide manual ( see ../doc folder )
--GIF

0 Kudos
smtp12357
Beginner
503 Views
Thanks tim18, thanks Gennady Fedorov

I have tried to take into account yours answers and start compilation with the following command line:

/opt/intel/Compiler/11.0/081/bin/ia32/icpc first.cpp -I/opt/intel/Compiler/11.0/081/mkl/include/
-L/opt/intel/Compiler/11.0/081/mkl/lib/32 -lmkl_intel -lmkl_core -lmkl_intel_thread -liomp5 -o first

but I got the following error:
/opt/intel/Compiler/11.0/081/lib/ia32/libiomp5.so: undefined reference to 'pthread_atfork'

if I use command without "-L..." i.e.
/opt/intel/Compiler/11.0/081/bin/ia32/icpc first.cpp -I/opt/intel/Compiler/11.0/081/mkl/include/
-lmkl_intel -lmkl_core -lmkl_intel_thread -liomp5 -o first

I have error:
Id: cannot find -lmkl_intel

Does anybody know what is wrong?

0 Kudos
Gennady_F_Intel
Moderator
503 Views
please add "-lpthread -lm" in the end of the linking line

0 Kudos
smtp12357
Beginner
503 Views
Fine, it works

Thank you very much!
Good forum
0 Kudos
Reply