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

MAKE return error: libmkl_core.a(dsytrf.a): undefined reference to

Junru_Zhang
Beginner
1,570 Views

The make command is:

cmake -DBLA_STATIC=ON ..(no error)

make install(error)

 

The error message is:

opt/intel/mkl/lib/intel64/libmkl_core.a(dsytrf.o): In function 'mkl_lapack_dsytrf':

dsytrf_gen.f:(.test+0x430): undefined reference to "mkl_lapack_dlasyf"

dsytrf_gen.f:(.test+0x6a5): undefined reference to "mkl_lapack_dlasyf"

opt/intel/mkl/lib/intel64libmkl_core.a(dsygst.o): In function 'mkl_lapack_dsygst':

dsygst_gen.f:(.test+0x320): undefined reference to "mkl_blas_dsyr2k"

dsygst_gen.f:(.test+0x675): undefined reference to "mkl_blas_dsyr2k"

......

 

I have not pasted all error functions. All the errors point to the same static lib file:opt/intel/mkl/intel64/libmkl_core.a.

 

I have obtained some help from https://www.intel.cn/content/www/cn/zh/developer/tools/oneapi/onemkl-link-line-advisor.html. After many attempts, cmake(cmake -DBLA_STATIC=ON ..) and make still exists error. 

I am very confused that I have added 

-Wl,--start-group

opt/intel/mkl/lib/intel64/libmkl_intel_ilp64.a

opt/intel/mkl/lib/intel64/libmkl_sequential.a

opt/intel/mkl/lib/intel64/libmkl_core.a

-Wl,--end-group

in the function target_link_libraries(object lib) in the CMakeLists.txt of the object file.

 

Is it possible that I should add the MKLROOT file to other sub-objects linked by the current top-object? In fact I have added the three MKLROOT file into target_link_libraries(sub-objects MKLROOT.a) of all sub-objects. And the error still occurs. 

 

I don't know what happens and which file should I review or recheck to find the error comes from? 

 

0 Kudos
8 Replies
VarshaS_Intel
Moderator
1,533 Views

Hi,


Thanks for posting in Intel Communities.


Could you please let us know the OS details, and Intel MKL version you are using?


Also, could you please provide us with a sample reproducer code and CMakeLists you are using to reproduce your issue at our end?


Thanks & Regards,

Varsha


0 Kudos
Junru_Zhang
Beginner
1,520 Views

The OS detail I use is Red Hat Enterprise Linux Server release 7.5 (Maipo). Intel MKL version I use is 2019.

Later I will produce one simple sample later to test the static lib linking and if error still occur, I will tell you about it.

Now can you tell me which file should I review or recheck to find the error comes from when error happens? 

Or maybe you have found something from above error under the given OS detail or MKL version? 

If you have any idea, you can tell me to try. And I will feedback to you as soon as possible. 

0 Kudos
Junru_Zhang
Beginner
1,453 Views

My codes will also link dynamic .so files. I want my codes to link the specified static dynamic .a files. It seems that it is invalid to set target_link_libraries(objects MKLROOT.a).

0 Kudos
VarshaS_Intel
Moderator
1,439 Views

Hi,

 

Thanks for sharing the details.

 

Could you please try executing your code using the latest version of Intel oneMKL under the supported environment as mentioned in the below system requirements link and let us know if the issue persists?

https://www.intel.com/content/www/us/en/developer/articles/system-requirements/oneapi-math-kernel-library-system-requirements.html


Also, please find the below link for the supported Intel oneAPI versions:

https://www.intel.com/content/www/us/en/developer/articles/release-notes/oneapi-supported-product-versions.html


Thanks & Regards,

Varsha



0 Kudos
Junru_Zhang
Beginner
1,425 Views

Hi Varsha,

 

Apart from downloading the newest oneAPI toolkit including MKL packages, Is there any other way to ensure my program to successfully link static library files? 

0 Kudos
VarshaS_Intel
Moderator
1,388 Views

Hi,

 

It would be great if you could provide us with the sample reproducer code and CMakeLists.txt to investigate more from our end. Also, for static linking, you can use Intel Link Line Advisor

For more details regarding linking with Intel Architecture, please find the below link:

https://www.intel.com/content/www/us/en/docs/onemkl/developer-guide-windows/2023-2/linking-on-intel-r-64-architecture-systems.html

 

Thanks & Regards,

Varsha

 

 

 

0 Kudos
VarshaS_Intel
Moderator
1,342 Views

Hi,


We have not heard back from you. Could you please provide us with an update on your issue?


Thanks & Regards,

Varsha


0 Kudos
VarshaS_Intel
Moderator
1,289 Views

Hi,


We have not heard back from you. Could you please provide us with an update on your issue?


Thanks & Regards,

Varsha


0 Kudos
Reply