Skip to content
Commits on Source (331)
[![Build Status](https://gitlab.dune-project.org/copasi/dune-copasi/badges/master/pipeline.svg)](https://gitlab.dune-project.org/copasi/dune-copasi/pipelines)
[![Build Status](https://travis-ci.org/dune-copasi/dune-copasi.svg?branch=master)](https://travis-ci.org/dune-copasi/dune-copasi)
[![Build Status](https://ci.appveyor.com/api/projects/status/e7w7u5dt50kue5sb/branch/master?svg=true)](https://ci.appveyor.com/project/SoilRos/dune-copasi-3gv18/branch/master)
[![Build Status](https://github.com/dune-copasi/dune-copasi/workflows/CI%20Builds/badge.svg?branch=master)](https://github.com/dune-copasi/dune-copasi/actions?query=branch%3Amaster+)
## How does this CI works?
## How does the CI works?
We have 3 Continous Integration services:
We have 2 Continous Integration services:
- [GitLab](https://docs.gitlab.com/ee/ci/)
- [Travis](https://travis-ci.org/)
- [AppVeyor](https://www.appveyor.com/)
- [GitHub](https://github.com/dune-copasi/dune-copasi/actions)
The reason for this is because only one could not tackle all three platforms we
want to reach. That is:
- Linux
- macOS
- Windows
Sice the last two CI are better ingegrated with GitHub, we have set a repository
there which mirrors all modifications made in the main repository.
For this, we have set up a main repository and a mirror:
- Main repository: https://gitlab.dune-project.org/copasi/dune-copasi
- Mirror repository: https://github.com/dune-copasi/dune-copasi
The main idea here is that they, the different CI, follow almost the same
instructions in the different stages. In all the cases, the scripts expect
to have defined `DUNECONTROL` and `DUNE_OPTIONS_FILE` variables for running
`dunecontrol` and for the configuration options.
configuration options defined in the main directory `dune-copasi.opts`.
Their files are defined in the default places:
- [../.gitlab-ci.yml](../.gitlab-ci.yml)
- [../.github/workflow/ci.yml](../.github/workflow/ci.yml)
### Stage: Setup Precopiled Dependecies
In the case of GitHub, we use the precopiled libraries provided by the
[`sme_deps_common`](https://github.com/spatial-model-editor/sme_deps_common).
The script [`setup_static_deps`](setup_static_deps) obtains the target OS
from the `dune-copasi.opts`, downloads the respective files, and expand them
on the cmake install prefix.
### Stage: Setup
```bash
./setup_static_deps $PDW/../dune-copasi.opts
```
In this stage, we configure and install all the dependencies that `dune-copasi`
requires. In this case, Travis and Appveyor use the script
[`setup.sh`](setup.sh) while gitlab uses the dependencies docker image in the
container registry. The latter only updated for the `master` branch by the
docker script [`dependencies.dockerfile`](../docker/dependencies.dockerfile).
This makes the GitLab CI run faster as all the dependencies are already
installed.
### Stage: Setup Dune Dependecies
### Stage: Build
In this stage, we configure and install the dune dependencies that `dune-copasi`
requires. In both cases, the CIs use the script [`setup_dune`](setup_dune), but
in order to generate faster results in GitLab, this stage is only updated for the
`master` branch by the docker file [`Dockerfile`](../docker/dune-copasi.dockerfile)
with target `setup-env`.
This stage builds `dune-copasi` following the [`build.sh`](build.sh) script
which in turs run the `dunecontrol` command for the project.
This stage always should be run.
```bash
./setup_dune $PDW/../dune-copasi.opts
```
### Stage: Unit Tests
### Stage: Build, Install, and Package
This stage builds and runs the unit tests by running the
[`unit_tests.sh`](unit_tests.sh) script. `ctests` runs all tests with the tag
`unit`. This stage always should be run.
This stage builds, installs and optionally packages `dune-copasi` following the
[`install`](install) script. Similar to the others, this script expects the options
file which in turs run `cmake` and its targets. If the environmental variables
`CPACK_GENERATORS` and `CPACK_PACKAGE_DIRECTORY`, the script will package the
library with the given generators.
### Stage: System Tests
```bash
./install $PDW/../dune-copasi.opts
```
This stage runs all the system tests tagged with `DUNE_SYSTEMTEST` when running
the [`system_tests.sh`](system_tests.sh) script. Since most of the system tests
are generated by `dune-testools`, which is optional, this stage will only make
sense when `dune-testools` is installed in the setup stage. Currently, this i
not feasible for windows due to the python environment setup.
### Stage: Testing
This stage builds and runs the unit and system tests by using the
[`test`](test) script. `ctests` runs all tests with the tag
`unit` and `DUNE_SYSTEMTEST`. Most of the system tests
are generated by `dune-testools`, so its availability depends whether
`dune-testtools` is installed. In any case, performing this stage is very
important because it checks whether the library is findable by CMake.
```bash
./test $PDW/../dune-copasi.opts
```
## CI Link & Badge
For getting them replace `<branch>` for the specific branch you want:
### GitLab CI
- Link: https://gitlab.dune-project.org/copasi/dune-copasi/pipelines
- Badge: [https://gitlab.dune-project.org/copasi/dune-copasi/badges/`<branch>`/pipeline.svg](https://gitlab.dune-project.org/copasi/dune-copasi/badges/master/pipeline.svg)
### Travis
- Link: https://travis-ci.org/SoilRos/dune-copasi
- Bagage [https://travis-ci.org/dune-copasi/dune-copasi.svg?branch=`<branch>`](https://travis-ci.org/dune-copasi/dune-copasi/branches)
### AppVeyor
- Link: [https://ci.appveyor.com/project/SoilRos/dune-copasi/branch/`<branch>`](https://ci.appveyor.com/project/SoilRos/dune-copasi-3gv18/branch/master)
- Badge: [https://ci.appveyor.com/api/projects/status/e7w7u5dt50kue5sb/branch/`<branch>`?svg=true](https://ci.appveyor.com/api/projects/status/e7w7u5dt50kue5sb/branch/master?svg=true)
- Badge: https://gitlab.dune-project.org/copasi/dune-copasi/badges/`<branch>`/pipeline.svg
### GitHub Actions
- Link: https://github.com/dune-copasi/dune-copasi/actions?query=branch%3A`<branch>`+
- Badge: https://github.com/dune-copasi/dune-copasi/workflows/CI%20Builds/badge.svg?branch=`<branch>`
# build script for all CIs
# make sure we get the right mingw64 version of g++ on appveyor
PATH=/mingw64/bin:$PATH
echo "PATH=$PATH"
echo "MSYSTEM: $MSYSTEM"
echo "DUNECONTROL: ${DUNECONTROL}"
echo "DUNE_OPTIONS_FILE: ${DUNE_OPTIONS_FILE}"
cat ${DUNE_OPTIONS_FILE}
echo "PWD: $PWD"
which g++
which python
which cmake
g++ --version
gcc --version
cmake --version
${DUNECONTROL} --opts=${DUNE_OPTIONS_FILE} --only=dune-copasi all
\ No newline at end of file
diff --git a/cmake/modules/DuneMacros.cmake b/cmake/modules/DuneMacros.cmake
index 1c9b0412..778c9a92 100644
--- a/cmake/modules/DuneMacros.cmake
+++ b/cmake/modules/DuneMacros.cmake
@@ -977,8 +977,6 @@ endif()
configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
endif()
- include(CPack)
-
feature_summary(WHAT ALL)
# check if CXX flag overloading has been enabled
diff --git a/dune/common/std/CMakeLists.txt b/dune/common/std/CMakeLists.txt
index 40004d3c..94a2d7ac 100644
--- a/dune/common/std/CMakeLists.txt
......
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 693bab6..dd4ffae 100644
index 693bab6..770ba85 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -136,7 +136,6 @@ the command \"git submodule update --init --recursive\" in the dune-logging sour
target_compile_definitions(
@@ -145,7 +145,7 @@ the command \"git submodule update --init --recursive\" in the dune-logging sour
dune-logging-fmt
PRIVATE FMT_EXPORT
- INTERFACE $<$<NOT:$<STREQUAL:$<TARGET_PROPERTY:TYPE>,STATIC_LIBRARY>>:FMT_SHARED>
PUBLIC DUNE_LOGGING_VENDORED_FMT=1
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/dune/vendor/fmt>
- $<INSTALL_INTERFACE:dune/vendor/fmt>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/dune/vendor/fmt>
)
endif()
#!/usr/bin/env bash
# build and install
# variables from DUNE_OPTIONS_FILE
# (optional) CMAKE_FLAGS
# (optional) SUDOCMD
# (optional) CPACK_GENERATORS
# (optional) CPACK_PACKAGE_DIRECTORY
set +e
# set colors for better print
GREEN=$(tput setaf 2 :-"" 2>/dev/null)
RESET=$(tput sgr0 :-"" 2>/dev/null)
set -e
# options file may be passed as argument
[ ! -z "$1" ] && DUNE_OPTIONS_FILE="$1"
# load dune opts
CMAKE_FLAGS="$(. ${DUNE_OPTIONS_FILE}; eval echo \$CMAKE_FLAGS)"
SUDOCMD="$(. ${DUNE_OPTIONS_FILE}; eval echo \$SUDOCMD)"
# load useful functions
CALL_DIR=$PWD
SCRIPT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source $SCRIPT_PATH/util
SOURCEDIR=${SCRIPT_PATH}/..
BUILD_PATH=/tmp/dune-copasi-build
print_opts_file() {
cat "${DUNE_OPTIONS_FILE}"
}
print_cmake_error() {
cat "${BUILD_PATH}/src/CMakeFiles/multidomain-exec.dir/build.make"
}
cleanup() {
echo "removig intermediate results"
rm -rf $BUILD_PATH
}
# set up verbose output in case of failure
ONFAILURE_PROG="git gcc g++ python pip python3 pip3 cmake $SUDOCMD"
ONFAILURE_VARS="PATH SUDOCMD DUNE_OPTIONS_FILE CMAKE_FLAGS"
ONFAILURE_CMD="ls cleanup"
trap onfailure EXIT
[[ -d ${BUILD_PATH} ]] && ONFAILURE_MESSAGE+="run this script where no folder 'build-cmake' exists\n" && exit 1
mkdir $BUILD_PATH && cd $BUILD_PATH
echo "cmake $CMAKE_FLAGS $SOURCEDIR"
eval cmake $CMAKE_FLAGS $SOURCEDIR
$SUDOCMD cmake --build $BUILD_PATH --target install
for generator in $CPACK_GENERATORS; do
cpack -G $generator -B $CPACK_PACKAGE_DIRECTORY CPackConfig.cmake
done
trap cleanup EXIT
# dependencies setup script for Travis and AppVeyor CI
DUNE_VERSION="2.7"
# make sure we get the right mingw64 version of g++ on appveyor
PATH=/mingw64/bin:$PATH
echo "PATH=$PATH"
echo "MSYSTEM: $MSYSTEM"
echo "DUNECONTROL: ${DUNECONTROL}"
echo "DUNE_OPTIONS_FILE: ${DUNE_OPTIONS_FILE}"
cat ${DUNE_OPTIONS_FILE}
echo "PWD: $PWD"
which g++
g++ --version
which gcc
gcc --version
which python
python --version
which python3
python3 --version
which pip
pip --version
which pip3
pip3 --version
which cmake
cmake --version
# download Dune dependencies
for repo in core/dune-common core/dune-geometry core/dune-grid core/dune-istl core/dune-localfunctions staging/dune-functions staging/dune-uggrid
do
git clone -b releases/$DUNE_VERSION --depth 1 --recursive https://gitlab.dune-project.org/$repo.git
done
for repo in dune-logging dune-typetree dune-pdelab dune-multidomaingrid
do
git clone -b support/dune-copasi-v0.3 --depth 1 --recursive https://gitlab.dune-project.org/copasi/$repo.git
done
# python virtual environment does not work in windows yet
if [[ ! $MSYSTEM ]]; then
git clone -b releases/$DUNE_VERSION https://gitlab.dune-project.org/quality/dune-testtools.git
fi
# on windows, symlinks from git repos don't work
# msys git replaces symlinks with a text file containing the linked file location
# so here we identify all such files, and replace them with the linked file
# note msys defines MSYSTEM variable: use this to check if we are on msys/windows
if [[ $MSYSTEM ]]; then
rootdir=$(pwd)
for repo in $(ls -d dune-*/)
do
echo "repo: $repo"
cd $rootdir/$repo
for f in $(git ls-files -s | awk '/120000/{print $4}')
do
dname=$(dirname "$f")
fname=$(basename "$f")
relf=$(cat $f)
src="$rootdir/$repo/$dname/$relf"
dst="$rootdir/$repo/$dname/$fname"
echo " - copying $src --> $dst"
cp $src $dst
done
done
cd $rootdir
fi
# patch cmake macro to avoid build failure when fortran compiler not found, e.g. on osx
cd dune-common
wget https://gist.githubusercontent.com/lkeegan/059984b71f8aeb0bbc062e85ad7ee377/raw/e9c7af42c47fe765547e60833a72b5ff1e78123c/cmake-patch.txt
echo '' >> cmake-patch.txt
git apply cmake-patch.txt
# another patch for missing header in cmake install list
git apply ../dune-copasi/.ci/dune-common.patch
cd ../
cd dune-logging
git apply ../dune-copasi/.ci/dune-logging.patch
cd ../
ls
# python virtual environment does not work in windows yet
if [[ ! $MSYSTEM ]]; then
${DUNECONTROL} --opts=${DUNE_OPTIONS_FILE} --module=dune-testtools all
fi
for repo in dune-testtools dune-logging dune-pdelab dune-multidomaingrid
do
${DUNECONTROL} --opts=${DUNE_OPTIONS_FILE} --module=$repo all
done
#!/usr/bin/env bash
# build and install dune dependences
# variables from DUNE_OPTIONS_FILE
# (optional) SETUP_DUNE_TESTTOOLS
# (optional) SUDOCMD
# (optional) DUNE_VENDOR_FMT
set +e
# set colors for better print
GREEN=$(tput setaf 2 :-"" 2>/dev/null)
RESET=$(tput sgr0 :-"" 2>/dev/null)
set -e
# options file may be passed as argument
[ ! -z "$1" ] && DUNE_OPTIONS_FILE="$1"
# load dune options
SETUP_DUNE_TESTTOOLS="$(. ${DUNE_OPTIONS_FILE}; eval echo \$SETUP_DUNE_TESTTOOLS)"
SUDOCMD="$(. ${DUNE_OPTIONS_FILE}; eval echo \$SUDOCMD)"
DUNE_VENDOR_FMT="$(. ${DUNE_OPTIONS_FILE}; eval echo \$DUNE_VENDOR_FMT)"
# load useful functions
CALL_DIR=$PWD
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source $SCRIPT_DIR/util
print_opts_file() {
cat "${DUNE_OPTIONS_FILE}"
}
print_cmake_error() {
$DUNECONTROL --opts=${DUNE_OPTIONS_FILE} --only=dune-$module bexec "echo \$PWD > /tmp/setup-dune/module_builddir"
BUILD_PATH=$(cat /tmp/setup-dune/module_builddir)
cat "${BUILD_PATH}/CMakeFiles/CMakeError.log"
}
cleanup() {
rm -rf /tmp/setup-dune
}
# set up verbose output in case of failure
ONFAILURE_PROG="git gcc g++ python pip python3 pip3 cmake wget $SUDOCMD"
ONFAILURE_VARS="PATH MSYSTEM SUDOCMD SETUP_DUNE_TESTTOOLS DUNE_OPTIONS_FILE"
ONFAILURE_VARS+=" CMAKE_FLAGS CMAKE_INSTALL_PREFIX DUNE_VENDOR_FMT REPO BRANCH PATCHES RECURSIVE BUILD_PATH"
ONFAILURE_CMD="ls cleanup"
trap onfailure EXIT
[[ -d /tmp/setup-dune ]] && ONFAILURE_MESSAGE+="run this script where no folder '/tmp/setup-dune' exists\n" && exit 1
mkdir /tmp/setup-dune && cd /tmp/setup-dune
# setup dune repositories, branches, and patches
for module in common geometry grid istl localfunctions; do
eval SETUP_dune_${module}_BRANCH=\"releases/2.7\"
eval SETUP_dune_${module}_REPO=\"https://gitlab.dune-project.org/core/dune-${module}.git\"
done
for module in logging functions uggrid; do
eval SETUP_dune_${module}_BRANCH=\"releases/2.7\"
eval SETUP_dune_${module}_REPO=\"https://gitlab.dune-project.org/staging/dune-${module}.git\"
done
for module in typetree pdelab
do
eval SETUP_dune_${module}_BRANCH=\"support/dune-copasi-v1.0.0\"
eval SETUP_dune_${module}_REPO=\"https://gitlab.dune-project.org/copasi/dune-${module}.git\"
done
SETUP_dune_testtools_BRANCH="releases/2.7"
SETUP_dune_testtools_REPO="https://gitlab.dune-project.org/quality/dune-testtools.git"
SETUP_dune_multidomaingrid_BRANCH="releases/2.7"
SETUP_dune_multidomaingrid_REPO="https://gitlab.dune-project.org/extensions/dune-multidomaingrid.git"
cat ${SCRIPT_DIR}/dune-common.patch >> "${PWD}/dune-common.patch"
SETUP_dune_common_PATCHES="${SCRIPT_DIR}/dune-common.patch"
SETUP_dune_logging_RECURSIVE="$DUNE_VENDOR_FMT"
echo "Downloading patches"
PATCH_URL="https://gist.githubusercontent.com/lkeegan/059984b71f8aeb0bbc062e85ad7ee377/raw/e9c7af42c47fe765547e60833a72b5ff1e78123c/cmake-patch.txt"
if command -v wget &> /dev/null; then
wget -O cmake-patch.txt $PATCH_URL
elif command -v curl &> /dev/null; then
curl $PATCH_URL --output cmake-patch.txt
else
ONFAILURE_MESSAGE+="'wget' not 'curl' was not found."
exit 1
fi
echo '' >> cmake-patch.txt
SETUP_dune_common_PATCHES+=" ${PWD}/cmake-patch.txt"
# hardcoded **ordered** dependencies
MODULES="common logging uggrid geometry grid localfunctions istl typetree functions pdelab multidomaingrid"
if [[ "$SETUP_DUNE_TESTTOOLS" =~ ^(ON|on|1|yes|YES|true|TRUE)$ ]]; then
MODULES+=" testtools"
fi
[ -z $DUNE_OPTIONS_FILE ] && ONFAILURE_MESSAGE+="Dune options file is not set!\n" && exit 1
# get cmake flags
unset CMAKE_FLAGS
if test "x$DUNE_OPTIONS_FILE" != "x"; then
CMAKE_FLAGS="$(. $DUNE_OPTIONS_FILE; eval echo \$CMAKE_FLAGS)"
fi
# get install prefix
for flag in $CMAKE_FLAGS; do
[[ ${flag#-D} == CMAKE_INSTALL_PREFIX* ]] && CMAKE_INSTALL_PREFIX=${flag#-DCMAKE_INSTALL_PREFIX}
done
# remove "=" or ":PATH=" prefix
CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX#=}
CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX#:PATH=}
# remove quotations
CMAKE_INSTALL_PREFIX=$(echo $CMAKE_INSTALL_PREFIX | tr -d "'")
[ -z $CMAKE_INSTALL_PREFIX ] && ONFAILURE_MESSAGE+="Options file **shall** provide a CMAKE_INSTALL_PREFIX\n" && exit 1
if command -v $CMAKE_INSTALL_PREFIX/bin/dunecontrol &> /dev/null; then
ONFAILURE_MESSAGE+="An installation of 'dunecontrol' was already found in '$CMAKE_INSTALL_PREFIX'\n"
ONFAILURE_MESSAGE+="A new setup **must** not override an old installation\n"
exit 1
fi
# install prefix **must** be included on the cmake prefix
CMAKE_PREFIX_PATH=
for flag in $CMAKE_FLAGS; do
[[ ${flag#-D} == CMAKE_PREFIX_PATH* ]] && CMAKE_PREFIX_PATH+=" $flag"
done
unset CMAKE_FLAGS
# check if install prefix is included on cmake prefix path
if [[ "$CMAKE_PREFIX_PATH" != *${CMAKE_INSTALL_PREFIX}* ]]; then
ONFAILURE_MESSAGE+="\n"
ONFAILURE_MESSAGE+="CMAKE_INSTALL_PREFIX must be contained in CMAKE_PREFIX_PATH\n"
ONFAILURE_MESSAGE+="otherwise cmake projects cannot find installed modules. e.g.\n"
ONFAILURE_MESSAGE+="\n"
ONFAILURE_MESSAGE+=" CMAKE_FLAGS+=\" -DCMAKE_PREFIX_PATH='${CMAKE_INSTALL_PREFIX}'\"\n"
ONFAILURE_MESSAGE+="\n"
exit 1
fi
# download dune dependencies
for module in $MODULES; do
echo ""
echo $GREEN "============================ Setting up dune-$module ============================" $RESET
echo ""
REPO="$(eval echo \$SETUP_dune_${module}_REPO)"
BRANCH="$(eval echo \$SETUP_dune_${module}_BRANCH)"
PATCHES="$(eval echo \$SETUP_dune_${module}_PATCHES)"
RECURSIVE="$(eval echo \$SETUP_dune_${module}_RECURSIVE)"
[[ "$RECURSIVE" =~ ^(ON|on|1|yes|YES|true|TRUE)$ ]] && RECURSIVE_ARG="--recursive"
git clone -b $BRANCH --depth 1 $RECURSIVE_ARG $REPO
# on windows, symlinks from git repos don't work
# msys git replaces symlinks with a text file containing the linked file location
# so here we identify all such files, and replace them with the linked file
# note msys defines MSYSTEM variable: use this to check if we are on msys/windows
if [[ $MSYSTEM ]]; then
cd dune-$module
set +e
for f in $(git ls-files -s | awk '/120000/{print $4}'); do
dname=$(dirname "$f")
fname=$(basename "$f")
relf=$(cat $f)
src="$PWD/$dname/$relf"
dst="$PWD/$dname/$fname"
echo " - copying $src --> $dst"
cp $src $dst
done
set -e
cd ..
fi
# apply patches
if [[ ! -z $PATCHES ]]; then
echo "Applying patches: $PATCHES"
# change line ending to DOS if OS is windows
[[ $MSYSTEM ]] && dos2unix $PATCHES
git -C dune-$module apply -v $PATCHES
fi
echo ""
if [ "$module" = "common" ]; then
DUNECONTROL=./dune-common/bin/dunecontrol
else
DUNECONTROL=$CMAKE_INSTALL_PREFIX/bin/dunecontrol
fi
# control path must be explicitely set on windows when dune-common is installed
export DUNE_CONTROL_PATH=$PWD
# configure, build, and install module
$DUNECONTROL --opts=${DUNE_OPTIONS_FILE} --only=dune-$module all
$SUDOCMD $DUNECONTROL --opts=${DUNE_OPTIONS_FILE} --only=dune-$module bexec cmake --build . --target install
# we want to know where the build dir is located
# since it could be ant complex path, we write the path from dunecontrol into a file
$DUNECONTROL --opts=${DUNE_OPTIONS_FILE} --only=dune-$module bexec "echo \$PWD > /tmp/setup-dune/module_builddir"
# remove build and sources
BUILD_PATH=$(cat /tmp/setup-dune/module_builddir)
rm -rf $BUILD_PATH
rm -rf dune-$module
done
trap cleanup EXIT
#!/usr/bin/env bash
# download and install other dependences (from sme by Liam)
# variables from DUNE_OPTIONS_FILE
# OS_TARGET=linux|osx|win32|win64
# CMAKE_INSTALL_PREFIX
# (optional) SUDOCMD
set -e
# options file may be passed as argument
[ ! -z "$1" ] && DUNE_OPTIONS_FILE="$1"
# load dune options
CMAKE_FLAGS="$(. ${DUNE_OPTIONS_FILE}; eval echo \$CMAKE_FLAGS)"
SUDOCMD="$(. ${DUNE_OPTIONS_FILE}; eval echo \$SUDOCMD)"
OS_TARGET="$(. ${DUNE_OPTIONS_FILE}; eval echo \$OS_TARGET)"
# load useful functions
CALL_DIR=$PWD
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source $SCRIPT_DIR/util
prefix_content() {
ls "${CMAKE_INSTALL_PREFIX}"
}
cleanup() {
rm -rf /tmp/setup-static-deps
}
# set up verbose output in case of failure
ONFAILURE_PROG="git gcc g++ python pip python3 pip3 cmake wget curl $SUDOCMD"
ONFAILURE_VARS="SUDOCMD OSTYPE OS_TARGET CMAKE_INSTALL_PREFIX CMAKE_FLAGS CMAKE_PREFIX_PATH VERBOSE_TAR"
ONFAILURE_CMD="ls prefix_content cleanup"
trap onfailure EXIT
[[ -d /tmp/setup-static-deps ]] && ONFAILURE_MESSAGE+="run this script where no folder '/tmp/setup-static-deps' exists\n" && exit 1
mkdir /tmp/setup-static-deps && cd /tmp/setup-static-deps
if [[ ! "$OS_TARGET" =~ ^(linux|osx|win32|win64)$ ]]; then
ONFAILURE_MESSAGE+="'$OS_TARGET' is not a known OS target\n"
exit 1
fi
echo "Downloading static libs for OS_TARGET: ${OS_TARGET}"
DEPS_URL="https://github.com/spatial-model-editor/sme_deps_common/releases/cgal5.2/download/sme_deps_common_${OS_TARGET}.tgz"
if command -v wget &> /dev/null; then
wget -nv $DEPS_URL | sed 's/^/ /'
elif command -v curl &> /dev/null; then
curl -L $DEPS_URL >> sme_deps_common_${OS_TARGET}.tgz | sed 's/^/ /'
else
ONFAILURE_MESSAGE+="'wget' not 'curl' was not found."
exit 1
fi
VERBOSE_TAR=$(tar xvf sme_deps_common_${OS_TARGET}.tgz 2>&1)
[ -z "$CMAKE_INSTALL_PREFIX" ] && ONFAILURE_MESSAGE+="Install prefix is empty\n" && exit 1
echo ""
echo "Moving libs to install prefix: ${CMAKE_INSTALL_PREFIX}"
# copy libs to desired location
$SUDOCMD mkdir -p "${CMAKE_INSTALL_PREFIX}"
if [[ "$OS_TARGET" == *"win"* ]]; then
$SUDOCMD mv smelibs/* "${CMAKE_INSTALL_PREFIX}"
else
$SUDOCMD mv opt/smelibs/* "${CMAKE_INSTALL_PREFIX}"
fi
# set the following flags in your dune opts file
# CMAKE_FLAGS+=" -DGMPXX_INCLUDE_DIR:PATH='"${CMAKE_INSTALL_PREFIX}"/include' "
# CMAKE_FLAGS+=" -DGMPXX_LIB:FILEPATH='"${CMAKE_INSTALL_PREFIX}"/lib/libgmpxx.a' "
# CMAKE_FLAGS+=" -DGMP_LIB:FILEPATH='"${CMAKE_INSTALL_PREFIX}"/lib/libgmp.a' "
# CMAKE_FLAGS+=" -Dfmt_ROOT='"${CMAKE_INSTALL_PREFIX}"' "
# CMAKE_FLAGS+=" -DCMAKE_DISABLE_FIND_PACKAGE_QuadMath=TRUE"
# CMAKE_FLAGS+=" -DF77=true"
# be careful when adding several prefix paths, they have to be
# set in a semicolon separated list
# CMAKE_FLAGS+=" -DCMAKE_PREFIX_PATH='${CMAKE_PREFIX_PATH}' "
# ...or if you are using the dune-copasi.opts
# export DUNE_COPASI_USE_STATIC_DEPS="ON"
trap cleanup EXIT
# system tests script for all CIs
# make sure we get the right mingw64 version of g++ on appveyor
PATH=/mingw64/bin:$PATH
echo "PATH=$PATH"
echo "MSYSTEM: $MSYSTEM"
echo "DUNECONTROL: ${DUNECONTROL}"
echo "DUNE_OPTIONS_FILE: ${DUNE_OPTIONS_FILE}"
cat ${DUNE_OPTIONS_FILE}
echo "PWD: $PWD"
which g++
which python
which cmake
g++ --version
gcc --version
cmake --version
${DUNECONTROL} --opts=${DUNE_OPTIONS_FILE} --only=dune-copasi make --target build_system_tests
${DUNECONTROL} --opts=${DUNE_OPTIONS_FILE} --only=dune-copasi bexec ctest -j4 -L "DUNE_SYSTEMTEST" --output-on-failure
\ No newline at end of file
#!/usr/bin/env bash
# unit tests script for all CIs
# input
# DUNE_OPTIONS_FILE absolute path to options file
set +e
# set colors for better print
GREEN=$(tput setaf 2 :-"" 2>/dev/null)
RESET=$(tput sgr0 :-"" 2>/dev/null)
set -e
# options file may be passed as argument
[ ! -z "$1" ] && DUNE_OPTIONS_FILE="$1"
# load useful functions
CALL_DIR=$PWD
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source $SCRIPT_DIR/util
SOURCEDIR=${SCRIPT_DIR}/../test
print_opts_file() {
cat "${DUNE_OPTIONS_FILE}"
}
print_cmake_error() {
cat "${BUILD_PATH}/CMakeFiles/CMakeError.log"
}
cleanup() {
echo "removig intermediate results"
rm -rf "${BUILD_PATH}"
}
# set up verbose output in case of failure
ONFAILURE_PROG="git gcc g++ python pip python3 pip3 cmake"
ONFAILURE_VARS="PATH DUNE_OPTIONS_FILE "
ONFAILURE_VARS+="DEBUG_CMAKE_FLAGS RELEASE_CMAKE_FLAGS"
ONFAILURE_CMD="ls cleanup"
trap onfailure EXIT
echo $GREEN "============================ Unit Tests ============================" $RESET
BUILD_PATH=/tmp/build-unit-tests
[[ -d ${BUILD_PATH} ]] && ONFAILURE_MESSAGE+="the folder '${BUILD_PATH}' should not exist prior running this script\n" && exit 1
mkdir $BUILD_PATH && cd $BUILD_PATH
if [[ -n "$DUNE_OPTIONS_FILE" ]]; then
DEBUG_CMAKE_FLAGS="$(. $DUNE_OPTIONS_FILE; eval echo \$CMAKE_FLAGS)"
fi
echo "cmake $DEBUG_CMAKE_FLAGS $SOURCEDIR"
eval cmake $DEBUG_CMAKE_FLAGS $SOURCEDIR
cmake --build . --target build_unit_tests
ctest -j4 -L "unit" --output-on-failure
echo $GREEN "============================ System Tests ============================" $RESET
BUILD_PATH=/tmp/build-system-tests
[[ -d ${BUILD_PATH} ]] && ONFAILURE_MESSAGE+="the folder '${BUILD_PATH}' should not exist prior running this script\n" && exit 1
mkdir $BUILD_PATH && cd $BUILD_PATH
if [[ -n "$DUNE_OPTIONS_FILE" ]]; then
RELEASE_CMAKE_FLAGS="$(. $DUNE_OPTIONS_FILE; eval echo \$CMAKE_FLAGS)"
fi
echo "cmake $RELEASE_CMAKE_FLAGS $SOURCEDIR"
eval cmake $RELEASE_CMAKE_FLAGS $SOURCEDIR
cmake --build . --target build_system_tests
ctest -j4 -L "DUNE_SYSTEMTEST" --output-on-failure
trap cleanup EXIT
# unit tests script for all CIs
# make sure we get the right mingw64 version of g++ on appveyor
PATH=/mingw64/bin:$PATH
echo "PATH=$PATH"
echo "MSYSTEM: $MSYSTEM"
echo "DUNECONTROL: ${DUNECONTROL}"
echo "DUNE_OPTIONS_FILE: ${DUNE_OPTIONS_FILE}"
cat ${DUNE_OPTIONS_FILE}
echo "PWD: $PWD"
which g++
which python
which cmake
g++ --version
gcc --version
cmake --version
${DUNECONTROL} --opts=${DUNE_OPTIONS_FILE} --only=dune-copasi make --target build_unit_tests
${DUNECONTROL} --opts=${DUNE_OPTIONS_FILE} --only=dune-copasi bexec ctest -j4 -L "unit" --output-on-failure
\ No newline at end of file
#!/usr/bin/env bash
# This is a helper function to diagnose error on different systems.
# Use `onfailure` function together with the `trap` command:
#
# trap onfailure EXIT
#
# # some custom script
#
# trap - EXIT
# lets assume no symlink is used
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# default executables to check binary folder and version on failure
[ -z "$ONFAILURE_PROG" ] && ONFAILURE_PROG='bash'
# default variables to expand on failure
[ -z "$ONFAILURE_VARS" ] && ONFAILURE_VARS="PATH"
# default commands to run on failure
[ -z "$ONFAILURE_CMD" ] && ONFAILURE_CMD="pwd"
# default exit message on failure
[ -z "$ONFAILURE_MESSAGE" ] && ONFAILURE_MESSAGE="A failure has been produced when executing:\n\t'${0} ${@}'\n\n"
onfailure() {
FAILURE_TYPE="$?"
# do not exit this function even on case of failures
set +e
RED=$(tput setaf 1 :-"" 2>/dev/null)
GREEN=$(tput setaf 2 :-"" 2>/dev/null)
YELLOW=$(tput setaf 3 :-"" 2>/dev/null)
RESET=$(tput sgr0 :-"" 2>/dev/null)
echo "${YELLOW}*************************** On Failure: Commands ****************************" $RESET >&2
for i in $(echo $ONFAILURE_CMD); do
echo "[${YELLOW}${i}${RESET}]:" >&2
FUNC="$($i 2>&1)" >&2
if [ -z "$FUNC" ]; then
echo $RED "NOT OUTPUT" $RESET | sed 's/^/ /' >&2
else
echo "$FUNC" | sed 's/^/ /' >&2
fi
echo "" >&2
done
echo "${YELLOW}*************************** On Failure: Executables Info **************************" $RESET >&2
for i in $(echo $ONFAILURE_PROG); do
echo "[${YELLOW}${i}${RESET}]:" >&2
if command -v $i &> /dev/null; then
EXEC_PATH=$(which $i 2>&1)
VERSION="$($EXEC_PATH --version 2>&1)"
echo " which:" >&2
echo "$EXEC_PATH" | sed 's/^/ /' >&2
echo " version:"
echo "$VERSION" | sed 's/^/ /' >&2
else
echo $RED "NOT FOUND" $RESET | sed 's/^/ /' >&2
fi
echo "" >&2
done
echo "${YELLOW}*************************** On Failure: Variables *********************************" $RESET >&2
for i in $(echo $ONFAILURE_VARS); do
echo "[${YELLOW}${i}${RESET}]:" >&2
VAR=$(eval echo "\$$i")
if [ -z "$VAR" ]; then
echo $RED "NOT FOUND" $RESET | sed 's/^/ /' >&2
else
echo "$VAR" | sed 's/^/ /' >&2
fi
echo "" >&2
done
echo "${YELLOW}*************************** On Failure: Message **************************" $RESET >&2
echo $RED "" >&2
echo "EXIT CODE: $FAILURE_TYPE" $RESET | sed 's/^/ /' >&2
echo "" $YELLOW >&2
printf "$ONFAILURE_MESSAGE" $RESET | sed 's/^/ /' >&2
exit $FAILURE_TYPE
}
# inception
.dockerignore
Dockerfile
doc/Dockerfile
# build folders
build-cmake/
#### Docusaurus ####
# Dependencies
doc/docusaurus/node_modules
# Production
doc/docusaurus/build
# Generated files
doc/docusaurus/.docusaurus
doc/docusaurus/.cache-loader
doc/docusaurus/npm-debug.log*
doc/docusaurus/yarn-debug.log*
doc/docusaurus/yarn-error.log*
name: CI Builds
on: push
env:
DUNE_COPASI_USE_STATIC_DEPS: 'ON'
DUNE_COPASI_SD_EXECUTABLE: 'ON'
jobs:
linux:
name: Linux
runs-on: ubuntu-16.04
env:
CMAKE_INSTALL_PREFIX: '/opt/smelibs'
TERM: 'xterm-256color'
defaults:
run:
shell: bash
steps:
- name: Set OS
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 100
sudo apt-get install libncurses5-dbg
- uses: actions/checkout@v2
- name: Setup static dependencies
run: ./.ci/setup_static_deps $PWD/dune-copasi.opts
- name: Setup dune dependencies
run: ./.ci/setup_dune $PWD/dune-copasi.opts
- name: Build and Install
run: ./.ci/install $PWD/dune-copasi.opts
- name: Build and run tests
run: ./.ci/test $PWD/dune-copasi.opts
# - uses: actions/upload-artifact@v2
# with:
# path: ./artefacts/*
macos:
name: MacOS
runs-on: macos-10.15
env:
CMAKE_INSTALL_PREFIX: '/opt/smelibs'
MACOSX_DEPLOYMENT_TARGET: '10.14'
DUNE_USE_FALLBACK_FILESYSTEM: 'ON'
TERM: 'xterm-256color'
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- name: Setup static dependencies
run: ./.ci/setup_static_deps $PWD/dune-copasi.opts
- name: Setup dune dependencies
run: ./.ci/setup_dune $PWD/dune-copasi.opts
- name: Build and Install
run: ./.ci/install $PWD/dune-copasi.opts
- name: Build and run tests
run: ./.ci/test $PWD/dune-copasi.opts
# - uses: actions/upload-artifact@v2
# with:
# path: ./artefacts/*
win64:
name: Windows 64-bit
runs-on: windows-2019
env:
CMAKE_INSTALL_PREFIX: '/c/smelibs'
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v2
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake make git dos2unix
- name: Setup static dependencies
run: ./.ci/setup_static_deps $PWD/dune-copasi.opts
- name: Setup dune dependencies
run: ./.ci/setup_dune $PWD/dune-copasi.opts
- name: Build and Install
run: ./.ci/install $PWD/dune-copasi.opts
- name: Build and run tests
run: ./.ci/test $PWD/dune-copasi.opts
# - uses: actions/upload-artifact@v2
# with:
# path: ./artefacts/*
win32:
name: Windows 32-bit
runs-on: windows-2019
env:
CMAKE_INSTALL_PREFIX: '/c/smelibs'
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v2
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
update: true
install: mingw-w64-i686-gcc mingw-w64-i686-cmake make git dos2unix
- name: Setup static dependencies
run: ./.ci/setup_static_deps $PWD/dune-copasi.opts
- name: Setup dune dependencies
run: ./.ci/setup_dune $PWD/dune-copasi.opts
- name: Build and Install
run: ./.ci/install $PWD/dune-copasi.opts
- name: Build and run tests
run: ./.ci/test $PWD/dune-copasi.opts
# - uses: actions/upload-artifact@v2
# with:
# path: ./artefacts/*
# release:
# name: Upload Binaries to GitHub Release
# needs: [linux, macos, win64, win32]
# runs-on: ubuntu-18.04
# # upload binaries to github release if commit is tagged
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
# steps:
# - uses: actions/download-artifact@v2
# with:
# name: artifact
# path: binaries
# - name: Upload binaries to release
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: binaries/*
# tag: ${{ github.ref }}
# overwrite: true
# file_glob: true
......@@ -3,6 +3,8 @@ __pycache__/
*.py[cod]
*$py.class
build-cmake/
python/dune/copasi/cli/cmake_variables.py
#### Docusaurus ####
......
......@@ -3,8 +3,6 @@
stages:
- setup
- build
- unit_tests
- system_tests
- deploy
.default_tags: &default_tags
......@@ -16,11 +14,14 @@ stages:
- "dind"
.global_variables: &global_variables
DUNE_OPTIONS_FILE: /duneci/dune.opts
DUNECONTROL: dunecontrol
BASE_IMAGE_VERSION: v1.0
BASE_IMAGE_VERSION: v1.0.0
DUNE_COPASI_SD_EXECUTABLE: 'ON'
CPACK_GENERATORS: 'DEB'
CPACK_PACKAGE_DIRECTORY: $CI_PROJECT_DIR/tmp
.docker_variables: &docker_variables
DOCKER_BUILDKIT: 1
DOCKER_IMAGE: docker:19.03.1
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
......@@ -30,41 +31,29 @@ stages:
<<: *global_variables
TOOLCHAIN: gcc-8-17
DUNECI_OS: debian
DUNECI_BASE_IMAGE: ${CI_REGISTRY}/docker/ci/debian:10
DUNE_COPASI_BASE_IMAGE: ${CI_REGISTRY}/copasi/dune-copasi/dependencies:${DUNECI_OS}-${TOOLCHAIN}-${BASE_IMAGE_VERSION}
DEPLOY_LATEST: "true"
BASE_IMAGE: debian:10
DEPENDENCIES_IMAGE: ${CI_REGISTRY}/copasi/dune-copasi/dependencies:${DUNECI_OS}-${TOOLCHAIN}-${BASE_IMAGE_VERSION}
.debian_clang: &debian_clang
<<: *global_variables
TOOLCHAIN: clang-6-17
DUNECI_OS: debian
DUNECI_BASE_IMAGE: ${CI_REGISTRY}/docker/ci/debian:10
DUNE_COPASI_BASE_IMAGE: ${CI_REGISTRY}/copasi/dune-copasi/dependencies:${DUNECI_OS}-${TOOLCHAIN}-${BASE_IMAGE_VERSION}
.ubuntu_gcc: &ubuntu_gcc
<<: *global_variables
TOOLCHAIN: gcc-7-17
DUNECI_OS: ubuntu
DUNECI_BASE_IMAGE: ${CI_REGISTRY}/docker/ci/ubuntu:18.04
DUNE_COPASI_BASE_IMAGE: ${CI_REGISTRY}/copasi/dune-copasi/dependencies:${DUNECI_OS}-${TOOLCHAIN}-${BASE_IMAGE_VERSION}
.ubuntu_clang: &ubuntu_clang
<<: *global_variables
TOOLCHAIN: clang-6-17
DUNECI_OS: ubuntu
DUNECI_BASE_IMAGE: ${CI_REGISTRY}/docker/ci/ubuntu:18.04
DUNE_COPASI_BASE_IMAGE: ${CI_REGISTRY}/copasi/dune-copasi/dependencies:${DUNECI_OS}-${TOOLCHAIN}-${BASE_IMAGE_VERSION}
BASE_IMAGE: debian:10
DEPENDENCIES_IMAGE: ${CI_REGISTRY}/copasi/dune-copasi/dependencies:${DUNECI_OS}-${TOOLCHAIN}-${BASE_IMAGE_VERSION}
MASTER_IMAGE: "true"
.setup: &setup
image: ${DOCKER_IMAGE}
stage: setup
script:
- echo "$CI_REGISTRY_PASSWORD" | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY/copasi/dune-copasi
- docker build -f docker/dependencies.dockerfile
--build-arg BASE_IMAGE=${DUNECI_BASE_IMAGE}
- docker build
--build-arg BASE_IMAGE=${BASE_IMAGE}
--build-arg TOOLCHAIN=${TOOLCHAIN}
-t ${DUNE_COPASI_BASE_IMAGE} .
- docker push ${DUNE_COPASI_BASE_IMAGE}
--build-arg BUILDKIT_INLINE_CACHE=1
--target setup-env
-t ${DEPENDENCIES_IMAGE} .
- docker push ${DEPENDENCIES_IMAGE}
- docker logout $CI_REGISTRY/copasi/dune-copasi
rules:
- if: '$REBUILD_BASE_IMAGE'
......@@ -74,60 +63,49 @@ stages:
<<: *dind_docker_tags
.build: &build
image: ${DUNE_COPASI_BASE_IMAGE}
image: ${DEPENDENCIES_IMAGE}
stage: build
script:
- cd ..
- bash dune-copasi/.ci/build.sh
artifacts:
paths:
- build-cmake
expire_in: 30 mins
<<: *default_tags
.unit_tests: &unit_tests
image: ${DUNE_COPASI_BASE_IMAGE}
stage: unit_tests
script:
- echo 'CMAKE_FLAGS+=" -DCMAKE_BUILD_TYPE=Debug"' >> /duneci/cmake-flags/dune_copasi.opts
- cd ..
- bash dune-copasi/.ci/unit_tests.sh
artifacts:
paths:
- build-cmake/test
expire_in: 1 day
- ./.ci/install /duneci/dune.opts
- ./.ci/test /duneci/dune.opts
- mkdir -p packages
- mv tmp/dune-copasi-*-Runtime.deb packages/dune-copasi-runtime.deb
<<: *default_tags
.system_tests: &system_tests
image: ${DUNE_COPASI_BASE_IMAGE}
stage: system_tests
script:
- cd ..
- bash dune-copasi/.ci/system_tests.sh
artifacts:
paths:
- cd ..
- build-cmake/test
expire_in: 1 day
<<: *default_tags
- packages
expire_in: 1h
.deploy: &deploy
image: ${DOCKER_IMAGE}
stage: deploy
script:
# login into registry
- echo "$CI_REGISTRY_PASSWORD" | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY/copasi/dune-copasi
- DOCKER_TAG="${DUNECI_OS}-${TOOLCHAIN}-${CI_COMMIT_REF_NAME}"
- docker build -f docker/dune-copasi.dockerfile
--build-arg BASE_IMAGE=${DUNE_COPASI_BASE_IMAGE}
--build-arg BRANCH=${CI_COMMIT_REF_NAME}
-t $CI_REGISTRY/copasi/dune-copasi/dune-copasi:${DOCKER_TAG} .
- docker push $CI_REGISTRY/copasi/dune-copasi/dune-copasi:${DOCKER_TAG}
- DOCKER_DEPLOY_IMAGE=$CI_REGISTRY/copasi/dune-copasi/dune-copasi:${DOCKER_TAG}
# set directory to get packages from the image
- mkdir -p $CI_PROJECT_DIR/packages
# build final production image using packages from artifacts
- docker build
--build-arg PRODUCTION_BASE_IMAGE=${BASE_IMAGE}
--file docker/deploy.dockerfile
--tag ${DOCKER_DEPLOY_IMAGE} .
# push images into registry
- docker push ${DOCKER_DEPLOY_IMAGE}
# set alternative and simpler names
- |
if [ "$CI_COMMIT_BRANCH" == "latest" && $DEPLOY_LATEST ]; then
docker tag $CI_REGISTRY/copasi/dune-copasi/dune-copasi:${DOCKER_TAG} $CI_REGISTRY/copasi/dune-copasi/dune-copasi:latest
docker push $CI_REGISTRY/copasi/dune-copasi/dune-copasi:latest
if [[ ! -z "${MASTER_IMAGE}" ]]; then
DOCKER_TAG=${CI_REGISTRY}/copasi/dune-copasi/dune-copasi:${CI_COMMIT_REF_NAME}
docker tag ${DOCKER_DEPLOY_IMAGE} ${DOCKER_TAG}
docker push ${DOCKER_TAG}
if [[ "$CI_COMMIT_BRANCH" == "latest" ]]; then
DOCKER_TAG=${CI_REGISTRY}/copasi/dune-copasi/dune-copasi:latest
docker tag ${DOCKER_DEPLOY_IMAGE} ${DOCKER_TAG}
docker push ${DOCKER_TAG}
fi
fi
- docker logout $CI_REGISTRY/copasi/dune-copasi
- docker logout ${CI_REGISTRY}/copasi/dune-copasi
rules:
- if: '$CI_COMMIT_TAG'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
......@@ -148,63 +126,13 @@ build:debian_gcc:
dependencies:
- setup:debian_gcc
unit_tests:debian_gcc:
variables:
<<: *debian_gcc
<<: *unit_tests
dependencies:
- build:debian_gcc
system_tests:debian_gcc:
variables:
<<: *debian_gcc
<<: *system_tests
dependencies:
- build:debian_gcc
deploy:debian_gcc:
variables:
<<: *docker_variables
<<: *debian_gcc
<<: *deploy
dependencies:
- system_tests:debian_gcc
# # ubuntu gcc
# setup:ubuntu_gcc:
# variables:
# <<: *docker_variables
# <<: *ubuntu_gcc
# <<: *setup
# build:ubuntu_gcc:
# variables:
# <<: *ubuntu_gcc
# <<: *build
# dependencies:
# - setup:ubuntu_gcc
# unit_tests:ubuntu_gcc:
# variables:
# <<: *ubuntu_gcc
# <<: *unit_tests
# dependencies:
# - build:ubuntu_gcc
# system_tests:ubuntu_gcc:
# variables:
# <<: *ubuntu_gcc
# <<: *system_tests
# dependencies:
# - build:ubuntu_gcc
# deploy:ubuntu_gcc:
# variables:
# <<: *docker_variables
# <<: *ubuntu_gcc
# <<: *deploy
# dependencies:
# - system_tests:ubuntu_gcc
- build:debian_gcc
# debian clang
setup:debian_clang:
......@@ -220,53 +148,10 @@ build:debian_clang:
dependencies:
- setup:debian_clang
unit_tests:debian_clang:
variables:
<<: *debian_clang
<<: *unit_tests
dependencies:
- build:debian_clang
system_tests:debian_clang:
variables:
<<: *debian_clang
<<: *system_tests
dependencies:
- build:debian_clang
deploy:debian_clang:
variables:
<<: *docker_variables
<<: *debian_clang
<<: *deploy
dependencies:
- system_tests:debian_clang
# # ubuntu clang
# setup:ubuntu_clang:
# <<: *ubuntu_clang
# <<: *setup
# build:ubuntu_clang:
# <<: *ubuntu_clang
# <<: *build
# dependencies:
# - setup:ubuntu_clang
# unit_tests:ubuntu_clang:
# <<: *ubuntu_clang
# <<: *unit_tests
# dependencies:
# - build:ubuntu_clang
# system_tests:ubuntu_clang:
# <<: *ubuntu_clang
# <<: *system_tests
# dependencies:
# - build:ubuntu_clang
# deploy:ubuntu_clang:
# <<: *ubuntu_clang
# <<: *deploy
# dependencies:
# - system_tests:ubuntu_clang
- build:debian_clang
[submodule "dune/copasi/common/ghc"]
path = ext/ghc
url = https://github.com/gulrak/filesystem
language: cpp
matrix:
include:
# linux build
- os: linux
dist: xenial
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-9
- python-dev
- python-pip
- python-virtualenv
- python3
- python3-dev
- python3-pip
- python3-venv
# mac build
- os: osx
osx_image: xcode10.3
compiler: clang
before_install:
# DUNE will only compile for 10.14 - uses some C++17 not available in earlier osx versions...
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then export MACOSX_DEPLOYMENT_TARGET=10.14; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 100; fi
- gcc --version
- g++ --version
# download muparser, gmp and libtiff as static libraries
- wget "https://github.com/spatial-model-editor/sme_deps_common/releases/latest/download/sme_deps_common_$TRAVIS_OS_NAME.tgz"
- sudo tar xzvf sme_deps_common_$TRAVIS_OS_NAME.tgz -C /
- cd ..
install:
- echo 'CMAKE_FLAGS+=" -G '"'"'Unix Makefiles'"'"' "' >> dune.opts
- echo 'CMAKE_FLAGS+=" -DCMAKE_CXX_STANDARD=17"' >> dune.opts
- echo 'CMAKE_FLAGS+=" -DDUNE_PYTHON_VIRTUALENV_SETUP=1 -DDUNE_PYTHON_ALLOW_GET_PIP=1 "' >> dune.opts
- echo 'CMAKE_FLAGS+=" -DDUNE_PYTHON_VIRTUALENV_PATH='"$PWD"'/ext/dune-python-venv"' >> dune.opts
- echo 'CMAKE_FLAGS+=" -DCMAKE_DISABLE_FIND_PACKAGE_QuadMath=TRUE -DBUILD_TESTING=OFF"' >> dune.opts
- echo 'CMAKE_FLAGS+=" -DDUNE_USE_ONLY_STATIC_LIBS=ON -DCMAKE_BUILD_TYPE=Release"' >> dune.opts
- echo 'CMAKE_FLAGS+=" -DF77=true -DCMAKE_PREFIX_PATH=/opt/smelibs"' >> dune.opts
- echo 'CMAKE_FLAGS+=" -Dmuparser_INCLUDE_DIR:PATH=/opt/smelibs/include -Dmuparser_LIBRARIES:FILEPATH=opt/smelibs/lib/libmuparser.a"' >> dune.opts
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then echo 'CMAKE_FLAGS+=" -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3"' >> dune.opts; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then echo 'CMAKE_FLAGS+=" -DUSE_FALLBACK_FILESYSTEM=ON"' >> dune.opts ; fi
- echo 'MAKE_FLAGS="-j2 VERBOSE=1"' >> dune.opts
- export DUNE_OPTIONS_FILE="dune.opts"
- export DUNECONTROL=./dune-common/bin/dunecontrol
- echo "${DUNE_OPTIONS_FILE}"
# setup dependencies
- bash dune-copasi/.ci/setup.sh
script:
- bash dune-copasi/.ci/build.sh
after_script:
- bash dune-copasi/.ci/unit_tests.sh
- bash dune-copasi/.ci/system_tests.sh
# check dependencies of executable
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then otool -L $TRAVIS_BUILD_DIR/build-cmake/src/dune_copasi_md; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then ldd $TRAVIS_BUILD_DIR/build-cmake/src/dune_copasi_md; fi
notifications:
email: false
\ No newline at end of file
{
"cmake.configureOnOpen": true
}
\ No newline at end of file
......@@ -28,6 +28,46 @@ Types of changes
## [Unreleased] ([git-diff][Unreleased-diff])
## [1.0.0] ([git-diff][1.0.0-diff]) - 2021-02-11
### Added
- Custom membrane flux !30
- Skip intersection methods in local operators !36
- Parameters to control Newton's method !30
- Stepper interface to snap solution to a specific time !45
- Provide help message when executables are not used correctly !49
- Produce Debian Packages on the CI !49
- Installation is now divided on three components: `Runtime|Library|Development` !49
- Define a recommended dune options file [`dune-copasi.opts`](dune-copasi.opts) !49
- Versioned documentation !49
- Dependency on `pkg-config` !52
### Changed
- TIFF images are clamped instead of zeroed when evaluated outside its domain !47
- Produce versioned documentation !49
- Travis and Appveyor are replaced for GitHub Actions on `Linux|MacOS|Windows` !49
- Increment CMake required version to 3.13 !49
- Installed CMake project is now consumable by other CMake projects !49
- Vendor GHC with CMake instead of git submodules !49
- Increase vendored GHC version to 10.5 !49 & !51
- Force GHC usage whenever c++ filesystem cannot be found, else, optional !49
- CI scripts are improved to simplfy usage !49
- Simplify build and usage on docker containers !49
- Drastically reduce size of final docker container !49
- Improve performance on cases with no interaction between all species !43
- `dune-logging` and `dune-multidomaingrid` no longer require a COPASI namespace fork !53
### Removed
- Automatic flux between compartment components with same name !30
- Jacobian operator is managed by the stepper instead of the model !39
- Jacobian tests are improved and extended to cover more cases !39
- CMake module to find muparser, use `pkg-config` instead !52
### Fixed
- Finished and documented Installation procedure !49
- Wrong rounding on y pixels on TIFF file reads !47
- Improper vector allocation in multidomain intersections !39
- Final timestep reduction to reach `end_time` failed in adaptive stepper !43
- Infinite loop when final adaptive step failed !45
- Binary executables are now installed !49
- Support for shared libraries !54
## [0.3.0] ([git-diff][0.3.0-diff]) - 2020-10-07
### Added
- User documentation !28
......@@ -79,10 +119,14 @@ Types of changes
- [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
- Solver for reaction-diffusion systems in multiple compartments.
[Unreleased-diff]: https://gitlab.dune-project.org/copasi/dune-copasi/compare/v0.3.0...master
[Unreleased-diff]: https://gitlab.dune-project.org/copasi/dune-copasi/compare/v1.0.0...master
[1.0.0-diff]: https://gitlab.dune-project.org/copasi/dune-copasi/compare/v0.3.0...v1.0.0
[0.3.0-diff]: https://gitlab.dune-project.org/copasi/dune-copasi/compare/v0.2.0...v0.3.0
[0.2.0-diff]: https://gitlab.dune-project.org/copasi/dune-copasi/compare/v0.1.0...v0.2.0
[Unreleased]: https://gitlab.dune-project.org/copasi/dune-copasi/-/tree/master
[1.0.0]: https://gitlab.dune-project.org/copasi/dune-copasi/-/releases/v1.0.0
[0.3.0]: https://gitlab.dune-project.org/copasi/dune-copasi/-/releases/v0.3.0
[0.2.0]: https://gitlab.dune-project.org/copasi/dune-copasi/-/releases/v0.2.0
[0.1.0]: https://gitlab.dune-project.org/copasi/dune-copasi/-/releases/v0.1.0