-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from E3SM-Project/configure-with-cmake
Configure with CMake.
- Loading branch information
Showing
18 changed files
with
210 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
cmake_minimum_required (VERSION 3.5) | ||
|
||
project (compose CXX) | ||
set (CMAKE_CXX_STANDARD 11) | ||
|
||
function (prc var) | ||
message ("${var}: ${${var}}") | ||
endfunction () | ||
|
||
find_package (MPI REQUIRED) | ||
|
||
if (Kokkos_DIR) | ||
include (${Kokkos_DIR}/kokkos.cmake) | ||
set (Kokkos_INCLUDE ${Kokkos_DIR}/include) | ||
else () | ||
message (FATAL_ERROR "COMPOSE requires Kokkos_DIR") | ||
endif () | ||
|
||
set (SOURCES | ||
cedr/cedr_caas.cpp | ||
cedr/cedr_local.cpp | ||
cedr/cedr_mpi.cpp | ||
cedr/cedr_qlt.cpp | ||
cedr/cedr_test.cpp | ||
cedr/cedr_test_1d_transport.cpp | ||
cedr/cedr_test_randomized.cpp | ||
cedr/cedr_util.cpp) | ||
|
||
set (HEADERS | ||
cedr/cedr.hpp | ||
cedr/cedr_caas.hpp | ||
cedr/cedr_caas_inl.hpp | ||
cedr/cedr_cdr.hpp | ||
cedr/cedr_kokkos.hpp | ||
cedr/cedr_local.hpp | ||
cedr/cedr_local_inl.hpp | ||
cedr/cedr_mpi.hpp | ||
cedr/cedr_mpi_inl.hpp | ||
cedr/cedr_qlt.hpp | ||
cedr/cedr_qlt_inl.hpp | ||
cedr/cedr_test.hpp | ||
cedr/cedr_test_randomized.hpp | ||
cedr/cedr_util.hpp | ||
siqk/siqk.hpp | ||
siqk/siqk_defs.hpp | ||
siqk/siqk_geometry.hpp | ||
siqk/siqk_intersect.hpp | ||
siqk/siqk_quadrature.hpp | ||
siqk/siqk_search.hpp | ||
siqk/siqk_sqr.hpp) | ||
|
||
if (NOT COMPOSE_TEST_MPIRUN) | ||
set (COMPOSE_TEST_MPIRUN mpirun) | ||
endif () | ||
if (NOT COMPOSE_TEST_NRANK) | ||
set (COMPOSE_TEST_NRANK 8) | ||
endif () | ||
|
||
set (COMPOSE_COMPILE_FLAGS "${MPI_COMPILE_FLAGS} ${KOKKOS_CXXFLAGS} ${CMAKE_CXX_FLAGS}") | ||
set (COMPOSE_LINK_FLAGS "${MPI_LINK_FLAGS} ${KOKKOS_LDFLAGS}") | ||
set (COMPOSE_INCLUDES "${Kokkos_INCLUDE}") | ||
set (COMPOSE_LIBRARIES ${MPI_LIBRARIES} ${KOKKOS_LIBS}) | ||
|
||
prc(MPI_COMPILE_FLAGS) | ||
prc(MPI_LINK_FLAGS) | ||
prc(MPI_LIBRARIES) | ||
add_library (${PROJECT_NAME} ${SOURCES}) | ||
set_target_properties (${PROJECT_NAME} PROPERTIES | ||
COMPILE_FLAGS ${COMPOSE_COMPILE_FLAGS} | ||
LINK_FLAGS ${COMPOSE_LINK_FLAGS}) | ||
target_include_directories (${PROJECT_NAME} PUBLIC cedr siqk) | ||
target_include_directories (${PROJECT_NAME} PRIVATE siqk cedr) | ||
target_include_directories (${PROJECT_NAME} PUBLIC ${COMPOSE_INCLUDES}) | ||
target_link_libraries (${PROJECT_NAME} ${COMPOSE_LIBRARIES}) | ||
|
||
install (TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION lib) | ||
install (FILES ${HEADERS} DESTINATION include/compose) | ||
|
||
enable_testing () | ||
add_subdirectory(siqk) | ||
add_subdirectory(cedr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,22 @@ | ||
# COMPOSE | ||
Compact Multi-moment Performance-Portable Semi-Lagrangian methods for non-hydrostatic dynamics | ||
Compact Multi-moment Performance-Portable Semi-Lagrangian methods | ||
|
||
COMPOSE provides libraries for semi-Lagrangian transport and, together or | ||
separately, property preservation. | ||
|
||
CEDR: Communication-Efficient Constrained Density Reconstructors. | ||
SIQK: Sphereical Polygon Intersection and Quadrature. | ||
|
||
First, install Kokkos: | ||
https://github.com/kokkos/kokkos | ||
For example, in a typical environment using OpenMP, a simple build line is: | ||
./kokkos/generate_makefile.bash --with-serial --with-openmp --prefix=/path/to/my/libs --compiler=g++ | ||
make -j8 install | ||
|
||
Second, configure, build, and test COMPOSE: | ||
cmake \ | ||
-D Kokkos_DIR=/path/to/my/kokkos/install \ | ||
-D CMAKE_INSTALL_PREFIX=/path/to/my/compose/install \ | ||
/path/to/compose/repo | ||
make -j8 | ||
ctest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
add_executable (cedr_test cedr_test.cpp) | ||
set_target_properties (cedr_test PROPERTIES | ||
COMPILE_FLAGS ${COMPOSE_COMPILE_FLAGS} | ||
LINK_FLAGS ${COMPOSE_LINK_FLAGS}) | ||
|
||
target_include_directories (cedr_test PRIVATE ${COMPOSE_INCLUDES}) | ||
target_link_libraries (cedr_test ${PROJECT_NAME} ${COMPOSE_LIBRARIES}) | ||
|
||
add_test (NAME cedr-test-unit | ||
COMMAND $<TARGET_FILE:cedr_test> -t) | ||
add_test (NAME cedr-test-unit-mpi | ||
COMMAND ${COMPOSE_TEST_MPIRUN} -np ${COMPOSE_TEST_NRANK} | ||
$<TARGET_FILE:cedr_test> -t --proc-random -nc 111 -nt 11) | ||
add_test (NAME cedr-test-t1d | ||
COMMAND $<TARGET_FILE:cedr_test> -t -t1d -nc 111) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
add_executable (siqk_test siqk_test.cpp) | ||
set_target_properties (siqk_test PROPERTIES | ||
COMPILE_FLAGS ${COMPOSE_COMPILE_FLAGS} | ||
LINK_FLAGS ${COMPOSE_LINK_FLAGS}) | ||
target_include_directories (siqk_test PRIVATE ${COMPOSE_INCLUDES}) | ||
target_link_libraries (siqk_test ${COMPOSE_LIBRARIES}) | ||
|
||
configure_file (siqk_runtests.py siqk_runtests.py) | ||
|
||
add_test (NAME siqk-test-area | ||
COMMAND python siqk_runtests.py $<TARGET_FILE:siqk_test> 0) | ||
add_test (NAME siqk-test-cube | ||
COMMAND python siqk_runtests.py $<TARGET_FILE:siqk_test> 1) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.