Skip to content

Commit

Permalink
cmake: set sundials path hint for python package (#2397)
Browse files Browse the repository at this point in the history
So far, CMakeLists.txt only provided a path hint for sundials for the
standalone c++ library, but not for the python package. The latter
should be added to ensure the right sundials version is found. There
have been issues with system installations of sundials.

Closes #2394
  • Loading branch information
dweindl authored Apr 19, 2024
1 parent 28b2611 commit e8493cf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,16 @@ elseif(AMICI_TRY_ENABLE_HDF5)
endif()

set(VENDORED_SUNDIALS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ThirdParty/sundials)
set(VENDORED_SUNDIALS_BUILD_DIR ${VENDORED_SUNDIALS_DIR}/build)
set(VENDORED_SUNDIALS_INSTALL_DIR ${VENDORED_SUNDIALS_BUILD_DIR})
set(SUNDIALS_PRIVATE_INCLUDE_DIRS "${VENDORED_SUNDIALS_DIR}/src")
# Handle different sundials build/install dirs, depending on whether we are
# building the Python extension only or the full C++ interface
if(AMICI_PYTHON_BUILD_EXT_ONLY)
set(VENDORED_SUNDIALS_BUILD_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(VENDORED_SUNDIALS_INSTALL_DIR ${VENDORED_SUNDIALS_BUILD_DIR})
else()
set(VENDORED_SUNDIALS_BUILD_DIR ${VENDORED_SUNDIALS_DIR}/build)
set(VENDORED_SUNDIALS_INSTALL_DIR ${VENDORED_SUNDIALS_BUILD_DIR})
endif()
find_package(
SUNDIALS REQUIRED PATHS
"${VENDORED_SUNDIALS_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/cmake/sundials/")
Expand Down

0 comments on commit e8493cf

Please sign in to comment.