[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 18:19:49 PDT 2022


bernhardkaindl added a comment.

This is the minimum fix for exporting `${LIBOMP_HWLOC_INSTALL_DIR}/include` thru the `omp` target for import thru `target_link_libraries`.

  --- openmp/runtime/src/CMakeLists.txt
  +++ openmp/runtime/src/CMakeLists.txt
  @@ -46,9 +46,6 @@
     ${LIBOMP_INC_DIR}
     ${LIBOMP_SRC_DIR}/thirdparty/ittnotify
   )
  -if(${LIBOMP_USE_HWLOC})
  -  include_directories(${LIBOMP_HWLOC_INSTALL_DIR}/include)
  -endif()
  
   # Building with time profiling support requires LLVM directory includes.
   if(LIBOMP_PROFILING_SUPPORT)
  @@ -157,6 +154,13 @@
     # libomp must be a C++ library such that it can link libLLVMSupport
     set(LIBOMP_LINKER_LANGUAGE CXX)
   endif()
  +if(${LIBOMP_USE_HWLOC})
  +  target_include_directories(omp
  +                             PUBLIC
  +                             "$<BUILD_INTERFACE:${LIBOMP_HWLOC_INSTALL_DIR}/include>"
  +                             "$<INSTALL_INTERFACE:${LIBOMP_HWLOC_INSTALL_DIR}/include>"
  +  )
  +endif()
  
  
   if(OPENMP_MSVC_NAME_SCHEME)

This modern cmake style is used in the llvm pstl and mlir libraries already.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122667/new/

https://reviews.llvm.org/D122667



More information about the Openmp-commits mailing list