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

Trouble running starter program, Intel mkl linux

nas_09
Beginner
1,410 Views
Hey all, I installed and setup the Intel MKL libraries on a 64-bit machine running ubuntu linux and have tried to follow the directions in the "Getting Started" document. However, when I attempt to compile the code using gcc using the command: gcc -m32 mkl_lab_solution.c -lmkl_intel -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm, I get this error:

"/usr/bin/ld: cannot find -lmkl_intel
/usr/bin/ld: skipping incompatible /home/nick/Desktop/IntelMKL/mkl/lib/intel64/libmkl_intel_thread.so when searching for -lmkl_intel_thread
/usr/bin/ld: skipping incompatible /home/nick/Desktop/IntelMKL/mkl/lib/intel64/libmkl_intel_thread.a when searching for -lmkl_intel_thread
/usr/bin/ld: cannot find -lmkl_intel_thread
/usr/bin/ld: skipping incompatible /home/nick/Desktop/IntelMKL/mkl/lib/intel64/libmkl_core.so when searching for -lmkl_core
/usr/bin/ld: skipping incompatible /home/nick/Desktop/IntelMKL/mkl/lib/intel64/libmkl_core.a when searching for -lmkl_core
/usr/bin/ld: cannot find -lmkl_core
/usr/bin/ld: skipping incompatible /home/nick/Desktop/IntelMKL/compiler/lib/intel64/libiomp5.so when searching for -liomp5
/usr/bin/ld: skipping incompatible /home/nick/Desktop/IntelMKL/compiler/lib/intel64/libiomp5.a when searching for -liomp5
/usr/bin/ld: cannot find -liomp5
collect2: ld returned 1 exit status"

I apologize if this is a stupid question, I'm new to the command prompt environment and don't fully understand the steps that're going on, but I can't wrap my head around what's actually wrong here. Help me out?
0 Kudos
3 Replies
mecej4
Honored Contributor III
1,410 Views
Set the environmental variable LD_LIBRARY_PATH to include the directory containing the 32-bit MKL libraries.

Or, leave out the -m32 option to GCC if you have only the 64-bit version of MKL installed.
0 Kudos
Gennady_F_Intel
Moderator
1,410 Views

when the installation of Intel MKL for Linux* OS is complete, set the INCLUDE, MKLROOT,LD_LIBRARY_PATH, MANPATH, LIBRARY_PATH, CPATH, FPATH, and NLSPATH environment variables in thecommand shell using one of the script files in the bin subdirectory of the Intel MKL installation directory.You can find these scripts , as an example, from here "\mkl\bin"

0 Kudos
Fergal_C_
Beginner
1,410 Views

I was having a similar issue, even after running the setup script.

Make sure you are using the correct flags for your architecture. You can find a handy configurator here:

https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor

0 Kudos
Reply