[Openmp-commits] [openmp] [libomp] Fix hwloc include for non-standard paths (PR #184087)

Robert Imschweiler via Openmp-commits openmp-commits at lists.llvm.org
Mon Mar 2 07:15:14 PST 2026


https://github.com/ro-i updated https://github.com/llvm/llvm-project/pull/184087

>From dd3313c69c67367aa7180da642a454ad0803adae Mon Sep 17 00:00:00 2001
From: Robert Imschweiler <robert.imschweiler at amd.com>
Date: Mon, 2 Mar 2026 03:54:23 -0600
Subject: [PATCH 1/2] [libomp] Fix hwloc include for non-standard paths

Fixes https://github.com/llvm/llvm-project/issues/183884
---
 openmp/runtime/src/CMakeLists.txt | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
index 3cbb2543369bd..13cd17d069191 100644
--- a/openmp/runtime/src/CMakeLists.txt
+++ b/openmp/runtime/src/CMakeLists.txt
@@ -189,6 +189,14 @@ else()
   set(LIBOMP_LINKER_LANGUAGE CXX)
 endif()
 if(LIBOMP_USE_HWLOC)
+  target_include_directories(obj.omp
+                             PUBLIC
+			     "$<BUILD_INTERFACE:${LIBOMP_HWLOC_INCLUDE_DIR}>"
+			     "$<INSTALL_INTERFACE:${LIBOMP_HWLOC_INCLUDE_DIR}>"
+  )
+  # omp itself uses obj.omp and thus doesn't need to include hwloc headers
+  # itself. However, we want to propagate the include to consumers of omp (e.g.
+  # libompd).
   target_include_directories(omp
                              PUBLIC
 			     "$<BUILD_INTERFACE:${LIBOMP_HWLOC_INCLUDE_DIR}>"

>From 4a13e1878dbb4af43a62873309eacf730449808a Mon Sep 17 00:00:00 2001
From: Robert Imschweiler <robert.imschweiler at amd.com>
Date: Mon, 2 Mar 2026 09:10:54 -0600
Subject: [PATCH 2/2] implement feedback

Co-authored-by: Michael Kruse <llvm-project at meinersbur.de>
---
 openmp/runtime/src/CMakeLists.txt | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
index 13cd17d069191..b8f513d64ee08 100644
--- a/openmp/runtime/src/CMakeLists.txt
+++ b/openmp/runtime/src/CMakeLists.txt
@@ -189,19 +189,17 @@ else()
   set(LIBOMP_LINKER_LANGUAGE CXX)
 endif()
 if(LIBOMP_USE_HWLOC)
+  # Since we are using an object, the PRIVATE and INTERFACE options are split
+  # (instead of using PUBLIC): obj.omp for compiling itself, omp for propagating
+  # the options to other libraries that depend on it, e.g. libompd.
   target_include_directories(obj.omp
-                             PUBLIC
-			     "$<BUILD_INTERFACE:${LIBOMP_HWLOC_INCLUDE_DIR}>"
-			     "$<INSTALL_INTERFACE:${LIBOMP_HWLOC_INCLUDE_DIR}>"
-  )
-  # omp itself uses obj.omp and thus doesn't need to include hwloc headers
-  # itself. However, we want to propagate the include to consumers of omp (e.g.
-  # libompd).
+    PRIVATE
+    "$<BUILD_INTERFACE:${LIBOMP_HWLOC_INCLUDE_DIR}>"
+    "$<INSTALL_INTERFACE:${LIBOMP_HWLOC_INCLUDE_DIR}>")
   target_include_directories(omp
-                             PUBLIC
-			     "$<BUILD_INTERFACE:${LIBOMP_HWLOC_INCLUDE_DIR}>"
-			     "$<INSTALL_INTERFACE:${LIBOMP_HWLOC_INCLUDE_DIR}>"
-  )
+    INTERFACE
+    "$<BUILD_INTERFACE:${LIBOMP_HWLOC_INCLUDE_DIR}>"
+    "$<INSTALL_INTERFACE:${LIBOMP_HWLOC_INCLUDE_DIR}>")
 endif()
 
 if(OPENMP_MSVC_NAME_SCHEME)



More information about the Openmp-commits mailing list