[Openmp-commits] [PATCH] D122667: llvm14 patch: hwloc include directory for libompd
Bernhard Kaindl via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Fri Apr 15 17:41:55 PDT 2022
bernhardkaindl requested changes to this revision.
bernhardkaindl added a comment.
This revision now requires changes to proceed.
@s-sajid-ali Only eplacing add_dependencies(ompd omp) with target_link_libraries(ompd omp) is not enough to fix the include path! I just tested, it fails to build.
The reason is that the hwloc include path is not exported by the library, and thus cannot be picked up by target_link_libraries. Here is the part of the cmake documentation which explains what is needed to make this work:
https://cmake.org/cmake/help/git-stage/guide/importing-exporting/index.html
And then use the target_include_directories() command to specify the include directories for the target:
target_include_directories(MathFunctions
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
In this case, the "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>" part should be enough.
It has to be checked, if the minimum cmake requried by openmp for llvm-14/15 (3.13.4 in the llvm-14 source) supports this method.
This variant should work with old cmake versions as well:
target_include_directories(omp INTERFACE "${HWLOC_INC_PATH}
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D122667/new/
https://reviews.llvm.org/D122667
More information about the Openmp-commits
mailing list