Skip to content
Snippets Groups Projects
Verified Commit d3d08bbb authored by Lars Bilke's avatar Lars Bilke
Browse files

Replaced Conan CVode module with CPM.

parent 30ee3037
No related branches found
No related tags found
1 merge request!3494More Conan packages moved to CPM (2nd try)
...@@ -5,7 +5,7 @@ append_source_files(SOURCES Curve) ...@@ -5,7 +5,7 @@ append_source_files(SOURCES Curve)
append_source_files(SOURCES InterpolationAlgorithms) append_source_files(SOURCES InterpolationAlgorithms)
append_source_files(SOURCES Integration) append_source_files(SOURCES Integration)
append_source_files(SOURCES LinAlg) append_source_files(SOURCES LinAlg)
if(CVODE_FOUND) if(OGS_USE_CVODE)
append_source_files(SOURCES ODE) append_source_files(SOURCES ODE)
endif() endif()
append_source_files(SOURCES Nonlinear) append_source_files(SOURCES Nonlinear)
...@@ -26,8 +26,6 @@ target_include_directories(MathLib ...@@ -26,8 +26,6 @@ target_include_directories(MathLib
PUBLIC PUBLIC
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
$<$<BOOL:${OGS_USE_PETSC}>:${PETSC_INCLUDE_DIRS}> $<$<BOOL:${OGS_USE_PETSC}>:${PETSC_INCLUDE_DIRS}>
PRIVATE
$<$<BOOL:${OGS_USE_CVODE}>:${CVODE_INCLUDE_DIRS}>
) )
set_target_properties(MathLib PROPERTIES LINKER_LANGUAGE CXX) set_target_properties(MathLib PROPERTIES LINKER_LANGUAGE CXX)
...@@ -38,6 +36,7 @@ target_link_libraries(MathLib ...@@ -38,6 +36,7 @@ target_link_libraries(MathLib
${OpenMP_CXX_LIBRARIES} ${OpenMP_CXX_LIBRARIES}
$<$<TARGET_EXISTS:LAPACK::LAPACK>:LAPACK::LAPACK> $<$<TARGET_EXISTS:LAPACK::LAPACK>:LAPACK::LAPACK>
$<$<BOOL:${OGS_USE_LIS}>:${LIS_LIBRARIES}> $<$<BOOL:${OGS_USE_LIS}>:${LIS_LIBRARIES}>
$<$<BOOL:${OGS_USE_CVODE}>:CVODE::CVODE>
Eigen3::Eigen Eigen3::Eigen
PRIVATE PRIVATE
spdlog::spdlog spdlog::spdlog
...@@ -46,9 +45,6 @@ target_link_libraries(MathLib ...@@ -46,9 +45,6 @@ target_link_libraries(MathLib
if(OGS_USE_PETSC) if(OGS_USE_PETSC)
target_link_libraries(MathLib PUBLIC ${PETSC_LIBRARIES}) target_link_libraries(MathLib PUBLIC ${PETSC_LIBRARIES})
endif() endif()
if(OGS_USE_CVODE)
target_link_libraries(MathLib PUBLIC ${CVODE_LIBRARIES})
endif()
if(OGS_USE_MKL) if(OGS_USE_MKL)
target_link_libraries(MathLib PUBLIC ${MKL_LIBRARIES}) target_link_libraries(MathLib PUBLIC ${MKL_LIBRARIES})
endif() endif()
...@@ -57,7 +53,7 @@ target_compile_definitions(MathLib ...@@ -57,7 +53,7 @@ target_compile_definitions(MathLib
PUBLIC PUBLIC
$<$<BOOL:${USE_LIS}>:USE_LIS> $<$<BOOL:${USE_LIS}>:USE_LIS>
$<$<BOOL:${OGS_USE_PETSC}>:USE_PETSC> $<$<BOOL:${OGS_USE_PETSC}>:USE_PETSC>
$<$<BOOL:${CVODE_FOUND}>:CVODE_FOUND> $<$<BOOL:${OGS_USE_CVODE}>:CVODE_FOUND>
PRIVATE PRIVATE
$<$<BOOL:${OGS_USE_MKL}>:USE_MKL> $<$<BOOL:${OGS_USE_MKL}>:USE_MKL>
) )
...@@ -62,10 +62,6 @@ if(OGS_USE_LIS) ...@@ -62,10 +62,6 @@ if(OGS_USE_LIS)
set(CONAN_REQUIRES ${CONAN_REQUIRES} lis/1.7.9@bilke/stable) set(CONAN_REQUIRES ${CONAN_REQUIRES} lis/1.7.9@bilke/stable)
endif() endif()
if(OGS_USE_CVODE)
set(CONAN_REQUIRES ${CONAN_REQUIRES} cvode/2.8.2@bilke/stable)
endif()
if(OGS_USE_MFRONT) if(OGS_USE_MFRONT)
set(CONAN_REQUIRES ${CONAN_REQUIRES} tfel/3.3.0@bilke/testing) set(CONAN_REQUIRES ${CONAN_REQUIRES} tfel/3.3.0@bilke/testing)
endif() endif()
......
...@@ -257,6 +257,27 @@ if(OGS_BUILD_GUI) ...@@ -257,6 +257,27 @@ if(OGS_BUILD_GUI)
endif() endif()
endif() endif()
if(OGS_USE_CVODE)
CPMAddPackage(
NAME CVODE
GITHUB_REPOSITORY ufz/cvode
VERSION 2.8.2
GIT_TAG 42d786bff4f950045d2de941677ecd4432cec855
OPTIONS "EXAMPLES_ENABLE OFF"
)
if(CVODE_ADDED)
add_library(CVODE::CVODE INTERFACE IMPORTED)
target_include_directories(CVODE::CVODE INTERFACE
${CVODE_SOURCE_DIR}/include
${CVODE_BINARY_DIR}/include
)
target_link_libraries(CVODE::CVODE INTERFACE
sundials_cvode_static
sundials_nvecserial_static
)
endif()
endif()
# Disable warnings # Disable warnings
foreach(TARGET ${DISABLE_WARNINGS_TARGETS}) foreach(TARGET ${DISABLE_WARNINGS_TARGETS})
target_compile_options(${TARGET} PRIVATE target_compile_options(${TARGET} PRIVATE
......
...@@ -159,11 +159,6 @@ if(OGS_USE_MPI) ...@@ -159,11 +159,6 @@ if(OGS_USE_MPI)
find_package(MPI REQUIRED) find_package(MPI REQUIRED)
endif() endif()
## Sundials cvode ode-solver library
if(OGS_USE_CVODE)
find_package(CVODE REQUIRED)
endif()
find_package(Filesystem REQUIRED COMPONENTS Final Experimental) find_package(Filesystem REQUIRED COMPONENTS Final Experimental)
configure_file(${PROJECT_SOURCE_DIR}/BaseLib/filesystem.h.in configure_file(${PROJECT_SOURCE_DIR}/BaseLib/filesystem.h.in
${PROJECT_BINARY_DIR}/BaseLib/filesystem.h) ${PROJECT_BINARY_DIR}/BaseLib/filesystem.h)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment