Skip to content

Commit

Permalink
Merge pull request #780 from ICB-DCM/develop
Browse files Browse the repository at this point in the history
Release 0.10.10
  • Loading branch information
dweindl authored Aug 7, 2019
2 parents 4da5dd9 + 6157014 commit b39a39f
Show file tree
Hide file tree
Showing 69 changed files with 882 additions and 381 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,4 @@ ThirdParty/SuiteSparse/lib/*
ThirdParty/SuiteSparse/share/*
ThirdParty/SuperLU_MT_3.1/
ThirdParty/superlu_mt_3.1.tar.gz
ThirdParty/swig-*
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ matrix:
fast_finish: true
include:
- os: linux
dist: xenial
dist: bionic
language: python
python: 3.7
compiler: gcc
Expand All @@ -23,7 +23,6 @@ matrix:
- libboost-serialization-dev
- swig3.0
- g++-5
- cppcheck
- libc6-dbg
env:
- ENABLE_GCOV_COVERAGE=TRUE
Expand All @@ -44,7 +43,7 @@ matrix:
tags: true

- os: osx
osx_image: xcode10.1
osx_image: xcode11
language: minimal
compiler: clang
env:
Expand All @@ -55,6 +54,7 @@ matrix:
- hdf5
- swig
- gcc
- cppcheck
update: true
before_install:
- travis_wait brew link --overwrite gcc # fix linker warning regarding /usr/local/include/c++
Expand All @@ -64,7 +64,7 @@ matrix:
- cd $BASE_DIR # cd to base dir for correct relative path in deploy

- os: osx
osx_image: xcode10.1
osx_image: xcode11
language: minimal
compiler: clang
env:
Expand Down Expand Up @@ -117,7 +117,7 @@ script:
- if [[ "$TRAVIS_OS_NAME" != "linux" ]] && [[ "$CI_MODE" == "test" ]]; then $FOLD python-tests ./scripts/run-python-tests.sh; fi
- if [[ "$TRAVIS_OS_NAME" != "linux" ]] && [[ "$CI_MODE" == "test" ]]; then $FOLD cmake ./tests/testCMakeCompilation.sh; fi
- if [[ "$CI_MODE" == "deploy" ]]; then $FOLD doxygen ./scripts/run-doxygen.sh; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$CI_MODE" == "test" ]]; then $FOLD cppcheck ./scripts/run-cppcheck.sh; fi
- if [[ "$TRAVIS_OS_NAME" != "linux" ]] && [[ "$CI_MODE" == "test" ]]; then $FOLD cppcheck ./scripts/run-cppcheck.sh; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$CI_MODE" == "test" ]]; then $FOLD valgrind ./scripts/run-valgrind.sh; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$CI_MODE" == "test" ]]; then $FOLD codecov ./scripts/run-codecov.sh; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$TRAVIS_EVENT_TYPE" == "cron" ]]; then $FOLD sbmltestsuite ./scripts/run-SBMLTestsuite.sh; fi
Expand Down
24 changes: 18 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ endif(POLICY CMP0065)
if(POLICY CMP0077)
cmake_policy(SET CMP0077 NEW)
endif(POLICY CMP0077)
if(POLICY CMP0074)
# Use package_ROOT environment variables
cmake_policy(SET CMP0074 NEW)
endif(POLICY CMP0074)

project(amici)

Expand Down Expand Up @@ -36,6 +40,7 @@ foreach(FLAG ${MY_CXX_FLAGS})
endforeach(FLAG)

# find dependencies
include(GNUInstallDirs)
find_package(HDF5 COMPONENTS C HL CXX REQUIRED)
set(HDF5_LIBRARIES ${HDF5_HL_LIBRARIES} ${HDF5_C_LIBRARIES} ${HDF5_CXX_LIBRARIES})
set(SUITESPARSE_DIR "${CMAKE_SOURCE_DIR}/ThirdParty/SuiteSparse/")
Expand All @@ -48,7 +53,7 @@ set(SUITESPARSE_LIBRARIES
${SUITESPARSE_DIR}/SuiteSparse_config/libsuitesparseconfig${CMAKE_STATIC_LIBRARY_SUFFIX}
)

set(SUNDIALS_LIB_DIR "${CMAKE_SOURCE_DIR}/ThirdParty/sundials/build/lib")
set(SUNDIALS_LIB_DIR "${CMAKE_SOURCE_DIR}/ThirdParty/sundials/build/${CMAKE_INSTALL_LIBDIR}")
set(SUNDIALS_LIBRARIES
${SUNDIALS_LIB_DIR}/libsundials_nvecserial${CMAKE_STATIC_LIBRARY_SUFFIX}
${SUNDIALS_LIB_DIR}/libsundials_sunlinsolband${CMAKE_STATIC_LIBRARY_SUFFIX}
Expand Down Expand Up @@ -83,14 +88,22 @@ set(GSL_LITE_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/ThirdParty/gsl")
# The latter is not supported via CMake yet.
set(BLAS "CBLAS" CACHE STRING "BLAS library to use")
set_property(CACHE BLAS PROPERTY STRINGS "CBLAS" "MKL" "ACCELERATE")
add_definitions(-DAMICI_BLAS_${BLAS})
if(${BLAS} STREQUAL "MKL")
set(BLAS_INCLUDE_DIRS "" CACHE STRING "")
set(BLAS_LIBRARIES -lmkl CACHE STRING "")
if(${BLAS} STREQUAL "MKL" OR DEFINED ENV{MKLROOT})
if(DEFINED ENV{MKLROOT})
# This is set by Environment Modules
message(STATUS "Using MKL_INCDIR and MKL_LIB from environment module")
set(BLAS "MKL" CACHE STRING "BLAS library to use" FORCE)
set(BLAS_INCLUDE_DIRS "$ENV{MKL_INCDIR}" CACHE STRING "" FORCE)
set(BLAS_LIBRARIES "$ENV{MKL_LIB}" CACHE STRING "" FORCE)
else()
set(BLAS_INCLUDE_DIRS "" CACHE STRING "")
set(BLAS_LIBRARIES -lmkl CACHE STRING "")
endif()
else()
set(BLAS_INCLUDE_DIRS "" CACHE STRING "")
set(BLAS_LIBRARIES -lcblas CACHE STRING "")
endif()
add_definitions(-DAMICI_BLAS_${BLAS})

# Add target to create version file
add_custom_target(
Expand Down Expand Up @@ -178,7 +191,6 @@ set(AUTHORS "Fabian Froehlich, Jan Hasenauer, Daniel Weindl and Paul Stapor")
set(AUTHOR_EMAIL "[email protected]")

# <Export cmake configuration>
include(GNUInstallDirs)
install(TARGETS ${PROJECT_NAME} EXPORT AmiciTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
Expand Down
40 changes: 37 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ You can now import it as python module:

import amici

For cases where this installation fails, check below for special setups
and custom installations.
For Python-AMICI usage see
[https://github.com/ICB-DCM/AMICI/blob/master/documentation/PYTHON.md](https://github.com/ICB-DCM/AMICI/blob/master/documentation/PYTHON.md).

Expand Down Expand Up @@ -181,6 +183,21 @@ Possible sources of errors:
[DependencyWalker](http://www.dependencywalker.com/) will show you
which ones.

### Custom installation

AMICI Python package installation can be customized using a number of
environment variables:

|Variable | Purpose | Example |
|---|---|---|
|`CC`| Setting the C(++) compiler | `CC=/usr/bin/g++`|
|`CFLAGS`| Extra compiler flags used in every compiler call | |
|`BLAS_CFLAGS`| Compiler flags for, e.g. BLAS include directories | |
|`BLAS_LIBS`| Flags for linking BLAS | |
|`ENABLE_GCOV_COVERAGE`| Set to build AMICI to provide code coverage information | `ENABLE_GCOV_COVERAGE=TRUE`|
|`ENABLE_AMICI_DEBUGGING`| Set to build AMICI with debugging symbols | `ENABLE_AMICI_DEBUGGING=TRUE`|
|`AMICI_PARALLEL_COMPILE`| Set to the number of parallel processes to be used for C(++) file compilation (defaults to 1)| `AMICI_PARALLEL_COMPILE=4`|


<a name="matlab"></a>
## MATLAB
Expand Down Expand Up @@ -219,6 +236,11 @@ To use AMICI from C++, run the

script to compile AMICI library.

**NOTE**: On some systems, the CMake executable may be named something
other than `cmake`. In this case, set the `CMAKE` environment variable
to the correct name (e.g. `export CMAKE=cmake3`, in case you have CMake
available as `cmake3`).

The static library file can then be linked from

./build/libamici.a
Expand Down Expand Up @@ -311,21 +333,33 @@ or
#### SWIG

The python interface requires [SWIG](http://www.swig.org), which has to
be installed by the user. Swig can be installed using package managers
such as [brew](https://brew.sh) or [apt](https://wiki.debian.org/Apt):
be installed by the user. As root user, SWIG can be installed using
package managers such as [brew](https://brew.sh) or
[apt](https://wiki.debian.org/Apt):

brew install swig

or

apt-get install swig3.0

Or by non-root users, using `scripts/downloadAndBuildSwig.sh` from the
AMICI repository (not included in the PyPI package). The binary
directory has to be added to the `PATH` environment variable, or `SWIG`
has to be set as described in the following section.


##### Using a non-default SWIG executable

We note here that some linux package managers may provide swig
executables as `swig3.0`, but installation as `swig` is required. This
can be fixed using, e.g., symbolic links:
can be fixed as root user using, e.g., symbolic links:

mkdir -p ~/bin/ && ln -s $(which swig3.0) ~/bin/swig && export PATH=~/bin/:$PATH

Non-root users can set the `SWIG` environment variable to the full
path of the desired SWIG executable. This variable has be set during
AMICI package installation as well as during model compilation.

### Matlab

Expand Down
6 changes: 5 additions & 1 deletion cmake/version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ if(Git_FOUND)
)
endif()

# get project root directory
get_filename_component(CMAKE_PARENT_LIST_DIR ${CMAKE_PARENT_LIST_FILE} DIRECTORY)
get_filename_component(CMAKE_PARENT_LIST_DIR ${CMAKE_PARENT_LIST_DIR} DIRECTORY)

execute_process(COMMAND sh -c "cat version.txt | tr -d '\n'"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY "${CMAKE_PARENT_LIST_DIR}"
OUTPUT_VARIABLE PROJECT_VERSION
)
8 changes: 4 additions & 4 deletions documentation/PYTHON.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ parameters that should be considered constants can be specified in a list of str

### Observables

assignment rules that should be considered as observables can extracted using the `amici.assignmentRules2observables` function
Assignment rules that should be considered as observables can extracted using the `amici.assignmentRules2observables` function.

observables = amici.assignmentRules2observables(sbml, filter=lambda variableId:
variableId.startswith('observable_') and not variableId.endswith('_sigma'))
observables = amici.assignmentRules2observables(sbml, filter_function=lambda variable:
variable.getId().startswith('observable_') and not variable.getId().endswith('_sigma'))

### Standard Deviations

Expand All @@ -44,7 +44,7 @@ to compile the sbml as python module, the user has to call the method `amici.sbm
sbmlImporter.sbml2amici('test', 'test',
observables=observables,
constantParameters=constantParameters,
sigmas=sigma)
sigmas=sigmas)

Note: To build AMICI with OpenMP support, which allows to parallelize model simulations of multiple
experimental conditions, set the environment variables `AMICI_CXXFLAGS` and `AMICI_LDFLAGS` to the
Expand Down
Loading

0 comments on commit b39a39f

Please sign in to comment.