From 2914f59c13018ab41e2b140b265e97757dced9df Mon Sep 17 00:00:00 2001 From: Max Luebke Date: Fri, 21 Jul 2023 12:32:37 +0200 Subject: [PATCH] build: build one poet library --- src/CMakeLists.txt | 16 ++++++++++----- src/ChemistryModule/CMakeLists.txt | 32 ------------------------------ src/DataStructures/CMakeLists.txt | 6 ------ 3 files changed, 11 insertions(+), 43 deletions(-) delete mode 100644 src/ChemistryModule/CMakeLists.txt delete mode 100644 src/DataStructures/CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 09e85f790..e273c28f8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,4 @@ -add_subdirectory(DataStructures) - -file(GLOB poet_lib_SRC +file(GLOB_RECURSE poet_lib_SRC CONFIGURE_DEPENDS "*.cpp" "*.c") @@ -10,7 +8,15 @@ find_library(CRYPTO_LIBRARY crypto) add_library(poet_lib ${poet_lib_SRC}) target_include_directories(poet_lib PUBLIC ${PROJECT_SOURCE_DIR}/include) target_link_libraries(poet_lib PUBLIC - MPI::MPI_CXX ${MATH_LIBRARY} RRuntime tug PhreeqcRM DataStructures ChemistryModule) + MPI::MPI_CXX ${MATH_LIBRARY} RRuntime PhreeqcRM tug) + target_compile_definitions(poet_lib PUBLIC STRICT_R_HEADERS OMPI_SKIP_MPICXX) -add_subdirectory(ChemistryModule) +mark_as_advanced(PHREEQCRM_BUILD_MPI PHREEQCRM_DISABLE_OPENMP) +set(PHREEQCRM_DISABLE_OPENMP ON CACHE BOOL "" FORCE) + +option(POET_DHT_DEBUG "Build with DHT debug info" OFF) + +if(POET_DHT_DEBUG) + target_compile_definitions(poet_lib PRIVATE DHT_STATISTICS) +endif() diff --git a/src/ChemistryModule/CMakeLists.txt b/src/ChemistryModule/CMakeLists.txt deleted file mode 100644 index 27068b315..000000000 --- a/src/ChemistryModule/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -option(POET_USE_PRM_BACKEND "Use PhreeqcRM parallelization instead of poet's." OFF) -option(POET_DHT_DEBUG "Build with DHT debug info" OFF) - -list(APPEND CHEM_MODEL_SRC "ChemistryModule.cpp" ) - -mark_as_advanced(PHREEQCRM_BUILD_MPI PHREEQCRM_DISABLE_OPENMP) -set(PHREEQCRM_DISABLE_OPENMP ON CACHE BOOL "" FORCE) - -if(POET_USE_PRM_BACKEND) - set(PHREEQCRM_BUILD_MPI ON CACHE BOOL "" FORCE) - target_compile_definitions(poet_lib PRIVATE POET_USE_PRM) -else() - set(PHREEQCRM_BUILD_MPI OFF CACHE BOOL "" FORCE) - list(APPEND CHEM_MODEL_SRC "WorkerFunctions.cpp" "MasterFunctions.cpp" "DHT.c" "DHT_Wrapper.cpp" "HashFunctions.cpp") -endif() - -add_library(ChemistryModule ${CHEM_MODEL_SRC}) -target_include_directories(ChemistryModule PUBLIC ${PROJECT_SOURCE_DIR}/include) -target_link_libraries(ChemistryModule - PUBLIC MPI::MPI_CXX PhreeqcRM - PRIVATE ${MATH_LIBRARY} - ) - -target_compile_definitions(ChemistryModule PUBLIC OMPI_SKIP_MPICXX) - -if(POET_DHT_DEBUG) - target_compile_definitions(ChemistryModule PRIVATE DHT_STATISTICS) -endif() - -if(POET_USE_PRM_BACKEND) - target_compile_definitions(ChemistryModule PUBLIC POET_USE_PRM) -endif() diff --git a/src/DataStructures/CMakeLists.txt b/src/DataStructures/CMakeLists.txt deleted file mode 100644 index 0c3f6a156..000000000 --- a/src/DataStructures/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -file(GLOB DataStructures_SRC - CONFIGURE_DEPENDS - "*.cpp" "*.c") - -add_library(DataStructures ${DataStructures_SRC}) -target_include_directories(DataStructures PUBLIC ${PROJECT_SOURCE_DIR}/include)