- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, recently I build a project using mkl through make, my simple CMakeLists is like this,
cmake_minimum_required(VERSION 3.14)
project(ex5 Fortran)
enable_language(Fortran)
find_package(MKL REQUIRED)
include_directories(${MKL_INCLUDE})
add_executable(ex5 main.f90)
target_link_libraries(ex5 ${MKL_LIBRARIES})
#target_link_options(ex5 PUBLIC $<LINK_ONLY:MKL::MKL>)
If I use target_link_libraries(ex5 ${MKL_LIBRARIES}), I can successfully build the project, but not for
#target_link_options(ex5 PUBLIC $<LINK_ONLY:MKL::MKL>), which shows this error,
ifort: error #10236: File not found: 'MKL::MKL'
could you help solve this?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thank you for posting in Intel Communities.
We are investigating your issue at our end, Could you please share the mkl version for better understanding.
Thanks,
Jaideep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your response. My mkl version is 2021.4 for Mac os
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for providing the details.
The issue raised by you is reproducible from our end as well.
We are looking into this issue. We will get back to you soon.
Regards,
Vidya.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Meng,
We have tested with oneMKL 2021.4 and confirmed the issue. We have escalated this issue to the MKL team.
We will let you know when we have the solution for this problem.
Best regards
Khang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Meng,
cmake function target_link_options inserts the target as is, target_link_libraries should be used in order to resolve MKL target correctly.
Please refer to CMakeLists.txt from oneMKL Fortran examples for the correct way how to include oneMKL to CMake project for classic Fortran API:
<install_path>/oneapi/mkl/2021.4.0/examples/examples_core_f.tgz/f/CMakeLists.txt:
target_compile_options(${func} PUBLIC ${TEST_COPT} $<TARGET_PROPERTY:MKL::MKL,INTERFACE_COMPILE_OPTIONS>)
target_link_libraries(${func} PUBLIC ${TEST_LOPT} $<LINK_ONLY:MKL::MKL>)
This should fix it.
Khang
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page