- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Consider the following contents of two files in the same directory:
- `CMakeLists.txt`:
cmake_minimum_required(VERSION 3.12)
project(test Fortran)
set(MKL_ARCH "intel64")
set(MKL_LINK "dynamic")
set(MKL_THREADING "sequential")
set(MKL_INTERFACE "lp64")
set(MKL_MPI "intelmpi")
find_package(MKL)
add_executable(test test.f90)
target_link_libraries(test ${MKL_LIBRARIES})
- `test.f90`:
program p
real sdot
print*,sdot(1,[1.],1,[1.],1)
end
An attempt to compile the program with the following commands in the same directory
mkdir build
cd build
FC=mpiifx cmake ..
cmake --build .
results in an error `undefined reference to `sdot_'`.
It only happens with the newest MKL version 2024.2. The older MKL version 2024.1 works properly. Did something important change in the `MKLConfig.cmake` file? Am I missing something in the `CMakeLists.txt` file?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
From oneMKL 2024.2, we recommend users use MKL::MKL instead of MKL_LIBRARIES in target_link_libraries(test MKL::MKL)
Please use MKL::MKL target. You can also find an example in the oneMKL CMake documentation page.
Regards,
Ruqiu
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello V-G,
Thank you for contacting us. We have been able to reproduce the issue and are investigating further. We will update this post once there are any improvements.
Regards,
Ruqiu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
From oneMKL 2024.2, we recommend users use MKL::MKL instead of MKL_LIBRARIES in target_link_libraries(test MKL::MKL)
Please use MKL::MKL target. You can also find an example in the oneMKL CMake documentation page.
Regards,
Ruqiu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much! That solves the issue.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page