NVIDIA / MatX

An efficient C++17 GPU numerical computing library with Python-like syntax

Home Page:https://nvidia.github.io/MatX

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] INTERFACE_INCLUDE_DIRECTORIES

siegLoesch opened this issue · comments

I started to get known to via starting to follow the tutorial: 01_introduction.ipynb. For configuration an build a cmake file:
CMakeLists.txt.
Generating the project yields to an error saying that target matx::matx has an INTERFACE_INCLUDE_DIRECTORy which is not present. Namely: "include/kernels".
This is added to the installationvia the copy command top CMakeLists.txt file at line 226 [install(DIRECTORY include/ DESTINATION include)] and implemented as part of the INTERFACE_INCLUDE_DIRECTORIES via the comman <target_include_directories> at lines 91 and 92 [target_include_directories(matx INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/kernels>" "$<INSTALL_INTERFACE:include/kernels>")].
Inside the source tree of Matx the kernels are inside "include/matx/kernels" and NOT at "include/kernels". To workaround for now I modiefied the command "target_include_directories(..." as follows:
target_include_directories(matx
INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/matx/kernels>"
"$<INSTALL_INTERFACE:include/matx/kernels>"
)

I am using (should be irrelevant here):
cmake version 3.26.3
Debian bookworm
NVIDIA GeForce RTX 2060

Please counter check my findings and let me know if am wrong.

Best regards
Siegfried

Hi @siegLoesch, this should be fixed in #416 . Can you see if it addresses your concerns?

Hi Cliff,
It does perfectly fine. I applied your patch to unmodified sources without error:
Applying patch file: $HOME/installOpt/gpu/MatXPatches/416.patch
patching file CMakeLists.txt
patching file bench/CMakeLists.txt
patching file docs_input/notebooks/exercises/compile_and_run.sh
patching file examples/CMakeLists.txt
patching file test/CMakeLists.txt

The configure and build was done without error. The check of matx-targets.conf showed correct INTERFACE_INCLUDE_DIRECTORIES and a simple example (matx::permute) using cmake as build system with find_package(matx CONFIG REQUIRED) succeded to configure and build. The executable yields expected results.

Thanks a lot and best regards
Siegfried