Skip to content

Commit 72a7b2b

Browse files
authored
Merge pull request #682 from ICB-DCM/develop
Release 0.10.5
2 parents 877bc1a + dd5e51e commit 72a7b2b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+3680
-514
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ matrix:
9292
branch: master
9393

9494
install:
95-
- export BASE_DIR=`pwd`
95+
- export BASE_DIR=`pwd`
9696
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir -p ~/bin/ && ln -s /usr/bin/swig3.0 ~/bin/swig && export PATH=~/bin/:$PATH; fi # Python distutils only looks for `swig` and does not find `swig3.0`
9797
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export PYTHON_EXECUTABLE=$(which python3); fi # cmake wont be able to find python3 on its own ...
9898
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$CI_MODE" == "test" ]]; then pip3 install --upgrade pip==9.0.3 setuptools wheel pkgconfig scipy; fi
@@ -113,6 +113,7 @@ script:
113113
- if [[ "$CI_MODE" == "test" ]]; then $FOLD notebooks "cd $BASE_DIR && scripts/runNotebook.sh python/examples/example_*/"; fi
114114
- if [[ "$TRAVIS_OS_NAME" != "linux" ]] && [[ "$CI_MODE" == "test" ]]; then $FOLD cpputest ./scripts/run-cpputest.sh; fi
115115
- if [[ "$TRAVIS_OS_NAME" != "linux" ]] && [[ "$CI_MODE" == "test" ]]; then $FOLD python-tests ./scripts/run-python-tests.sh; fi
116+
- if [[ "$TRAVIS_OS_NAME" != "linux" ]] && [[ "$CI_MODE" == "test" ]]; then $FOLD python-tests ./tests/testCMakeCompilation.sh; fi
116117
- if [[ "$CI_MODE" == "deploy" ]]; then $FOLD doxygen ./scripts/run-doxygen.sh; fi
117118
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$CI_MODE" == "test" ]]; then $FOLD cppcheck ./scripts/run-cppcheck.sh; fi
118119
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$CI_MODE" == "test" ]]; then $FOLD valgrind ./scripts/run-valgrind.sh; fi
@@ -129,6 +130,6 @@ cache:
129130
- $HOME/Library/Caches/pip
130131
- $HOME/.cache/pip
131132
timeout: 1200
132-
133+
133134
before_cache:
134135
- brew cleanup

CMakeLists.txt

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
# Build AMICI library
33
#
44
cmake_minimum_required(VERSION 3.3)
5+
6+
if(POLICY CMP0065)
7+
cmake_policy(SET CMP0065 NEW)
8+
endif(POLICY CMP0065)
9+
if(POLICY CMP0077)
10+
cmake_policy(SET CMP0077 NEW)
11+
endif(POLICY CMP0077)
12+
513
project(amici)
614

715
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
@@ -41,7 +49,7 @@ set(SUITESPARSE_LIBRARIES
4149
)
4250

