Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CMake export config #2540

Merged
merged 4 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/test_python_cplusplus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ jobs:
- name: Set up AMICI C++ libraries
uses: ./.github/actions/setup-amici-cpp

- name: Install libsuitesparse-dev
# We don't need libsuitesparse-dev, but let's have it installed,
# to ensure that its presence does not break the build
run: sudo apt-get install -y libsuitesparse-dev

- name: C++ tests
run: scripts/run-cpp-tests.sh

Expand Down
16 changes: 0 additions & 16 deletions cmake/AmiciConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,9 @@ find_package(OpenMP)
# tmpdirs.
list(APPEND CMAKE_PREFIX_PATH
@CMAKE_SOURCE_DIR@/ThirdParty/SuiteSparse/install/)
find_dependency(SuiteSparse_config REQUIRED)
find_dependency(AMD REQUIRED)
find_dependency(BTF REQUIRED)
find_dependency(COLAMD REQUIRED)
find_dependency(KLU REQUIRED)

include("${CMAKE_CURRENT_LIST_DIR}/AmiciFindBLAS.cmake")

add_library(SUNDIALS::KLU INTERFACE IMPORTED)
target_link_libraries(
SUNDIALS::KLU
INTERFACE "${KLU_STATIC}"
INTERFACE "${COLAMD_STATIC}"
INTERFACE "${BTF_STATIC}"
INTERFACE "${AMD_STATIC}"
INTERFACE "${SUITESPARSE_CONFIG_STATIC}")
set_target_properties(SUNDIALS::KLU PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${KLU_INCLUDE_DIR}")

find_dependency(SUNDIALS REQUIRED PATHS
"@CMAKE_SOURCE_DIR@/ThirdParty/sundials/build/@CMAKE_INSTALL_LIBDIR@/cmake/sundials/")

Expand Down
5 changes: 1 addition & 4 deletions python/sdist/amici/setup.template.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ def get_extension() -> CMakeExtension:
install_prefix="TPL_MODELNAME",
cmake_configure_options=[
"-DCMAKE_VERBOSE_MAKEFILE=ON",
"-DCMAKE_MODULE_PATH="
f"{prefix_path.as_posix()}/lib/cmake/SuiteSparse;"
f"{prefix_path.as_posix()}/lib64/cmake/SuiteSparse",
f"-DKLU_ROOT={prefix_path.as_posix()}",
f"-DCMAKE_PREFIX_PATH={prefix_path.as_posix()}",
"-DAMICI_PYTHON_BUILD_EXT_ONLY=ON",
f"-DPython3_EXECUTABLE={Path(sys.executable).as_posix()}",
],
Expand Down
Loading