[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 01:57:35 PST 2026


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

Fixes https://github.com/llvm/llvm-project/issues/183884

>From 4c5bc79774ca8873ebb15c5a83174cc05ff85d9e 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] [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 26f472c6073ea..1cbc465613cfd 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}>"



More information about the Openmp-commits mailing list