From 63a79892b236fe12909abc70b7b97e83ab9d096d Mon Sep 17 00:00:00 2001 From: Aurelien Bouteiller Date: Wed, 2 Jul 2025 16:51:38 -0400 Subject: [PATCH] rocshmem_config.h has a different include path when installed and built-dir (#186) * rocshmem_config.h needs to be in a similar directory structure for includes to work when building testers in build, and from an installed library * Do not change installed rocshmem.hpp --- CMakeLists.txt | 7 ++++--- src/backend_bc.hpp | 2 +- src/backend_type.hpp | 2 +- src/context_device.cpp | 2 +- src/context_host.cpp | 2 +- src/context_tmpl_device.hpp | 2 +- src/context_tmpl_host.hpp | 2 +- src/hdp_policy.hpp | 2 +- src/host/host.cpp | 2 +- src/host/host_templates.hpp | 2 +- src/ipc/context_ipc_device.cpp | 2 +- src/ipc/context_ipc_host.cpp | 2 +- src/ipc/context_ipc_tmpl_device.hpp | 2 +- src/ipc/context_ipc_tmpl_host.hpp | 2 +- src/ipc_policy.cpp | 2 +- src/ipc_policy.hpp | 2 +- src/memory/heap_type.hpp | 2 +- src/memory/hip_allocator.hpp | 2 +- src/reverse_offload/context_ro_device.cpp | 2 +- src/reverse_offload/context_ro_host.cpp | 2 +- src/reverse_offload/context_ro_tmpl_device.hpp | 2 +- src/reverse_offload/context_ro_tmpl_host.hpp | 2 +- src/reverse_offload/profiler.hpp | 2 +- src/rocshmem_gpu.cpp | 2 +- src/util.cpp | 2 +- src/util.hpp | 2 +- src/wf_coal_policy.hpp | 2 +- 27 files changed, 30 insertions(+), 29 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b4b5faa9ad..5c95a25c2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -151,7 +151,7 @@ if (NOT BUILD_TESTS_ONLY) set(THREADS_PREFER_PTHREAD_FLAG TRUE) find_package(Threads REQUIRED) - configure_file(cmake/rocshmem_config.h.in rocshmem_config.h) + configure_file(cmake/rocshmem_config.h.in include/rocshmem/rocshmem_config.h) ############################################################################# # LINKING AND INCLUDE DIRECTORIES @@ -167,7 +167,8 @@ if (NOT BUILD_TESTS_ONLY) ${PROJECT_NAME} PUBLIC $ - $ # rocshmem_config.h + $ # rocshmem_config.h + $ # rocshmem_config.h from rocshmem.hpp $ ) @@ -196,7 +197,7 @@ if (NOT BUILD_TESTS_ONLY) ) rocm_install( - FILES "${CMAKE_BINARY_DIR}/rocshmem_config.h" + FILES "${CMAKE_BINARY_DIR}/include/rocshmem/rocshmem_config.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocshmem ) diff --git a/src/backend_bc.hpp b/src/backend_bc.hpp index 149704d5f3..da3972c2ea 100644 --- a/src/backend_bc.hpp +++ b/src/backend_bc.hpp @@ -37,7 +37,7 @@ #include -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) #include "rocshmem/rocshmem.hpp" #include "backend_type.hpp" #include "ipc_policy.hpp" diff --git a/src/backend_type.hpp b/src/backend_type.hpp index a9b5170afe..f7c2046939 100644 --- a/src/backend_type.hpp +++ b/src/backend_type.hpp @@ -36,7 +36,7 @@ * functions are not supported at this time. */ -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) namespace rocshmem { diff --git a/src/context_device.cpp b/src/context_device.cpp index 097f8397eb..459d33b3b9 100644 --- a/src/context_device.cpp +++ b/src/context_device.cpp @@ -22,7 +22,7 @@ * IN THE SOFTWARE. *****************************************************************************/ -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) #include "backend_bc.hpp" #include "context_incl.hpp" #include "util.hpp" diff --git a/src/context_host.cpp b/src/context_host.cpp index 86de93dfb1..7e30d9ec73 100644 --- a/src/context_host.cpp +++ b/src/context_host.cpp @@ -22,7 +22,7 @@ * IN THE SOFTWARE. *****************************************************************************/ -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) #include "backend_bc.hpp" #include "context_incl.hpp" diff --git a/src/context_tmpl_device.hpp b/src/context_tmpl_device.hpp index da262c8192..0fedf3ffd0 100644 --- a/src/context_tmpl_device.hpp +++ b/src/context_tmpl_device.hpp @@ -25,7 +25,7 @@ #ifndef LIBRARY_SRC_CONTEXT_TMPL_DEVICE_HPP_ #define LIBRARY_SRC_CONTEXT_TMPL_DEVICE_HPP_ -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) #include "backend_type.hpp" #ifdef USE_RO #include "reverse_offload/context_ro_device.hpp" diff --git a/src/context_tmpl_host.hpp b/src/context_tmpl_host.hpp index 65173e9cbc..68a572bdaf 100644 --- a/src/context_tmpl_host.hpp +++ b/src/context_tmpl_host.hpp @@ -25,7 +25,7 @@ #ifndef LIBRARY_SRC_CONTEXT_TMPL_HOST_HPP_ #define LIBRARY_SRC_CONTEXT_TMPL_HOST_HPP_ -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) #include "backend_type.hpp" #ifdef USE_RO #include "reverse_offload/context_ro_host.hpp" diff --git a/src/hdp_policy.hpp b/src/hdp_policy.hpp index 1f37e46f47..dd1311765c 100644 --- a/src/hdp_policy.hpp +++ b/src/hdp_policy.hpp @@ -28,7 +28,7 @@ #include #include -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) #include "memory/hip_allocator.hpp" #include "util.hpp" diff --git a/src/host/host.cpp b/src/host/host.cpp index 862eaadb69..87e8f351af 100644 --- a/src/host/host.cpp +++ b/src/host/host.cpp @@ -26,7 +26,7 @@ #include -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) #include "host_helpers.hpp" #include "../memory/window_info.hpp" #include "../util.hpp" diff --git a/src/host/host_templates.hpp b/src/host/host_templates.hpp index f384686406..79c837fa52 100644 --- a/src/host/host_templates.hpp +++ b/src/host/host_templates.hpp @@ -25,7 +25,7 @@ #ifndef LIBRARY_SRC_HOST_HOST_TEMPLATES_HPP_ #define LIBRARY_SRC_HOST_HOST_TEMPLATES_HPP_ -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) #include "host_helpers.hpp" #include "../memory/window_info.hpp" #include "../team.hpp" diff --git a/src/ipc/context_ipc_device.cpp b/src/ipc/context_ipc_device.cpp index e9ff4adf76..02af694071 100644 --- a/src/ipc/context_ipc_device.cpp +++ b/src/ipc/context_ipc_device.cpp @@ -32,7 +32,7 @@ #include #include -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) #include "rocshmem/rocshmem.hpp" #include "backend_ipc.hpp" diff --git a/src/ipc/context_ipc_host.cpp b/src/ipc/context_ipc_host.cpp index b31943a80e..fe2e92b8a7 100644 --- a/src/ipc/context_ipc_host.cpp +++ b/src/ipc/context_ipc_host.cpp @@ -26,7 +26,7 @@ #include -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) #include "../backend_type.hpp" #include "../context_incl.hpp" #include "backend_ipc.hpp" diff --git a/src/ipc/context_ipc_tmpl_device.hpp b/src/ipc/context_ipc_tmpl_device.hpp index fa500b63f6..13094d8091 100644 --- a/src/ipc/context_ipc_tmpl_device.hpp +++ b/src/ipc/context_ipc_tmpl_device.hpp @@ -25,7 +25,7 @@ #ifndef LIBRARY_SRC_IPC_CONTEXT_TMPL_DEVICE_HPP_ #define LIBRARY_SRC_IPC_CONTEXT_TMPL_DEVICE_HPP_ -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) #include "rocshmem/rocshmem.hpp" #include "context_ipc_device.hpp" #include "../util.hpp" diff --git a/src/ipc/context_ipc_tmpl_host.hpp b/src/ipc/context_ipc_tmpl_host.hpp index 9849fe93db..aad55260c4 100644 --- a/src/ipc/context_ipc_tmpl_host.hpp +++ b/src/ipc/context_ipc_tmpl_host.hpp @@ -25,7 +25,7 @@ #ifndef LIBRARY_SRC_IPC_CONTEXT_TMPL_HOST_HPP_ #define LIBRARY_SRC_IPC_CONTEXT_TMPL_HOST_HPP_ -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) #include "../host/host_templates.hpp" namespace rocshmem { diff --git a/src/ipc_policy.cpp b/src/ipc_policy.cpp index 0855f1f09c..0bee8eafb7 100644 --- a/src/ipc_policy.cpp +++ b/src/ipc_policy.cpp @@ -26,7 +26,7 @@ #include -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) #include "backend_bc.hpp" #include "context_incl.hpp" #include "util.hpp" diff --git a/src/ipc_policy.hpp b/src/ipc_policy.hpp index 7973390e40..edf350a9f5 100644 --- a/src/ipc_policy.hpp +++ b/src/ipc_policy.hpp @@ -31,7 +31,7 @@ #include #include -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) #include "memory/hip_allocator.hpp" #include "util.hpp" #include "bootstrap/bootstrap.hpp" diff --git a/src/memory/heap_type.hpp b/src/memory/heap_type.hpp index 0935f60851..f59ee7b835 100644 --- a/src/memory/heap_type.hpp +++ b/src/memory/heap_type.hpp @@ -25,7 +25,7 @@ #ifndef LIBRARY_SRC_MEMORY_HEAP_TYPE_HPP_ #define LIBRARY_SRC_MEMORY_HEAP_TYPE_HPP_ -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) #include "hip_allocator.hpp" /** diff --git a/src/memory/hip_allocator.hpp b/src/memory/hip_allocator.hpp index ae67e2ad8f..aaf65902d9 100644 --- a/src/memory/hip_allocator.hpp +++ b/src/memory/hip_allocator.hpp @@ -31,7 +31,7 @@ * @brief Contains HIP wrapper class for memory allocator */ -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) #include "memory_allocator.hpp" #include diff --git a/src/reverse_offload/context_ro_device.cpp b/src/reverse_offload/context_ro_device.cpp index b38545a368..6c3160a9d3 100644 --- a/src/reverse_offload/context_ro_device.cpp +++ b/src/reverse_offload/context_ro_device.cpp @@ -32,7 +32,7 @@ #include #include -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) #include "rocshmem/rocshmem.hpp" #include "../backend_type.hpp" #include "../hdp_policy.hpp" diff --git a/src/reverse_offload/context_ro_host.cpp b/src/reverse_offload/context_ro_host.cpp index ecf00673eb..49e5cd3940 100644 --- a/src/reverse_offload/context_ro_host.cpp +++ b/src/reverse_offload/context_ro_host.cpp @@ -26,7 +26,7 @@ #include -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) #include "../backend_type.hpp" #include "../context_incl.hpp" #include "../host/host.hpp" diff --git a/src/reverse_offload/context_ro_tmpl_device.hpp b/src/reverse_offload/context_ro_tmpl_device.hpp index aadb3dafdc..16a1b6f857 100644 --- a/src/reverse_offload/context_ro_tmpl_device.hpp +++ b/src/reverse_offload/context_ro_tmpl_device.hpp @@ -25,7 +25,7 @@ #ifndef LIBRARY_SRC_REVERSE_OFFLOAD_RO_NET_GPU_TEMPLATES_HPP_ #define LIBRARY_SRC_REVERSE_OFFLOAD_RO_NET_GPU_TEMPLATES_HPP_ -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) #include "commands_types.hpp" #include "context_ro_device.hpp" #include "queue_proxy.hpp" diff --git a/src/reverse_offload/context_ro_tmpl_host.hpp b/src/reverse_offload/context_ro_tmpl_host.hpp index 9be2073eec..02dc788263 100644 --- a/src/reverse_offload/context_ro_tmpl_host.hpp +++ b/src/reverse_offload/context_ro_tmpl_host.hpp @@ -25,7 +25,7 @@ #ifndef LIBRARY_SRC_REVERSE_OFFLOAD_RO_NET_HOST_TEMPLATES_HPP_ #define LIBRARY_SRC_REVERSE_OFFLOAD_RO_NET_HOST_TEMPLATES_HPP_ -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) #include "../host/host_templates.hpp" namespace rocshmem { diff --git a/src/reverse_offload/profiler.hpp b/src/reverse_offload/profiler.hpp index 9f46a8e48c..cd043e1eba 100644 --- a/src/reverse_offload/profiler.hpp +++ b/src/reverse_offload/profiler.hpp @@ -28,7 +28,7 @@ #include #include -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) #include "../device_proxy.hpp" #include "../memory/../memory/hip_allocator.hpp" #include "../stats.hpp" diff --git a/src/rocshmem_gpu.cpp b/src/rocshmem_gpu.cpp index a064952f9f..e2571c62b6 100644 --- a/src/rocshmem_gpu.cpp +++ b/src/rocshmem_gpu.cpp @@ -43,7 +43,7 @@ #include -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) #include "rocshmem/rocshmem.hpp" #include "backend_bc.hpp" #include "context_incl.hpp" diff --git a/src/util.cpp b/src/util.cpp index 8c48870557..255986eb7b 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -28,7 +28,7 @@ #include #include -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) namespace rocshmem { diff --git a/src/util.hpp b/src/util.hpp index d46d2609b6..c3d059edf9 100644 --- a/src/util.hpp +++ b/src/util.hpp @@ -32,7 +32,7 @@ #include #include "assembly.hpp" -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) #include "constants.hpp" namespace rocshmem { diff --git a/src/wf_coal_policy.hpp b/src/wf_coal_policy.hpp index a392fda7dd..2f255ba2f6 100644 --- a/src/wf_coal_policy.hpp +++ b/src/wf_coal_policy.hpp @@ -27,7 +27,7 @@ #include -#include "rocshmem_config.h" // NOLINT(build/include_subdir) +#include "rocshmem/rocshmem_config.h" // NOLINT(build/include_subdir) #include "util.hpp" namespace rocshmem {