Skip to content

Commit

Permalink
Add AMICI_TRY_ENABLE_HDF5 env var (#2148)
Browse files Browse the repository at this point in the history
Add AMICI_TRY_ENABLE_HDF5 environment variable to disable trying to build with HDF5 support if HDF5 is found.

Related to #2144
  • Loading branch information
dweindl authored Jul 20, 2023
1 parent 36a880e commit 3cccbb5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ cmake_minimum_required(VERSION 3.15)
project(amici)

# misc options
if(DEFINED ENV{AMICI_TRY_ENABLE_HDF5})
option(AMICI_TRY_ENABLE_HDF5 "Build with HDF5 support if available?"
$ENV{AMICI_TRY_ENABLE_HDF5})
else()
option(AMICI_TRY_ENABLE_HDF5 "Build with HDF5 support if available?" ON)
endif()
option(AMICI_PYTHON_BUILD_EXT_ONLY "Build only the Python extension?" OFF)
option(AMICI_TRY_ENABLE_HDF5 "Build with HDF5 support if available?" ON)
option(ENABLE_HDF5 "Build with HDF5 support?" OFF)
option(SUNDIALS_SUPERLUMT_ENABLE "Enable sundials SuperLUMT?" OFF)
option(EXPORT_PACKAGE "Export AMICI library to CMake package registry?" ON)
Expand Down Expand Up @@ -324,7 +329,10 @@ if(HDF5_FOUND)
target_link_libraries(${PROJECT_NAME} PUBLIC hdf5::hdf5_hl_cpp hdf5::hdf5_hl
hdf5::hdf5_cpp hdf5::hdf5)
else()
message(STATUS "HDF5 library NOT found. Building AMICI WITHOUT HDF5 support.")
message(
STATUS
"HDF5 support disabled or HDF5 library not found. Building AMICI WITHOUT HDF5 support."
)
endif()

if(AMICI_PYTHON_BUILD_EXT_ONLY)
Expand Down
4 changes: 4 additions & 0 deletions documentation/python_installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@ environment variables:
| | processes to be used for C(++) | |
| | compilation (defaults to 1) | |
+----------------------------+----------------------------------+---------------------------------+
| ``AMICI_TRY_ENABLE_HDF5`` | Whether to build AMICI with | ``AMICI_TRY_ENABLE_HDF5=OFF`` |
| | HDF5-support if possible. | |
| | Default: ``ON`` | |
+----------------------------+----------------------------------+---------------------------------+

Installation under Anaconda
---------------------------
Expand Down

0 comments on commit 3cccbb5

Please sign in to comment.