Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/external-usage-example/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <iostream>
#include <pcms/utility/print.h>

#include <pcms/create_field.h>
#include <pcms/capi/interpolator.h>
int main()
{
std::cout << "Testing PCMS dependency export..." << std::endl;
Expand Down
29 changes: 21 additions & 8 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,28 @@ set(
pcms/field_communicator.h
pcms/field_communicator2.h
pcms/field_evaluation_methods.h
pcms/field_layout_communicator.h
pcms/partition.h
pcms/coupler.h
pcms/coordinate_system.h
pcms/field_layout.h
pcms/adapter/point_cloud/point_cloud_layout.h
pcms/adapter/point_cloud/point_cloud.h
pcms/adapter/omega_h/omega_h_field_layout.h
pcms/adapter/omega_h/omega_h_field2.h
)

set(
PCMS_SOURCES
pcms.cpp
pcms/create_field.cpp
pcms/adapter/xgc/xgc_field_adapter.h
pcms/adapter/point_cloud/point_cloud_layout.cpp
pcms/adapter/point_cloud/point_cloud.cpp
pcms/adapter/omega_h/omega_h_field_layout.cpp
pcms/adapter/omega_h/omega_h_field2.cpp
)
set(
ADAPTER_HEADERS
pcms/adapter/point_cloud/point_cloud_layout.h
pcms/adapter/point_cloud/point_cloud.h
pcms/adapter/omega_h/omega_h_field_layout.h
pcms/adapter/omega_h/omega_h_field2.h
pcms/adapter/xgc/xgc_field_adapter.h
)

Expand All @@ -39,10 +42,9 @@ list(APPEND PCMS_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/pcms/version.h ${CMAKE_CURR

add_subdirectory(pcms/utility)


if(PCMS_ENABLE_XGC)
list(APPEND PCMS_SOURCES pcms/adapter/xgc/xgc_reverse_classification.cpp)
list(APPEND PCMS_HEADERS pcms/adapter/xgc/xgc_reverse_classification.h)
list(APPEND ADAPTER_HEADERS pcms/adapter/xgc/xgc_reverse_classification.h)
endif()
if(PCMS_ENABLE_OMEGA_H)
list(APPEND PCMS_SOURCES
Expand All @@ -53,11 +55,13 @@ if(PCMS_ENABLE_OMEGA_H)
list(
APPEND
PCMS_HEADERS
pcms/adapter/omega_h/omega_h_field.h
pcms/transfer_field.h
pcms/transfer_field2.h
pcms/uniform_grid.h
pcms/point_search.h
)
list(APPEND ADAPTER_HEADERS
pcms/adapter/omega_h/omega_h_field.h
pcms/adapter/uniform_grid/uniform_grid_field_layout.h
pcms/adapter/uniform_grid/uniform_grid_field.h
)
Expand Down Expand Up @@ -96,6 +100,11 @@ target_include_directories(
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
target_sources(pcms_core PUBLIC
FILE_SET adapters
TYPE HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/pcms
FILES ${ADAPTER_HEADERS})
install(
TARGETS pcms_core
EXPORT pcms_core-targets
Expand All @@ -105,6 +114,7 @@ install(
INCLUDES
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms
FILE_SET adapters DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms
)

configure_package_config_file(
Expand Down Expand Up @@ -158,7 +168,10 @@ install(
INCLUDES
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms
FILE_SET adapters DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms
)


# install external headers
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/pcms/external/
Expand Down
25 changes: 17 additions & 8 deletions src/pcms/capi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,32 @@ target_include_directories(
set(CAPI_CORE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/client.h
${CMAKE_CURRENT_SOURCE_DIR}/kokkos.h)
set_target_properties(
pcms_capi_core PROPERTIES PUBLIC_HEADER "${CAPI_CORE_HEADERS}" OUTPUT_NAME pcmscapicore
pcms_capi_core PROPERTIES OUTPUT_NAME pcmscapicore
EXPORT_NAME capi::core)

target_sources(pcms_capi_core PUBLIC
FILE_SET core
TYPE HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/..
FILES ${CAPI_CORE_HEADERS})
add_library(pcms_capi_interpolator mesh.cpp interpolator.cpp kokkos.cpp)
add_library(pcms::capi::interpolator ALIAS pcms_capi_interpolator)
target_link_libraries(pcms_capi_interpolator PUBLIC MPI::MPI_C PRIVATE pcms::interpolator)
target_include_directories(pcms_capi_interpolator
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../..>" # this makes the module path cpms/capi
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../..>" # this makes the module path pcms/capi
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/pcms/capi>")

set(CAPI_INTERPOLATOR_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/interpolator.h
${CMAKE_CURRENT_SOURCE_DIR}/mesh.h)

set_target_properties(pcms_capi_interpolator
PROPERTIES PUBLIC_HEADERS "${CAPI_INTERPOLATOR_HEADERS}"
OUTPUT_NAME pcmscapiinterpolator
PROPERTIES OUTPUT_NAME pcmscapiinterpolator
EXPORT_NAME capi::interpolator)

target_sources(pcms_capi_interpolator PUBLIC
FILE_SET interpolator
TYPE HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/..
FILES ${CAPI_INTERPOLATOR_HEADERS})
# high level interface target
add_library(pcms_capi INTERFACE)
add_library(pcms::capi ALIAS pcms_capi)
Expand Down Expand Up @@ -63,7 +72,7 @@ install(
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms/capi/)
FILE_SET core DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms)
install(
EXPORT pcms_capi_core-targets
NAMESPACE pcms::
Expand All @@ -77,7 +86,7 @@ install(
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms/capi/)
FILE_SET interpolator DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms)
install(
EXPORT pcms_capi_interpolator-targets
NAMESPACE pcms::
Expand Down
15 changes: 9 additions & 6 deletions src/pcms/interpolator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,18 @@ set(PCMS_FIELD_TRANSFER_HEADERS

set(PCMS_FIELD_TRANSFER_SOURCES
mls_interpolation.cpp
interpolation_base.cpp)
install(FILES ${PCMS_FIELD_TRANSFER_HEADERS}
DESTINATION include/pcms/interpolator)

interpolation_base.cpp
)

add_library(pcms_interpolator ${PCMS_FIELD_TRANSFER_SOURCES})
set_target_properties(pcms_interpolator PROPERTIES
OUTPUT_NAME pcmsinterpolator
EXPORT_NAME interpolator)
target_sources(pcms_interpolator PUBLIC
FILE_SET transformer
TYPE HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/..
FILES ${PCMS_FIELD_TRANSFER_HEADERS})
add_library(pcms::interpolator ALIAS pcms_interpolator)
target_compile_features(pcms_interpolator PUBLIC cxx_std_17)

Expand All @@ -39,8 +42,8 @@ target_include_directories(pcms_interpolator INTERFACE
install(
TARGETS pcms_interpolator
EXPORT pcms_interpolator-targets
INCLUDES
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms/interpolator
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms/interpolator
FILE_SET transformer DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})


Expand Down
9 changes: 6 additions & 3 deletions src/pcms/utility/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ if (PCMS_ENABLE_SPDLOG)
endif ()

## export the library
set_target_properties(pcms_utility PROPERTIES PUBLIC_HEADER "${PCMS_UTILITY_HEADERS}")

target_sources(pcms_utility PUBLIC
FILE_SET utilities
TYPE HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../
FILES ${PCMS_UTILITY_HEADERS})
install(
TARGETS pcms_utility
EXPORT pcms_utility-targets
Expand All @@ -49,7 +52,7 @@ install(
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms/utility
FILE_SET utilities DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms
)

install(
Expand Down