-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Jean-Noël Grad <[email protected]>
- Loading branch information
1 parent
1c07aa0
commit 0e6569b
Showing
7 changed files
with
198 additions
and
0 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- a/kdpart.h | ||
+++ b/kdpart.h | ||
@@ -140,7 +140,7 @@ struct NodeAccess { | ||
std::abort(); | ||
} | ||
|
||
- assert(false); | ||
+ throw std::logic_error("[libkdpart] Fatal exception in local repartitioning."); | ||
} | ||
|
||
inline NodeAccess find_root_of_subtree(int depth) const | ||
--- a/Makefile | ||
+++ b/Makefile | ||
@@ -5,5 +5,6 @@ | ||
CXX = mpic++ | ||
CXXFLAGS = -std=c++14 -O3 -march=native | ||
+# flag -Wno-cast-function-type needed for GCC, see https://github.com/open-mpi/ompi/issues/5157 | ||
-CXXFLAGS += -Wall -Wextra -pedantic | ||
+CXXFLAGS += -Wall -Wextra -pedantic -Wno-cast-function-type | ||
|
||
AR = ar |
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,105 @@ | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -30,8 +30,8 @@ option(WITH_P4EST "Build with SFC LB support" ON) | ||
option(WITH_PARMETIS "Build with graph partitioning LB support" ON) | ||
option(WITH_KDPART "Build with kd grid support" ON) | ||
|
||
-option(WITH_TESTS "Perform unit tests" ON) | ||
-option(WITH_COVERAGE "Coverage for tests" OFF) | ||
+option(LIBREPA_WITH_TESTS "Perform unit tests" ON) | ||
+option(LIBREPA_WITH_COVERAGE "Coverage for tests" OFF) | ||
|
||
if(WITH_KDPART) | ||
find_package(KDPart REQUIRED) | ||
@@ -49,15 +49,11 @@ find_package(MPI REQUIRED) | ||
include_directories(SYSTEM ${MPI_CXX_INCLUDE_PATH}) | ||
|
||
list(APPEND REQ_BOOST_PACKAGES mpi serialization) | ||
-if(WITH_TESTS) | ||
+if(LIBREPA_WITH_TESTS) | ||
list(APPEND REQ_BOOST_PACKAGES unit_test_framework) | ||
-endif(WITH_TESTS) | ||
+endif(LIBREPA_WITH_TESTS) | ||
find_package(Boost "1.67.0" REQUIRED ${REQ_BOOST_PACKAGES}) | ||
|
||
-if (Boost_VERSION VERSION_GREATER_EQUAL "1.69" AND Boost_VERSION VERSION_LESS_EQUAL "1.71") | ||
- message(FATAL_ERROR "Boost 1.69 - 1.71 have a bug and are not supported.") | ||
-endif() | ||
- | ||
include_directories(${Boost_INCLUDE_DIRS}) | ||
|
||
# Used for librepa itself as well as all tests | ||
@@ -77,7 +73,7 @@ set(REPA_DEFAULT_COMPILE_OPTIONS | ||
"-Wno-conversion" | ||
"-Wno-sign-conversion" >) | ||
|
||
-if(WITH_TESTS AND WITH_COVERAGE) | ||
+if(LIBREPA_WITH_TESTS AND LIBREPA_WITH_COVERAGE) | ||
if (NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") | ||
message(SEND_ERROR "COVERAGE is only possible with Gnu Compiler Collection.") | ||
else() | ||
@@ -91,21 +87,21 @@ if(WITH_TESTS AND WITH_COVERAGE) | ||
set(CMAKE_EXE_LINKER_FLAGS "--coverage -fprofile-arcs -ftest-coverage") | ||
|
||
add_custom_target(coverage | ||
- COMMAND ${CMAKE_SOURCE_DIR}/util/coverage.sh | ||
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) | ||
+ COMMAND ${PROJECT_SOURCE_DIR}/util/coverage.sh | ||
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) | ||
message(STATUS "Coverage enabled. Use `coverage' target after build to execute coverage tests.") | ||
endif() | ||
endif() | ||
-endif(WITH_TESTS AND WITH_COVERAGE) | ||
+endif(LIBREPA_WITH_TESTS AND LIBREPA_WITH_COVERAGE) | ||
|
||
add_subdirectory(repa) | ||
|
||
-if(WITH_TESTS) | ||
+if(LIBREPA_WITH_TESTS) | ||
set(TEST_MAX_NPROC 4 | ||
CACHE STRING "Maximum number of processes to run the tests with") | ||
enable_testing() | ||
add_subdirectory(tests) | ||
-endif(WITH_TESTS) | ||
+endif(LIBREPA_WITH_TESTS) | ||
|
||
add_subdirectory(examples) | ||
|
||
--- a/repa/CMakeLists.txt | ||
+++ b/repa/CMakeLists.txt | ||
@@ -95,11 +95,5 @@ target_compile_options(repa | ||
PRIVATE ${REPA_DEFAULT_COMPILE_OPTIONS}) | ||
|
||
install(TARGETS repa | ||
- LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib | ||
- ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) | ||
-# Keep folder structure, so no install for all repa_HDR | ||
-foreach(hdr ${repa_HDR}) | ||
- get_filename_component(dir ${hdr} DIRECTORY) | ||
- install(FILES ${hdr} | ||
- DESTINATION ${CMAKE_INSTALL_PREFIX}/include/repa/${dir}) | ||
-endforeach() | ||
+ LIBRARY DESTINATION ${ESPRESSO_INSTALL_LIBDIR} | ||
+ ARCHIVE DESTINATION ${ESPRESSO_INSTALL_LIBDIR}) | ||
--- a/cmake/define_example.cmake | ||
+++ b/cmake/define_example.cmake | ||
@@ -38,7 +38,7 @@ function(define_example) | ||
Boost::serialization) | ||
|
||
target_include_directories(${EXAMPLE_NAME} | ||
- PRIVATE ${CMAKE_SOURCE_DIR}) | ||
+ PRIVATE ${PROJECT_SOURCE_DIR}) | ||
target_compile_options(${EXAMPLE_NAME} | ||
PRIVATE ${REPA_DEFAULT_COMPILE_OPTIONS}) | ||
endfunction(define_example) | ||
--- a/cmake/define_test.cmake | ||
+++ b/cmake/define_test.cmake | ||
@@ -40,7 +40,7 @@ function(define_test) | ||
${TEST_LIBRARIES}) | ||
|
||
target_include_directories(${TEST_NAME} | ||
- PRIVATE ${CMAKE_SOURCE_DIR}) | ||
+ PRIVATE ${PROJECT_SOURCE_DIR}) | ||
target_compile_options(${TEST_NAME} | ||
PRIVATE ${REPA_DEFAULT_COMPILE_OPTIONS}) | ||
|
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