4351
set(SUNDIALS_LIB_DIR "${CMAKE_SOURCE_DIR}/ThirdParty/sundials/build/lib")
44-
set(SUNDIALS_LIBRARIES
52+
set(SUNDIALS_LIBRARIES
4553
${SUNDIALS_LIB_DIR}/libsundials_nvecserial${CMAKE_STATIC_LIBRARY_SUFFIX}
4654
${SUNDIALS_LIB_DIR}/libsundials_sunlinsolband${CMAKE_STATIC_LIBRARY_SUFFIX}
4755
${SUNDIALS_LIB_DIR}/libsundials_sunlinsolklu${CMAKE_STATIC_LIBRARY_SUFFIX}
@@ -58,6 +66,8 @@ set(SUNDIALS_LIBRARIES
5866
)
5967
set(SUNDIALS_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/ThirdParty/sundials/build/include")
6068

69+
set(GSL_LITE_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/ThirdParty/gsl")
70+
6171
# AMICI requires BLAS, currently Intel MKL, CBLAS or MATLAB BLAS can be used.
6272
# The latter is not supported via CMake yet.
6373
set(BLAS "CBLAS" CACHE STRING "BLAS library to use")
@@ -113,6 +123,7 @@ target_include_directories(${PROJECT_NAME}
113123
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
114124
PUBLIC $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
115125
PUBLIC swig
126+
PUBLIC ${GSL_LITE_INCLUDE_DIR}
116127
PUBLIC ${SUNDIALS_INCLUDE_DIRS}
117128
PUBLIC ${SUITESPARSE_INCLUDE_DIRS}
118129
PUBLIC ${HDF5_INCLUDE_DIRS}
@@ -134,12 +145,12 @@ add_custom_target(matlabInterface SOURCES src/interface_matlab.cpp src/returndat
134145
add_custom_target(
135146
fileTemplates
136147
SOURCES
137-
src/CMakeLists.template.txt
148+
src/CMakeLists.template.cmake
138149
src/main.template.cpp
139150
src/model_header.ODE_template.h
140151
src/wrapfunctions.ODE_template.h
141152
src/wrapfunctions.template.cpp
142-
swig/CMakeLists_model.txt
153+
swig/CMakeLists_model.cmake
143154
swig/modelname.template.i
144155
)
145156

INSTALL.md

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ The python interface requires [SWIG](http://www.swig.org), which has to be insta
5050
Swig can be installed using package managers such as [brew](https://brew.sh) or [apt](https://wiki.debian.org/Apt):
5151

5252
brew install swig
53-
53+
5454
or
55-
55+
5656
apt-get install swig3.0
57-
57+
5858
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:
5959

6060
mkdir -p ~/bin/ && ln -s $(which swig3.0) ~/bin/swig && export PATH=~/bin/:$PATH
@@ -87,7 +87,7 @@ Note that Microsoft Visual Studio compilers are currently not supported.
8787
To use AMICI from python, install the module and all other requirements using pip:
8888

8989
pip3 install amici
90-
90+
9191
You can now import it as python module:
9292

9393
import amici
@@ -97,13 +97,13 @@ for use with Matlab or C++ and don't want to bothered with any unnecessary
9797
dependencies, you can run
9898

9999
pip3 install --install-option --no-clibs amici
100-
100+
101101
Note, however, that you will not be able to compile any model into a Python
102102
extension with this installation.
103103

104104
#### Anaconda
105105

106-
To use an Anaconda installation of python, proceed as follows:
106+
To use an Anaconda installation of python (https://www.anaconda.com/distribution/, Python>=3.6), proceed as follows:
107107

108108
Since Anaconda provides own versions of some packages which might not work with amici (in particular the gcc compiler), create a minimal virtual environment via:
109109

@@ -127,18 +127,50 @@ The option `--no-cache` may be helpful here to make sure the installation is don
127127

128128
Now, you are ready to use AMICI in the virtual environment.
129129

130+
#### Windows
131+
132+
To install AMICI on Windows using python, you can proceed as follows:
133+
134+
Some general remarks:
135+
136+
* Install all libraries in a path not containing white spaces, e.g. directly under C:.
137+
* Replace the following paths according to your installation.
138+
* Slashes can be preferable to backslashes for some environment variables.
139+
* See also [#425](https://github.com/icb-dcm/amici/issues/425) for further discussion.
140+
141+
Then, follow these steps:
142+
143+
* A python environment for Windows is required. We recommend [Anaconda](https://www.anaconda.com/distribution/) with python >=3.6.
144+
* Install [mingw64](https://sourceforge.net/projects/mingw-w64/files/latest/download) (32bit will succeed to compile, but fail during linking). During installation, select Version=8.1.0, Architecture=x64_64. Add the following directory to `PATH`:
145+
+ `C:\mingw-w64\x86_64-8.1.0-posix-sjlj-rt_v6-rev0\mingw64\bin`
146+
* Make sure that this is the compiler that is found by the system (e.g. `where gcc` in a `cmd` should point to this installation).
147+
* Download CBLAS headers and libraries, e.g. [OpenBLAS](https://sourceforge.net/projects/openblas/files/v0.2.19/), binary distribution 0.2.19. Set the following environment variables:
148+
+ `BLAS_CFLAGS=-IC:/OpenBLAS-v0.2.19-Win64-int32/include`
149+
+ `BLAS_LIBS=-Wl,-Bstatic -LC:/OpenBLAS-v0.2.19-Win64-int32/lib -lopenblas -Wl,-Bdynamic`
150+
* Install [SWIG](http://www.swig.org/download.html) (version swigwin-3.0.12 worked) and add the following directory to `PATH`:
151+
+ `C:\swigwin-3.0.12`
152+
* Install AMICI using:
153+
154+
`pip install --global-option="build_clib" --global-option="--compiler=mingw32" --global-option="build_ext" --global-option="--compiler=mingw32" amici --no-cache-dir --verbose`
155+
156+
Possible sources of errors:
157+
158+
* On recent Windows versions, `anaconda3\Lib\distutils\cygwinccompiler.py` fails linking `msvcr140.dll` with `[...] x86_64-w64-mingw32/bin/ld.exe: cannot find -lmsvcr140`. This is not required for amici, so in `cygwinccompiler.py` `return ['msvcr140']` can be changed to `return []`.
159+
* If you use a python version where [python/cpython#880](https://github.com/python/cpython/pull/880) has not been fixed yet, you need to disable `define hypot _hypot in anaconda3\include/pyconfig.h` yourself.
160+
* `import amici` in python resulting in the very informative "ImportError: DLL load failed: The specified module could not be found." means that some amici module dependencies were not found (not the amici module itself). [DependencyWalker](http://www.dependencywalker.com/) will show you which ones.
161+
130162
### C++
131163

132-
To use AMICI from C++, run the
164+
To use AMICI from C++, run the
133165

134166
./scripts/buildSundials.sh
135167
./scripts/buildSuitesparse.sh
136168
./scripts/buildAmici.sh
137-
169+
138170
script to compile amici libary. The static library file can then be linked from
139171

140172
./build/libamici.a
141-
173+
142174
In CMake-based packages, amici can be linked via
143175

144176
find_package(Amici)

0 commit comments

Comments
 (0)