From e73b8274b776c3648e9ba78fe6953527c7da9df2 Mon Sep 17 00:00:00 2001 From: Carl Pearson Date: Mon, 15 Jul 2024 09:50:38 -0600 Subject: [PATCH 1/2] Make build and install include hierarchy match --- CMakeLists.txt | 8 ++++++-- perf_tests/test_main.cpp | 2 +- perf_tests/test_utils.hpp | 2 +- src/CMakeLists.txt | 7 +------ src/KokkosComm.hpp | 14 +++++++------- src/KokkosComm_collective.hpp | 8 ++++---- src/KokkosComm_pack_traits.hpp | 4 ++-- src/KokkosComm_request.hpp | 2 +- src/KokkosComm_traits.hpp | 2 +- unit_tests/test_isendirecv.cpp | 2 +- unit_tests/test_main.cpp | 2 +- 11 files changed, 26 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a08fea8e..b5ef9c82 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,8 +27,6 @@ message(STATUS "Kokkos Comm: MPI_CXX_LIBRARIES = ${MPI_CXX_LIBRARIES}" include(cmake/flags.cmake) add_subdirectory(src) kokkoscomm_add_cxx_flags(TARGET KokkosComm INTERFACE) -message(STATUS ${KOKKOSCOMM_PUBLIC_HEADERS}) -set_target_properties(KokkosComm PROPERTIES PUBLIC_HEADER "${KOKKOSCOMM_PUBLIC_HEADERS}") ## Version config file set(KOKKOSCOMM_VERSION_MAJOR ${CMAKE_PROJECT_VERSION_MAJOR} CACHE STRING "" FORCE) @@ -75,6 +73,12 @@ install( ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +# install the include tree +install( + DIRECTORY "src/" + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING PATTERN "*.hpp") +# install the configured files install( DIRECTORY "${PROJECT_BINARY_DIR}/src/" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} diff --git a/perf_tests/test_main.cpp b/perf_tests/test_main.cpp index e69f617e..cbfc7d2a 100644 --- a/perf_tests/test_main.cpp +++ b/perf_tests/test_main.cpp @@ -14,7 +14,7 @@ // //@HEADER -#include "KokkosComm_include_mpi.hpp" +#include "impl/KokkosComm_include_mpi.hpp" #include #include diff --git a/perf_tests/test_utils.hpp b/perf_tests/test_utils.hpp index 00e1061c..1f3dddd9 100644 --- a/perf_tests/test_utils.hpp +++ b/perf_tests/test_utils.hpp @@ -20,7 +20,7 @@ #include -#include "KokkosComm_include_mpi.hpp" +#include "impl/KokkosComm_include_mpi.hpp" // F is a function that takes (state, MPI_Comm, args...) template diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ea088ba1..46d64cb6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,13 +4,8 @@ add_library(KokkosComm::KokkosComm ALIAS KokkosComm) target_include_directories(KokkosComm INTERFACE $ ) -target_include_directories(KokkosComm INTERFACE - $ -) + target_include_directories(KokkosComm INTERFACE $ ) target_link_libraries(KokkosComm INTERFACE MPI::MPI_CXX Kokkos::kokkos) - -file(GLOB_RECURSE KOKKOSCOMM_PUBLIC_HEADERS ${CMAKE_CURRENT_LIST_DIR}/*.hpp) -set(KOKKOSCOMM_PUBLIC_HEADERS ${KOKKOSCOMM_PUBLIC_HEADERS} PARENT_SCOPE) diff --git a/src/KokkosComm.hpp b/src/KokkosComm.hpp index 28e2fa4c..15c1b7e1 100644 --- a/src/KokkosComm.hpp +++ b/src/KokkosComm.hpp @@ -18,13 +18,13 @@ #include "KokkosComm_config.hpp" #include "KokkosComm_collective.hpp" -#include "KokkosComm_isend.hpp" -#include "KokkosComm_irecv.hpp" -#include "KokkosComm_recv.hpp" -#include "KokkosComm_send.hpp" -#include "KokkosComm_alltoall.hpp" -#include "KokkosComm_barrier.hpp" -#include "KokkosComm_concepts.hpp" +#include "impl/KokkosComm_isend.hpp" +#include "impl/KokkosComm_irecv.hpp" +#include "impl/KokkosComm_recv.hpp" +#include "impl/KokkosComm_send.hpp" +#include "impl/KokkosComm_alltoall.hpp" +#include "impl/KokkosComm_barrier.hpp" +#include "impl/KokkosComm_concepts.hpp" #include "KokkosComm_comm_modes.hpp" #include diff --git a/src/KokkosComm_collective.hpp b/src/KokkosComm_collective.hpp index e9af5ee3..a99ca83e 100644 --- a/src/KokkosComm_collective.hpp +++ b/src/KokkosComm_collective.hpp @@ -18,10 +18,10 @@ #include -#include "KokkosComm_concepts.hpp" -#include "KokkosComm_alltoall.hpp" -#include "KokkosComm_reduce.hpp" -#include "KokkosComm_allgather.hpp" +#include "impl/KokkosComm_concepts.hpp" +#include "impl/KokkosComm_alltoall.hpp" +#include "impl/KokkosComm_reduce.hpp" +#include "impl/KokkosComm_allgather.hpp" namespace KokkosComm { diff --git a/src/KokkosComm_pack_traits.hpp b/src/KokkosComm_pack_traits.hpp index fa993dd6..39a74eac 100644 --- a/src/KokkosComm_pack_traits.hpp +++ b/src/KokkosComm_pack_traits.hpp @@ -18,8 +18,8 @@ #include "KokkosComm_traits.hpp" -#include "KokkosComm_concepts.hpp" -#include "KokkosComm_packer.hpp" +#include "impl/KokkosComm_concepts.hpp" +#include "impl/KokkosComm_packer.hpp" /*! \brief Defines a common interface for packing and unpacking Kokkos::View-like types \file KokkosComm_traits.hpp diff --git a/src/KokkosComm_request.hpp b/src/KokkosComm_request.hpp index 98629e02..1e3d57ae 100644 --- a/src/KokkosComm_request.hpp +++ b/src/KokkosComm_request.hpp @@ -19,7 +19,7 @@ #include #include -#include "KokkosComm_include_mpi.hpp" +#include "impl/KokkosComm_include_mpi.hpp" namespace KokkosComm { diff --git a/src/KokkosComm_traits.hpp b/src/KokkosComm_traits.hpp index f7d5a744..d66e6be9 100644 --- a/src/KokkosComm_traits.hpp +++ b/src/KokkosComm_traits.hpp @@ -20,7 +20,7 @@ #pragma once -#include "KokkosComm_concepts.hpp" +#include "impl/KokkosComm_concepts.hpp" #include diff --git a/unit_tests/test_isendirecv.cpp b/unit_tests/test_isendirecv.cpp index 177a25c0..0c0ada4a 100644 --- a/unit_tests/test_isendirecv.cpp +++ b/unit_tests/test_isendirecv.cpp @@ -17,7 +17,7 @@ #include #include "KokkosComm.hpp" -#include "KokkosComm_irecv.hpp" +#include "impl/KokkosComm_irecv.hpp" #include "view_builder.hpp" diff --git a/unit_tests/test_main.cpp b/unit_tests/test_main.cpp index cda38cfe..7e9b0b44 100644 --- a/unit_tests/test_main.cpp +++ b/unit_tests/test_main.cpp @@ -23,7 +23,7 @@ #include #include -#include "KokkosComm_include_mpi.hpp" +#include "impl/KokkosComm_include_mpi.hpp" class MpiEnvironment : public ::testing::Environment { public: From 4c387e64dc6ca8080cd5982fe8d80f31a7aa6e98 Mon Sep 17 00:00:00 2001 From: Carl Pearson Date: Fri, 12 Jul 2024 09:42:06 -0600 Subject: [PATCH 2/2] improve robustness of install testing procedure --- docs/dev/testing.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/dev/testing.rst b/docs/dev/testing.rst index f0f02ed2..7d8a6783 100644 --- a/docs/dev/testing.rst +++ b/docs/dev/testing.rst @@ -38,9 +38,11 @@ Testing the Install cmake --build "$KOKKOS_BUILD" --parallel $(nproc) -t install echo "==== CFG KOKKOS COMM ====" + rm -rf "$COMM_BUILD" cmake -S "$COMM_SRC" -B "$COMM_BUILD" -DKokkos_ROOT="$KOKKOS_INSTALL" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DKokkosComm_ENABLE_TESTS=OFF -DKokkosComm_ENABLE_PERFTESTS=OFF -DCMAKE_INSTALL_PREFIX="$COMM_INSTALL" echo "==== BUILD & INSTALL KOKKOS COMM ====" + rm -rf "$COMM_INSTALL" VERBOSE=1 cmake --build "$COMM_BUILD" --target install echo "==== REMOVE KOKKOS COMM BUILD FILES ===="