Skip to content

Commit

Permalink
Merge pull request kokkos#110 from cwpearson/fix/include-hierarchy
Browse files Browse the repository at this point in the history
Don't flatten include hierarchy on install
  • Loading branch information
cwpearson authored Jul 16, 2024
2 parents d34862d + 4c387e6 commit c6c557c
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 27 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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}
Expand Down
2 changes: 2 additions & 0 deletions docs/dev/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 ===="
Expand Down
2 changes: 1 addition & 1 deletion perf_tests/test_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//
//@HEADER

#include "KokkosComm_include_mpi.hpp"
#include "impl/KokkosComm_include_mpi.hpp"

#include <Kokkos_Core.hpp>
#include <benchmark/benchmark.h>
Expand Down
2 changes: 1 addition & 1 deletion perf_tests/test_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <benchmark/benchmark.h>

#include "KokkosComm_include_mpi.hpp"
#include "impl/KokkosComm_include_mpi.hpp"

// F is a function that takes (state, MPI_Comm, args...)
template <typename F, typename... Args>
Expand Down
7 changes: 1 addition & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ add_library(KokkosComm::KokkosComm ALIAS KokkosComm)
target_include_directories(KokkosComm INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>
)
target_include_directories(KokkosComm INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/impl>
)

target_include_directories(KokkosComm INTERFACE
$<INSTALL_INTERFACE:include>
)
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)
14 changes: 7 additions & 7 deletions src/KokkosComm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Kokkos_Core.hpp>
Expand Down
8 changes: 4 additions & 4 deletions src/KokkosComm_collective.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

#include <Kokkos_Core.hpp>

#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 {

Expand Down
4 changes: 2 additions & 2 deletions src/KokkosComm_pack_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/KokkosComm_request.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <memory>
#include <vector>

#include "KokkosComm_include_mpi.hpp"
#include "impl/KokkosComm_include_mpi.hpp"

namespace KokkosComm {

Expand Down
2 changes: 1 addition & 1 deletion src/KokkosComm_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#pragma once

#include "KokkosComm_concepts.hpp"
#include "impl/KokkosComm_concepts.hpp"

#include <type_traits>

Expand Down
2 changes: 1 addition & 1 deletion unit_tests/test_isendirecv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <gtest/gtest.h>

#include "KokkosComm.hpp"
#include "KokkosComm_irecv.hpp"
#include "impl/KokkosComm_irecv.hpp"

#include "view_builder.hpp"

Expand Down
2 changes: 1 addition & 1 deletion unit_tests/test_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <KokkosComm_config.hpp>
#include <Kokkos_Core.hpp>

#include "KokkosComm_include_mpi.hpp"
#include "impl/KokkosComm_include_mpi.hpp"

class MpiEnvironment : public ::testing::Environment {
public:
Expand Down

0 comments on commit c6c557c

Please sign in to comment.