Skip to content

Commit

Permalink
Merge pull request #1207 from AMICI-dev/release_0.11.6
Browse files Browse the repository at this point in the history
Release 0.11.6

## Python
* Bugfix for piecewise functions (#1199)
* Refactor swigging - generate one single wrapper (#1213)

## C++
* Fix warnings: account for zero indexing in nan/inf error (#1112)

## Doc
* Update Windows build instructions (#1200, #1202)
* Update README: Projects using AMICI (#1209)
* Add CODE_OF_CONDUCT.md (#1210)
* Update documentation for Python interface (#1208)

## CI
* Create sdist on GHA using swig4.0.1 (#1204)  (Fixing broken pypi package)
* Fix links after repository move
* Speed-up swig build: disable all languages except python (#1211)
* Fix doc generation on readthedocs (#1196)
  • Loading branch information
dweindl authored Aug 20, 2020
2 parents 055b1df + 54ebada commit 7a1dc5e
Show file tree
Hide file tree
Showing 27 changed files with 503 additions and 233 deletions.
30 changes: 7 additions & 23 deletions .github/workflows/deploy_branch.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,7 @@
name: Deploy Branch
on: [push]
on: [push, pull_request]

jobs:
dockerhub:
# https://github.com/marketplace/actions/publish-docker
name: Deploy Dockerhub

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- run: git archive -o docker/amici.tar.gz --format=tar.gz HEAD
- name: Publish to Registry
uses: elgohr/[email protected]
with:
name: dweindl/amici
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
workdir: docker/
dockerfile: Dockerfile
tag_names: true

sdist:
name: Deploy Python Source Distribution

Expand All @@ -30,10 +12,12 @@ jobs:
with:
fetch-depth: 20

- name: apt
- run: echo "::set-env name=AMICI_DIR::$(pwd)"
- run: echo "::set-env name=SWIG::${AMICI_DIR}/ThirdParty/swig-4.0.1/install/bin/swig"

- name: Build swig4
run: |
sudo apt-get update \
&& sudo apt-get install -y swig
sudo scripts/downloadAndBuildSwig.sh
- name: Create AMICI sdist
run: |
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/deploy_protected.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy Protected
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master

jobs:
dockerhub:
# https://github.com/marketplace/actions/publish-docker
name: Deploy Dockerhub

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- run: git archive -o docker/amici.tar.gz --format=tar.gz HEAD
- name: Publish to Registry
uses: elgohr/[email protected]
with:
name: dweindl/amici
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
workdir: docker/
dockerfile: Dockerfile
tag_names: true
14 changes: 8 additions & 6 deletions .github/workflows/deploy_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Run doxygen
run: |
scripts/run-doxygen.sh
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
Expand All @@ -50,11 +50,13 @@ jobs:
with:
fetch-depth: 20

- name: apt
- run: echo "::set-env name=AMICI_DIR::$(pwd)"
- run: echo "::set-env name=SWIG::${AMICI_DIR}/ThirdParty/swig-4.0.1/install/bin/swig"

- name: Build swig4
run: |
sudo apt-get update \
&& sudo apt-get install -y swig
sudo scripts/downloadAndBuildSwig.sh
- name: sdist
run: |
scripts/buildSdist.sh
Expand All @@ -65,4 +67,4 @@ jobs:
user: __token__
password: ${{ secrets.pypi_password }}
packages_dir: python/sdist/dist

23 changes: 16 additions & 7 deletions .github/workflows/test_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ jobs:
- uses: actions/checkout@master
- run: git fetch --prune --unshallow

- run: echo "::set-env name=AMICI_DIR::$(pwd)"

- name: apt
run: |
sudo apt-get update \
Expand All @@ -47,6 +45,15 @@ jobs:
- uses: actions/checkout@master
- run: git fetch --prune --unshallow

- run: echo "::set-env name=AMICI_DIR::$(pwd)"
- run: echo "::set-env name=SWIG::${AMICI_DIR}/ThirdParty/swig-4.0.1/install/bin/swig"

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.8'

# install amici dependencies
- name: apt
run: |
Expand All @@ -55,13 +62,15 @@ jobs:
g++ \
libatlas-base-dev \
libboost-serialization-dev \
libhdf5-serial-dev \
python3-venv \
swig \
- name: Install python package
- name: Build swig
run: |
sudo scripts/downloadAndBuildSwig.sh
- name: pip
run: |
scripts/installAmiciSource.sh
pip3 install setuptools
- name: sphinx
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_install.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Installation
on: [push]
on: [push, pull_request]

jobs:
archive:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_python_cplusplus.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: C++/Python Tests
on: [push]
on: [push, pull_request]

jobs:
build:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/test_python_ver_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ jobs:
- run: echo "::set-env name=AMICI_DIR::$(pwd)"
- run: echo "::set-env name=BNGPATH::${AMICI_DIR}/ThirdParty/BioNetGen-2.3.2"

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- uses: actions/checkout@v1
with:
fetch-depth: 20
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ tests/cpputest/build/*
tests/cpputest/build_xcode/*
tests/cpputest/Testing/*

doc-venv/*
doc/*
fonts/*
images/*
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ sphinx:
# Optionally build your docs in additional formats such as PDF and ePub
formats:
- pdf

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
version: 3.8
install:
- requirements: documentation/rtd_requirements.txt

Expand Down
76 changes: 76 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
85 changes: 80 additions & 5 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ on. This can be done by inserting the following code before calling
(For further discussion see https://github.com/AMICI-dev/AMICI/issues/357)


### Windows
### Windows using GCC (mingw)

To install AMICI on Windows using python, you can proceed as follows:

Expand All @@ -155,11 +155,11 @@ Some general remarks:
Then, follow these steps:

* A python environment for Windows is required. We recommend
[Anaconda](https://www.anaconda.com/distribution/) with python >=3.6.
* Install [mingw64](https://sourceforge.net/projects/mingw-w64/files/latest/download)
[Anaconda](https://www.anaconda.com/distribution/) with python >=3.7.
* Install [MinGW-W64](https://sourceforge.net/projects/mingw-w64/files/)
(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`:
MinGW-W64 GCC-8.1.0 for `x86_64-posix-sjlj` ([direct link](https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/8.1.0/threads-posix/sjlj/x86_64-8.1.0-release-posix-sjlj-rt_v6-rev0.7z/download) has been shown to work on Windows 7 and 10 test systems.
* Add the following directory to `PATH`:
+ `C:\mingw-w64\x86_64-8.1.0-posix-sjlj-rt_v6-rev0\mingw64\bin`
* 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).
Expand Down Expand Up @@ -202,6 +202,81 @@ Possible sources of errors:
and [compileBLAS.cmd](https://github.com/AMICI-dev/AMICI/blob/master/scripts/compileBLAS.cmd)
may serve as guidance on how to install openBLAS using msvc.

### Windows using MSVC (Visual Studio)

#### Visual Studio
We assume that Visual Studio (not to be confused with Visual Studio Code) is already installed. Using Visual Studio Installer, the following components need to be included:

* Microsoft Visual C++ (MSVC). This is part of multiple packages, including Desktop Development with C++.
* Windows Universal C Runtime. This is an individual component and installs some DLLs that we need.

#### openBLAS
To install open BLAS, download the following scripts from AMICI:

https://github.com/AMICI-dev/AMICI/blob/master/scripts/installOpenBLAS.ps1
https://github.com/AMICI-dev/AMICI/blob/master/scripts/compileBLAS.cmd

The first script needs to be called in Powershell, and it needs to call `compileBLAS.cmd`, so you will need to modify line 11:

C:\Users\travis\build\AMICI\scripts\compileBLAS.cmd

so that it matches your directory structure.
This will download openBLAS and compile it, creating

C:\BLAS\lib\openblas.lib
C:\BLAS\bin\openblas.dll

You will also need to define two environment variables:

BLAS_LIBS="/LIBPATH:C:\BLAS\lib openblas.lib"
BLAS_CFLAGS="/IC:\BLAS\OpenBLAS-v0.3.10\OpenBLAS-0.3.10"

One way to do that is to run a PowerShell script with the following commands:

[System.Environment]::SetEnvironmentVariable("BLAS_LIBS", "/LIBPATH:C:\BLAS\lib openblas.lib", [System.EnvironmentVariableTarget]::User)
[System.Environment]::SetEnvironmentVariable("BLAS_LIBS", "/LIBPATH:C:\BLAS\lib openblas.lib", [System.EnvironmentVariableTarget]::Process)
[System.Environment]::SetEnvironmentVariable("BLAS_CFLAGS", "-IC:\BLAS\OpenBLAS-v0.3.10\OpenBLAS-0.3.10", [System.EnvironmentVariableTarget]::User)
[System.Environment]::SetEnvironmentVariable("BLAS_CFLAGS", "-IC:\BLAS\OpenBLAS-v0.3.10\OpenBLAS-0.3.10", [System.EnvironmentVariableTarget]::Process)

The call ending in `Process` sets the environment variable in the current process, and it is no longer in effect in the next process. The call ending in `User` is permanent, and takes effect the next time the user logs on.

#### PATH
Now we need to make sure that all required DLLs are within the scope of the PATH variable. In particular, the following directories need to be included in PATH:

C:\BLAS\bin
C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\x64

The first one is needed for `openblas.dll` and the second is needed for the Windows Universal C Runtime.
If any DLLs are missing in the PATH variable, Python will return the following error:

ImportError: DLL load failed: The specified module could not be found.

This can be tested using the "where" command. For example

where openblas.dll

should return

C:\BLAS\bin\openblas.dll

Almost all of the DLLs are standard Windows DLLs and should be included in either Windows or Visual Studio. But, in case it is necessary to test this, here is a list of some DLLs required by AMICI (when compiled with MSVC):

* `openblas.dll`
* `python37.dll`
* `MSVCP140.dll`
* `KERNEL32.dll`
* `VCRUNTIME140_1.dll`
* `VCRUNTIME140.dll`
* `api-ms-win-crt-convert-l1-1-0.dll`
* `api-ms-win-crt-heap-l1-1-0.dll`
* `api-ms-win-crt-stdio-l1-1-0.dll`
* `api-ms-win-crt-string-l1-1-0.dll`
* `api-ms-win-crt-runtime-l1-1-0.dll`
* `api-ms-win-crt-time-l1-1-0.dll`
* `api-ms-win-crt-math-l1-1-0.dll`

`MSVCP140.dll`, `VCRUNTIME140.dll`, and `VCRUNTIME140_1.dll` are needed by MSVC (see Visual Studio above). `KERNEL32.dll` is part of Windows and in `C:\Windows\System32`. The `api-ms-win-crt-XXX-l1-1-0.dll` are needed by `openblas.dll` and are part of the Windows Universal C Runtime (see Visual Studio above).

### Custom installation

AMICI Python package installation can be customized using a number of
Expand Down
Loading

0 comments on commit 7a1dc5e

Please sign in to comment.