Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CMake][DFT] target_link_library(myTarget PRIVATE MKL::onemkl_dft_XXX) does not add includes #442

Open
hjabird opened this issue Jan 26, 2024 · 0 comments

Comments

@hjabird
Copy link
Contributor

hjabird commented Jan 26, 2024

Summary

The oneMKL interface library supports linking the the DFT backends (to allow for compile-time dispatch) instead of linking to the main library itself and using the dynamic dispatch mechanism. There are examples of using oneMKL in this way in the examples.

However, the CMake in the examples does is not representative of oneMKL usage after installation.

Observed behavior

Using the example of the MKLGPU backend, I'd expect to the following:

        target_link_libraries(libgromacs PRIVATE MKL::onemkl_dft_mklgpu)

to also include the MKL header files. e.g. I'd expect to able to #include <oneapi/mkl/dft.hpp>. However, without additional cmake, this header is not available.

Expected behavior

I think the DFT backends targets should include the relevent headers as part of their interface.

Version

Report oneMKL version: develop tip: f5dc527

Environment

DPC++ 2024.0
Ubuntu20

Steps to reproduce

CMake:

cmake_minimum_required(VERSION 3.26)
project(exampleProject)
add_executable(myapp main.cpp)
find_package(oneMKL REQUIRED)
# target_link_libraries(myapp PRIVATE MKL::onemkl)
target_link_libraries(myapp PRIVATE MKL::onemkl_dft_mklgpu)

C++

#include <oneapi/mkl/dft.hpp>
int main(){ return 0; }

Gives:

FAILED: CMakeFiles/myapp.dir/main.cpp.o
/opt/intel/oneapi/compiler/2024.0/bin/icpx   -fsycl -MD -MT CMakeFiles/myapp.dir/main.cpp.o -MF CMakeFiles/myapp.dir/main.cpp.o.d -o CMakeFiles/myapp.dir/main.cpp.o -c /home/hugh/tmp/example/main.cpp
/home/hugh/tmp/example/main.cpp:1:10: fatal error: 'oneapi/mkl/dft.hpp' file not found
    1 | #include <oneapi/mkl/dft.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~
1 error generated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant