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

Compilation problem

janas_s
Beginner
1,344 Views
Hi all,

I try to compile a simple program on my mac os 10.5 (leopard) with ifort and MKL. My program is :
***********************************************
program MatMulTest
integer, parameter :: n = 2000
real, allocatable :: matrixA(:,:), matrixB(:,:), matrixC(:,:)
integer :: i, j

allocate(matrixA(n,n), matrixB(n,n), matrixC(n,n))
matrixA = 0.1
matrixB = 0.1

call sgemm (matrixA,matrixB,matrixC)

print *,'The sum of matrix C is',sum(matrixC)
deallocate(matrixA, matrixB, matrixC)
end program

************************************************
I have saved my prog as essai.f90 in my /Users/sebastien/Desktop

I go in the directory by
$cd /Users/sebastien/Desktop

and I compile

$ifort essai2.f90 -L/Library/Frameworks/Intel_MKL.framework/Versions/10.0.2.018/lib/em64t/ -I/Library/Frameworks/Intel_MKL.framework/Versions/10.0.2.018/include/ -lmkl_core -lmkl_intel_lp64 -lmkl_intel_thread

It compile correctly but when I try to run the prog by

$./a.out

I have the error

Macintosh:Desktop sebastien$ ./a.out dyld: Library not loaded: libmkl_core.dylib Referenced from: /Users/sebastien/Desktop/./a.out Reason: image not found
Trace/BPT trap

What's the problem??

Have a nice day,

Sbastien
0 Kudos
5 Replies
TimP
Honored Contributor III
1,344 Views
Is your MKL library shown in the LD_LIBRARY_PATH environment variable?
0 Kudos
Andrey_G_Intel2
Employee
1,344 Views

Small correction: libmkl_core.dylib should be visible in the DYLD_LIBRARY_PATH environment variable.

Andrey

0 Kudos
janas_s
Beginner
1,344 Views
Hi,

How can I see that?

Thanks for your help
0 Kudos
Andrey_G_Intel2
Employee
1,344 Views

echo $DYLD_LIBRARY_PATH

as output you should see PATH to the place where MKL is installed. If you will not see it, justadd needed path to the DYLD_LIBRARY_PATH (export DYLD_LIBRARY_PATH=_path_to_the_mkl_libraries_foleder_:$DYLD_LIBRARY_PATH) and run your executable again.

Andrey

0 Kudos
janas_s
Beginner
1,344 Views
Thanks a lot, it works!


0 Kudos
Reply