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

Problem of MKL memory management with mkl_malloc, mkl_memstat, mkl_free

nansal
Beginner
1,266 Views

Hi,
For applying the MKL memory management, I have used the external functions: mkl_malloc, mkl_memstat, and mkl_free, in my Fortran program in Linux.

I write these command lines in terminal:
MKL_LIBRARY_PATH=/opt/intel/mkl/9.1.023/lib/32
MKL_INCLUDE_PATH=/opt/intel/mkl/9.1.023/include
ifort -c my_program.for -L MKL_LIBRARY_PATH -I MKL_INCLUDE_PATH -lmkl_lapack -lmkl_ia32 -lguide -lpthread

But after this command line:
ifort -o my_prog my_program.o -L MKL_LIBRARY_PATH -I MKL_INCLUDE_PATH -lmkl_lapack -lmkl_ia32 -lguide -lpthread
I have this message:
undefined reference 'mkl_malloc_'
undefined reference 'mkl_memstat_'
undefined reference 'mkl_free_'

Has anyone have this problem?
Thanks

0 Kudos
4 Replies
ArturGuzik
Valued Contributor I
1,266 Views
Quoting - nansal
Hi,
For applying the MKL memory management, I have used the external functions: mkl_malloc, mkl_memstat, and mkl_free, in my Fortran program in Linux.

I write these command lines in terminal:
MKL_LIBRARY_PATH=/opt/intel/mkl/9.1.023/lib/32
MKL_INCLUDE_PATH=/opt/intel/mkl/9.1.023/include
ifort -c my_program.for -L MKL_LIBRARY_PATH -I MKL_INCLUDE_PATH -lmkl_lapack -lmkl_ia32 -lguide -lpthread

But after this command line:
ifort -o my_prog my_program.o -L MKL_LIBRARY_PATH -I MKL_INCLUDE_PATH -lmkl_lapack -lmkl_ia32 -lguide -lpthread
I have this message:
undefined reference 'mkl_malloc_'
undefined reference 'mkl_memstat_'
undefined reference 'mkl_free_'

Has anyone have this problem?
Thanks
Hi,

a few things: (a) your version is too old. I believe the memory management was introduced with 10.0 update 2 (b) you need INCLUDE 'mkl_service.fi' statement in your code.

A.
0 Kudos
nansal
Beginner
1,266 Views
Quoting - ArturGuzik
Hi,

a few things: (a) your version is too old. I believe the memory management was introduced with 10.0 update 2 (b) you need INCLUDE 'mkl_service.fi' statement in your code.

A.

Thank you so much, ArturGuzik

I'm using MKL version 10.0 update 2 but without the statement of the (include 'mkl_service.fi'), since there isn't in the include file. Now, I don't have the previous problem.




0 Kudos
Sahar_A_
Beginner
1,266 Views
and for C??
0 Kudos
barragan_villanueva_
Valued Contributor I
1,266 Views
Hi, MKL 10.0 is a major release which introduced layered model of libraries. So, link line is very different with MKL 9.1 release. Please try http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/
0 Kudos
Reply