Skip to content
Commits on Source (231)
......@@ -50,8 +50,8 @@ with target `setup-env`.
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.
`CPACK_GENERATORS` and `CPACK_PACKAGE_DIRECTORY` are set, the script will package the
library with the given generators (e.g. debian packages).
```bash
./install $PDW/../dune-copasi.opts
......@@ -61,10 +61,7 @@ library with the given generators.
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.
`unit` and `system`.
```bash
......
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
+++ b/dune/common/std/CMakeLists.txt
@@ -1,6 +1,7 @@
install(
FILES
apply.hh
+ functional.hh
make_array.hh
memory.hh
optional.hh
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 693bab6..770ba85 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -145,7 +145,7 @@ the command \"git submodule update --init --recursive\" in the dune-logging sour
dune-logging-fmt
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/dune/vendor/fmt>
- $<INSTALL_INTERFACE:dune/vendor/fmt>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/dune/vendor/fmt>
)
endif()
......@@ -2,11 +2,15 @@
# build and install
# used env variables
# DUNE_OPTIONS_FILE
# (optional) CPACK_GENERATORS
# (optional) CPACK_PACKAGE_DIRECTORY
# (optional) CODE_CHECKER_REPORT_PATH
# variables from DUNE_OPTIONS_FILE
# (optional) CMAKE_FLAGS
# (optional) SUDOCMD
# (optional) CPACK_GENERATORS
# (optional) CPACK_PACKAGE_DIRECTORY
set +e
......@@ -24,21 +28,16 @@ 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}/..
SOURCEDIR=`readlink -f ${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
......@@ -55,12 +54,18 @@ trap onfailure EXIT
mkdir $BUILD_PATH && cd $BUILD_PATH
echo "cmake $CMAKE_FLAGS $SOURCEDIR"
eval cmake $CMAKE_FLAGS $SOURCEDIR
eval CMAKE_EXPORT_COMPILE_COMMANDS=ON cmake $CMAKE_FLAGS $SOURCEDIR
$SUDOCMD cmake --build $BUILD_PATH --target install
if test "x$CODE_CHECKER_REPORT_PATH" != "x"; then
CodeChecker analyze $BUILD_PATH/compile_commands.json --config ${SOURCEDIR}/.codechecker.json --output $CODE_CHECKER_REPORT_PATH
CodeChecker parse --config ${SOURCEDIR}/.codechecker.json --trim-path-prefix ${SOURCEDIR} -e codeclimate $CODE_CHECKER_REPORT_PATH > $CODE_CHECKER_REPORT_PATH/gl-code-quality-report.json
else
$SUDOCMD cmake --build $BUILD_PATH --target install
for generator in $CPACK_GENERATORS; do
cpack -G $generator -B $CPACK_PACKAGE_DIRECTORY CPackConfig.cmake
done
for generator in $CPACK_GENERATORS; do
cpack -G $generator -B $CPACK_PACKAGE_DIRECTORY CPackConfig.cmake
done
fi
cd $SCRIPT_PATH
trap cleanup EXIT
......@@ -5,7 +5,6 @@
# variables from DUNE_OPTIONS_FILE
# (optional) SETUP_DUNE_TESTTOOLS
# (optional) SUDOCMD
# (optional) DUNE_VENDOR_FMT
set +e
......@@ -21,7 +20,6 @@ set -e
# 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
......@@ -45,7 +43,7 @@ cleanup() {
# 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_VARS+=" CMAKE_FLAGS CMAKE_INSTALL_PREFIX REPO BRANCH PATCHES RECURSIVE BUILD_PATH"
ONFAILURE_CMD="ls cleanup"
trap onfailure EXIT
......@@ -55,53 +53,34 @@ 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}_BRANCH=\"master\"
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\"
for module in functions uggrid typetree; do
eval SETUP_dune_${module}_BRANCH=\"master\"
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-latest\"
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_pdelab_BRANCH="feature/dune-assembler/main-multithreaded"
SETUP_dune_pdelab_REPO="https://gitlab.dune-project.org/pdelab/dune-pdelab.git"
SETUP_dune_multidomaingrid_BRANCH="releases/2.7"
SETUP_dune_multidomaingrid_BRANCH="master"
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"
SETUP_dune_common_BRANCH="1b79c9e4fe055ffa79e30b5b76989c4ebe30c606"
SETUP_dune_geometry_BRANCH="d45c81e18d940b4a0f755e64b9f3b67638508ada"
SETUP_dune_grid_BRANCH="70cd26d527b30ca2961e53b00f113f295f021f22"
SETUP_dune_uggrid_BRANCH="dec73a978754c6959dc9b8c34278979e9f6ba5bc"
SETUP_dune_istl_BRANCH="64f5f5184143f7a401b5e68a2ba76d9d3dd22570"
SETUP_dune_localfunctions_BRANCH="920cc8544401adde20b2fd6603a2050b810a4e31"
SETUP_dune_functions_BRANCH="664f68c63444ffd31537a57c5b12a6c40ed03da9"
SETUP_dune_multidomaingrid_BRANCH="7d04696469d62b36239d3d1101d9ac71ff247137"
SETUP_dune_typetree_BRANCH="962308509de2e67732afe5fe7e9c816ee16eec30"
SETUP_dune_pdelab_BRANCH="73f4c866b55f02c7b4bd0319bf304c5b01956bf3"
# 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
MODULES="common geometry uggrid grid typetree localfunctions istl functions multidomaingrid pdelab"
[ -z $DUNE_OPTIONS_FILE ] && ONFAILURE_MESSAGE+="Dune options file is not set!\n" && exit 1
......@@ -160,7 +139,8 @@ for module in $MODULES; do
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
git clone $RECURSIVE_ARG $REPO
git -C dune-$module checkout $BRANCH
# on windows, symlinks from git repos don't work
# msys git replaces symlinks with a text file containing the linked file location
......@@ -201,11 +181,11 @@ for module in $MODULES; do
export DUNE_CONTROL_PATH=$PWD
# configure, build, and install module
$DUNECONTROL --opts=${DUNE_OPTIONS_FILE} --only=dune-$module all
$DUNECONTROL --opts=${DUNE_OPTIONS_FILE} --only=dune-$module configure
$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
# since it could be a 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
......
......@@ -3,7 +3,7 @@
# download and install other dependences (from sme by Liam)
# variables from DUNE_OPTIONS_FILE
# OS_TARGET=linux|osx|win32|win64
# OS_TARGET=linux|osx|win32-mingw|win64-mingw
# CMAKE_INSTALL_PREFIX
# (optional) SUDOCMD
......@@ -40,13 +40,13 @@ 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
if [[ ! "$OS_TARGET" =~ ^(linux|osx|win32-mingw|win64-mingw)$ ]]; 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/latest/download/sme_deps_common_${OS_TARGET}.tgz"
DEPS_URL="https://github.com/spatial-model-editor/sme_deps_common/releases/download/2024.01.23/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
......@@ -65,9 +65,9 @@ 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}"
$SUDOCMD mv c/smelibs /c/
else
$SUDOCMD mv opt/smelibs/* "${CMAKE_INSTALL_PREFIX}"
$SUDOCMD mv opt/* /opt/
fi
# set the following flags in your dune opts file
......@@ -79,7 +79,7 @@ fi
# CMAKE_FLAGS+=" -DF77=true"
# be careful when adding several prefix paths, they have to be
# set in a semicolon separated list
# set in a semicolon separated list
# CMAKE_FLAGS+=" -DCMAKE_PREFIX_PATH='${CMAKE_PREFIX_PATH}' "
# ...or if you are using the dune-copasi.opts
......
......@@ -17,12 +17,11 @@ set -e
[ ! -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
TEST_SOURCEDIR=${SCRIPT_DIR}/../test
TUTORIAL_SOURCEDIR=${SCRIPT_DIR}/../doc
print_opts_file() {
cat "${DUNE_OPTIONS_FILE}"
......@@ -41,7 +40,7 @@ cleanup() {
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"
ONFAILURE_CMD="pwd ls cleanup"
trap onfailure EXIT
......@@ -55,8 +54,8 @@ 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
echo "cmake $DEBUG_CMAKE_FLAGS $TEST_SOURCEDIR"
eval cmake $DEBUG_CMAKE_FLAGS $TEST_SOURCEDIR
cmake --build . --target build_unit_tests
ctest -j4 -L "unit" --output-on-failure
......@@ -70,9 +69,25 @@ 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
echo "cmake $RELEASE_CMAKE_FLAGS $TEST_SOURCEDIR"
eval cmake $RELEASE_CMAKE_FLAGS $TEST_SOURCEDIR
cmake --build . --target build_system_tests
ctest -j4 -L "DUNE_SYSTEMTEST" --output-on-failure
ctest -j4 -L "system" --output-on-failure
echo $GREEN "============================ Tutorial Tests ============================" $RESET
BUILD_PATH=/tmp/build-system-tutorials
[[ -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 $TUTORIAL_SOURCEDIR"
eval cmake $RELEASE_CMAKE_FLAGS $TUTORIAL_SOURCEDIR
cmake --build . --target build_tutorial_tests
ctest -j4 -L "tutorial" --output-on-failure
cd $SCRIPT_PATH
trap cleanup EXIT
---
BasedOnStyle: Mozilla
\ No newline at end of file
BasedOnStyle: Mozilla
ColumnLimit: '100'
...
---
FormatStyle: file
UseColor: true
HeaderFilterRegex: 'dune/copasi/*'
Checks: '*,-llvmlibc-*,-fuchsia-*,-modernize-use-trailing-return-type,-llvm-header-guard'
{
"analyze": [
"--analyzers=clang-tidy",
"--file=*/dune-copasi/*.cc"
],
"parse": [
"--file=*/dune-copasi/*"
]
}
test/data/** filter=lfs diff=lfs merge=lfs -text
doc/docusaurus/versioned_docs/** filter=lfs diff=lfs merge=lfs -text
......@@ -4,25 +4,45 @@ on: push
env:
DUNE_COPASI_USE_STATIC_DEPS: 'ON'
DUNE_COPASI_SD_EXECUTABLE: 'ON'
BUILD_SHARED_LIBS: 'OFF'
CMAKE_DISABLE_FIND_PACKAGE_MPI: 'ON'
CMAKE_DISABLE_FIND_PACKAGE_parafields: 'ON'
DUNE_COPASI_DISABLE_FETCH_PACKAGE_parafields: 'ON'
DUNE_ENABLE_PYTHONBINDINGS: 'OFF'
DUNE_PDELAB_ENABLE_TRACING: 'OFF'
jobs:
linux:
name: Linux
runs-on: ubuntu-16.04
runs-on: ubuntu-20.04
env:
CMAKE_INSTALL_PREFIX: '/opt/smelibs'
CMAKE_PREFIX_PATH: '/opt/smelibs'
CMAKE_CXX_FLAGS: "'-fvisibility=hidden -D_GLIBCXX_USE_TBB_PAR_BACKEND=0 -DNDEBUG'"
MAKE_OPTIONS: "-j4"
DUNE_COPASI_GRID_DIMENSIONS: '"2;3"'
CC: "clang"
CXX: "clang++"
TERM: 'xterm-256color'
defaults:
run:
shell: bash
steps:
- name: Set OS
- name: Add llvm repo for clang 17 & install
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
sudo wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-17 main"
sudo apt update -yy
sudo apt install -yy clang-17
- name: Set clang version
run: |
sudo update-alternatives --remove-all clang || echo "nothing to remove"
sudo update-alternatives --remove-all clang++ || echo "nothing to remove"
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-17 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-17 100
- uses: actions/checkout@v4
with:
lfs: true
- name: Setup static dependencies
run: ./.ci/setup_static_deps $PWD/dune-copasi.opts
- name: Setup dune dependencies
......@@ -31,23 +51,27 @@ jobs:
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
runs-on: macos-13
env:
CMAKE_INSTALL_PREFIX: '/opt/smelibs'
MACOSX_DEPLOYMENT_TARGET: '10.14'
DUNE_USE_FALLBACK_FILESYSTEM: 'ON'
CMAKE_PREFIX_PATH: '/opt/smelibs'
MAKE_OPTIONS: "-j3"
DUNE_COPASI_GRID_DIMENSIONS: '"2;3"'
MACOSX_DEPLOYMENT_TARGET: '11'
TERM: 'xterm-256color'
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "14.3"
- uses: actions/checkout@v4
with:
lfs: true
- name: Setup static dependencies
run: ./.ci/setup_static_deps $PWD/dune-copasi.opts
- name: Setup dune dependencies
......@@ -56,80 +80,31 @@ jobs:
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
runs-on: windows-2022
env:
CMAKE_INSTALL_PREFIX: '/c/smelibs'
CMAKE_PREFIX_PATH: '/c/smelibs'
MAKE_OPTIONS: "-j4"
DUNE_COPASI_GRID_DIMENSIONS: '"2;3"'
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v2
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
msystem: UCRT64
update: true
install: mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake make git dos2unix
install: mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-cmake make git mingw-w64-ucrt-x86_64-git-lfs dos2unix
- name: Clone repo
run: pwd && ls && git lfs install && git clone -b ${{ github.head_ref || github.ref_name }} https://github.com/${{ github.repository }} . && git lfs pull && ls
- name: Setup static dependencies
run: ./.ci/setup_static_deps $PWD/dune-copasi.opts
run: pwd && ls && ./.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
......@@ -4,6 +4,11 @@ __pycache__/
*$py.class
build-cmake/
build-em/*
!build-em/.gitkeep
dist/
dune-copasi.js
dune-copasi.wasm
python/dune/copasi/cli/cmake_variables.py
......@@ -22,3 +27,13 @@ doc/docusaurus/.cache-loader
doc/docusaurus/npm-debug.log*
doc/docusaurus/yarn-debug.log*
doc/docusaurus/yarn-error.log*
# editor files
*.swo
*.swp
test/build/
# editor files
*.swo
*.swp
......@@ -2,156 +2,310 @@
stages:
- setup
- check
- build
- codequality
- deploy
.default_tags: &default_tags
tags:
- "cores:4"
workflow:
auto_cancel:
on_new_commit: interruptible
rules:
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
when: never
- when: always
.dind_docker_tags: &dind_docker_tags
tags:
- "dind"
default:
interruptible: true
tags: [dune-copasi]
.global_variables: &global_variables
variables:
DUNECONTROL: dunecontrol
BASE_IMAGE_VERSION: v1.1.0
DUNE_COPASI_SD_EXECUTABLE: 'ON'
CPACK_GENERATORS: 'DEB'
CPACK_PACKAGE_DIRECTORY: $CI_PROJECT_DIR/tmp
CMAKE_GENERATOR: "Ninja"
PACKAGE_REGISTRY: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/dune-copasi
MASTER_IMAGE: debian:bookworm
BASE_IMAGE_VERSION:
value: "v2.0.0"
options:
- "v2.0.0" # Main dependecy base image
- "v2.0.0-tmp" # Temporary (one time testing)
description: "Key to tag images in the registry. Use '*-tmp' key to try out changes that need to rebild the dependencies image"
FORCE_REBUILD_BASE_IMAGE:
value: "false"
options:
- "true"
- "false"
description: "Force rebuild of base image"
.docker_variables: &docker_variables
DOCKER_BUILDKIT: 1
DOCKER_IMAGE: docker:19.03.1
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
.debian_gcc: &debian_gcc
<<: *global_variables
TOOLCHAIN: gcc-8-17
.debian_base: &debian_base
DUNECI_OS: debian
BASE_IMAGE: debian:10
DEPENDENCIES_IMAGE: ${CI_REGISTRY}/copasi/dune-copasi/dependencies:${DUNECI_OS}-${TOOLCHAIN}-${BASE_IMAGE_VERSION}
BASE_IMAGE: debian:bookworm
.debian_clang: &debian_clang
<<: *global_variables
TOOLCHAIN: clang-6-17
DUNECI_OS: debian
BASE_IMAGE: debian:10
<<: *debian_base
CPACK_GENERATORS: 'DEB'
CPACK_PACKAGE_DIRECTORY: $CI_PROJECT_DIR/tmp
TOOLCHAIN: clang-17
DEPENDENCIES_IMAGE: ${CI_REGISTRY}/copasi/dune-copasi/dependencies:${DUNECI_OS}-${TOOLCHAIN}-${BASE_IMAGE_VERSION}
.debian_emscripten: &debian_emscripten
<<: *debian_base
CPACK_GENERATORS: 'DEB'
CPACK_PACKAGE_DIRECTORY: $CI_PROJECT_DIR/tmp
TOOLCHAIN: emscripten-3.1.51
DEPENDENCIES_IMAGE: ${CI_REGISTRY}/copasi/dune-copasi/dependencies:${DUNECI_OS}-${TOOLCHAIN}-${BASE_IMAGE_VERSION}
MASTER_IMAGE: "true"
.setup: &setup
.deploy_rules: &deploy_rules
rules:
- if: '$CI_COMMIT_TAG'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
- if: '$CI_COMMIT_BRANCH == "latest"'
.build_rules: &build_rules
rules:
- !reference [.deploy_rules, rules]
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- src/**/*
- dune/**/*
- dune-copasi.opts
- cmake
- CMakeLists.txt
- docker/*.dockerfile
.update_version: &update_version
before_script:
- |
if [ -z "$CI_COMMIT_TAG" ]; then
./util/version_handler.py --replace-prerelease="git${CI_COMMIT_SHORT_SHA:-0}" --replace-build="dune.gitlab.${CI_JOB_ID:-0}" --update-all
else
./util/version_handler.py --override-version ${CI_COMMIT_TAG:1} --update-all
fi
.setup_exec: &setup_exec
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
- echo "$CI_REGISTRY_PASSWORD" | podman login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY/copasi/dune-copasi
- podman build
--build-arg BASE_IMAGE=${BASE_IMAGE}
--build-arg TOOLCHAIN=${TOOLCHAIN}
--build-arg BUILDKIT_INLINE_CACHE=1
--target setup-env
-t ${DEPENDENCIES_IMAGE} .
- docker push ${DEPENDENCIES_IMAGE}
- docker logout $CI_REGISTRY/copasi/dune-copasi
- podman push ${DEPENDENCIES_IMAGE}
- podman logout $CI_REGISTRY/copasi/dune-copasi
rules:
- if: '$REBUILD_BASE_IMAGE'
- if: '$CI_COMMIT_TAG'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
- if: '$CI_COMMIT_BRANCH == "latest"'
<<: *dind_docker_tags
- !reference [.deploy_rules, rules]
- if: '$FORCE_REBUILD_BASE_IMAGE == "true"'
.setup_wasm: &setup_wasm
image: ${DOCKER_IMAGE}
stage: setup
script:
- echo "$CI_REGISTRY_PASSWORD" | podman login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY/copasi/dune-copasi
- podman build
--format docker
--build-arg BASE_IMAGE=${BASE_IMAGE}
--build-arg BUILDKIT_INLINE_CACHE=1
--target setup-env
-t ${DEPENDENCIES_IMAGE}
-f docker/emscripten.dockerfile .
- podman push ${DEPENDENCIES_IMAGE}
- podman logout $CI_REGISTRY/copasi/dune-copasi
rules:
- !reference [.deploy_rules, rules]
- if: '$FORCE_REBUILD_BASE_IMAGE == "true"'
.build: &build
image: ${DEPENDENCIES_IMAGE}
stage: build
<<: *update_version
script:
- ./.ci/install /duneci/dune.opts
- ./.ci/test /duneci/dune.opts
- ./.ci/install dune-copasi.opts
- ./.ci/test dune-copasi.opts
- mkdir -p packages
- mv tmp/dune-copasi-*-Runtime.deb packages/dune-copasi-runtime.deb
<<: *default_tags
artifacts:
paths:
- packages
expire_in: 1h
rules:
- !reference [.build_rules, rules]
.codequality: &codequality
image: ${DEPENDENCIES_IMAGE}
stage: codequality
script:
- CODE_CHECKER_REPORT_PATH=$CI_PROJECT_DIR/code_checker_report ./.ci/install dune-copasi.opts
artifacts:
reports:
codequality: $CI_PROJECT_DIR/code_checker_report/gl-code-quality-report.json
rules:
- !reference [.build_rules, rules]
.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
- echo "$CI_REGISTRY_PASSWORD" | podman login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY/copasi/dune-copasi
- DOCKER_TAG="${DUNECI_OS}-${TOOLCHAIN}-${CI_COMMIT_REF_NAME}"
- DOCKER_DEPLOY_IMAGE=$CI_REGISTRY/copasi/dune-copasi/dune-copasi:${DOCKER_TAG}
# set directory to get packages from the image
# set directory to get packages within the image (prepared by build job)
- mkdir -p $CI_PROJECT_DIR/packages
# build final production image using packages from artifacts
- docker build
- podman 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
- podman push ${DOCKER_DEPLOY_IMAGE}
# set alternative and simpler names for a master image
- |
if [[ ! -z "${MASTER_IMAGE}" ]]; then
if [[ "${MASTER_IMAGE}" == "${BASE_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}
podman tag ${DOCKER_DEPLOY_IMAGE} ${DOCKER_TAG}
podman 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}
podman tag ${DOCKER_DEPLOY_IMAGE} ${DOCKER_TAG}
podman push ${DOCKER_TAG}
fi
fi
- docker logout ${CI_REGISTRY}/copasi/dune-copasi
- podman logout ${CI_REGISTRY}/copasi/dune-copasi
rules:
- if: '$CI_COMMIT_TAG'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
- if: '$CI_COMMIT_BRANCH == "latest"'
<<: *dind_docker_tags
- !reference [.deploy_rules, rules]
# debian gcc
setup:debian_gcc:
codespell:
variables:
<<: *docker_variables
<<: *debian_gcc
<<: *setup
<<: *debian_clang
stage: check
image: ${DEPENDENCIES_IMAGE}
script:
- codespell
--skip="./doc/docusaurus/yarn.lock,./.git/**/*"
--ignore-words-list="warn"
build:debian_gcc:
config_format:
variables:
<<: *debian_gcc
<<: *build
dependencies:
- setup:debian_gcc
<<: *debian_clang
stage: check
image: ${DEPENDENCIES_IMAGE}
script:
- ./util/validate_json.py -j doc/docusaurus/docs/assets/config_opts.json -s util/config_opts_schema.json
deploy:debian_gcc:
setup_exec:debian_clang:
variables:
<<: *docker_variables
<<: *debian_gcc
<<: *deploy
<<: *debian_clang
<<: *setup_exec
build_exec:debian_clang:
variables:
DUNE_COPASI_DISABLE_FETCH_PACKAGE_parafields: 'OFF'
<<: *debian_clang
<<: *build
dependencies:
- build:debian_gcc
- setup_exec:debian_clang
# debian clang
setup:debian_clang:
codequality:debian_clang:
variables:
<<: *docker_variables
<<: *debian_clang
<<: *setup
<<: *codequality
dependencies:
- setup_exec:debian_clang
build:debian_clang:
deploy_deb:debian_clang:
image: ${DEPENDENCIES_IMAGE}
variables:
<<: *debian_clang
<<: *build
stage: deploy
script:
- |
VERSION=$(./util/version_handler.py)
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file packages/dune-copasi-runtime.deb "${PACKAGE_REGISTRY}/${VERSION}/dune-copasi-runtime.deb"
dependencies:
- setup:debian_clang
- build_exec:debian_clang
rules:
- !reference [.deploy_rules, rules]
deploy:debian_clang:
deploy_docker:debian_clang:
variables:
<<: *docker_variables
<<: *debian_clang
<<: *deploy
dependencies:
- build:debian_clang
- build_exec:debian_clang
setup_wasam:debian_emscripten:
variables:
<<: *docker_variables
<<: *debian_emscripten
<<: *setup_wasm
build_wasm:debian_emscripten:
variables:
CPACK_PACKAGE_DIRECTORY: $CI_PROJECT_DIR/tmp
<<: *debian_emscripten
dependencies:
- setup_wasam:debian_emscripten
image: ${DEPENDENCIES_IMAGE}
stage: build
<<: *update_version
script:
- source /duneci/modules/emsdk/emsdk_env.sh && ./.ci/install $DUNE_OPTS_FILE
- mkdir -p packages
- mv /duneci/install/bin/dune-copasi.js /duneci/install/bin/dune-copasi.wasm packages
artifacts:
paths:
- packages
expire_in: 1h
rules:
- !reference [.build_rules, rules]
deploy_wasm:debian_emscripten:
image: ${DEPENDENCIES_IMAGE}
variables:
<<: *debian_emscripten
stage: deploy
<<: *update_version
dependencies:
- build_wasm:debian_emscripten
rules:
- !reference [.deploy_rules, rules]
script:
- |
cd npm
mv $CI_PROJECT_DIR/packages/dune-copasi.* .
echo "@copasi:registry=https://${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/" > .npmrc
echo "//${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN}" >> .npmrc
if [ -z "$CI_COMMIT_TAG" ]; then
npm publish --tag canary
else
npm publish --tag latest
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
npm publish --tag latest --access public
fi
deploy:documentation:
image: ${DEPENDENCIES_IMAGE}
variables:
<<: *debian_emscripten
GIT_STRATEGY: none
stage: deploy
script:
- curl -s --head --request GET https://${CI_COMMIT_REF_SLUG}--dune-copasi.netlify.app | grep "HTTP/2 404" 2> /dev/null || EXIT=$?
- test ${EXIT} -eq 1
environment:
name: documentation/${CI_COMMIT_REF_NAME}
url: https://${CI_COMMIT_REF_SLUG}--dune-copasi.netlify.app
allow_failure: true
rules:
- !reference [.deploy_rules, rules]
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- doc/**/*
......@@ -12,7 +12,7 @@ _Fill this in_
- [ ] Added/Updated tests
- [ ] Added/Updated documentation
- [ ] Pipelines passing <!-- please check for new warnings -->
<!-- change all occurences of <branch> for your branch name and uncomment
<!-- change all occurrences of <branch> for your branch name and uncomment
- [ ] [![Build Status](https://gitlab.dune-project.org/copasi/dune-copasi/badges/<branch>/pipeline.svg)](https://gitlab.dune-project.org/copasi/dune-copasi/pipelines)
- [ ] [![Build Status](https://travis-ci.org/dune-copasi/dune-copasi.svg?branch=<branch>)](https://travis-ci.org/dune-copasi/dune-copasi/branches)
- [ ] [https://ci.appveyor.com/api/projects/status/e7w7u5dt50kue5sb/branch/<branch>?svg=true](https://ci.appveyor.com/api/projects/status/e7w7u5dt50kue5sb/branch/<branch>?svg=true)
......@@ -41,7 +41,7 @@ Briefly explain __how__ you achieved the proposal of the task.
MR are supposed to evolve with code.
IMPORTANT: Make sure to set the merge request as Work In Progress (WIP) or Draft
until you want to get the MR to be reviewed by a mantainer.
until you want to get the MR to be reviewed by a maintainer.
It is not necessary to fill everything while the MR is in WIP. Feel free to fill
the required information as you get the feature ready by editing the initial
......
{
"cmake.configureOnOpen": true
}
\ No newline at end of file
......@@ -28,6 +28,119 @@ Types of changes
## [Unreleased] ([git-diff][Unreleased-diff])
## [2.0.0] ([git-diff][2.0.0-diff]) - 2024-03-26
_**Note**: This version is a complete re-write of the library based on a custom version of PDELab tailored for this module. Thus, this changelog does not make much sense in comparison to version [1.1.0]. Instead, the following entries are written with respect to the first refactor from [1.1.0] made on !83._
### Refactor
* Allows different parser backends: [muparser](https://beltoforion.de/en/muparser/), [exprtk](https://github.com/ArashPartow/exprtk), and [SymEngine](https://github.com/symengine/symengine) !83
* Adds constants, (lambda) function, and [random fields](https://github.com/parafields/parafields-core) definitions within the parsers !83
* Re-implementation of local operator: huge performance improvements !83
* Adds tensor cross-diffusion, storage, velocity, and external boundary terms !83
* Allows for volume coupling between compartments !83
* Splits the subdomain and the compartment concepts. Now compartments with no entities or no components are perfectly possible !83
* Uses new basis functions from dune-pdelab that allows native usage of multi-domains (branch: features/dune-assembler/main) !83
* Extends compatibility of tiff images to different bit sizes !83
* Adds monitoring (info, warning and error) of variables with new generic reduce operators !83
* Switches logging from dune-logging to [spdlog](https://github.com/gabime/spdlog) !83
* Designed to be thread-safe, although is not entirely yet implemented !83
* Adds tracing capabilities with [perfetto](https://perfetto.dev/) !83
* Allows Selection of between direct and sparse solvers, and matrix free operators !83
* Allows to print matrix layout in a SVG file !83
* Unifies the executable for different dimensions and different degrees of freedom layouts !83
* Improves command line interface !83
### Added
- Docusaurus now upgrades latest `canary` wasm binary automatically !186
- Hierarchical ISTL solvers and preconditioners in a dynamic registry !156
- Initial web interface for Wasm executable !170
- Deploy NPM packages to GitLab registry !179
- Tutorial and test on Cardiac Electrophysiology simulations !157
- Grid cell data !175
- Push CI artifacts to the GitLab registry !169 !173
- Test more complicated cases !158
- Job to build Wasm binaries in the CI !150
- Math expressions with only numbers as scientific notation don't need a parser !154
- Allow underscores in parser function arguments !152
- Make multi-threading optional !149
- Compile 2D and 3D in GitHub Actions !141
- Customization point on grid axis names !139
- Diagnostic information on SymEngine compilation failure !134
- Test on pattern generation !132
- Multi-threaded assembly !98
- Allow arbitrary number of functions in ExprTk !148
- Codequality check on the CI !123
- LLVM visitor for SymEngine !121
- Throw meaningful error message when config file is empty !119
- Diagnostic information on ExprTk compilation failure !115
- Command line help information !107 !120 !138
- Interpolation for 1D functions !102
- Initial value to reuction operations !100
- Code spelling to the CI !88
- Helper constraints for function spaces !87
- Support libc++ and reduce minimum required standard from C++23 to C++20 !84
- Show error when config file does not exist !86
- ~~Doxygen documentation is now deployed to Netlify !73~~ (reverted on !176)
### Changed
- Update docusaurus documentation to latest changes !176 !178 !88
- Math parsers now can only take move only functions !187
- Reduce operations now receive one less argument !184
- Reorganize files and add `DiffusionReaction` namespace !183
- Use grid leaf view instead of level 0 grid view for grid cell data !177
- Author email address !181
- Improve support for Wasm binaries !170 !182
- Move configuration options to a JSON file and use schema validator on it !174
- Use Debian Bookworm in the CI !171
- Conditinally test possion config if ExprTk is available !168
- Use (faster) integer based multi-domain grid !165
- Simplify CMake usage !161 !162 !163
- Improve version handler !159
- Improve local basis cache to also handle intersections !145
- Improve log error on failure !136
- How to use constraints !135
- Update docusaurus to version `3.0.0` !124
- Cleanup of the build system files !118
- Cleanup the CI installation scripts !110
- Make options consistent with respect to file inputs `--*.path=/path/to/file` !109
- Use `PDELab::Execution` to express (possible) concurrency !108
- Use newer commit on `parafields-core` !105
- Improve implementation of muParser and ExprTk parsers !96
- Update docusaurus to version `2.0.0-alpha.75` !72
### Fixed
- Missing CMake installation of Hierarchical ISTL solvers (from !156) !183
- Boundary constraints were handled incorrectly !167
- Coloring option for multi-threading was swapped with micro-locks !166
- Remove wrong definition of maximum number of ExpTk functions !130
- Wrong definition for SuiteSparse library !144
- Missing user in Dockerfile !153 !155
- ~~Freeze `dune-grid` dependency !147~~ (reverted by !164)
- Use the keyword `no_value` to identify special values in the parsers !140
- Inheritance of `parser_context.parser_type` !133
- Entries per row estimate for pattern creation !127
- Use `NDEBUG` compiler definition on release build !131
- Compatibility issue with {fmt} 10.2 !125
- Duplicated output on reduction algorithms !117
- Testing in the CI !114
- Correct construction on parser contexts !116
- Compatibility with XCode and Msys !111
- Consistent use of `struct` across different headers !104
- Unused function keywords on SymEngine where throwing unnecessary errors !101
- Deprecation warning on SVG writer !97
- Compile final executable with different parsers !95
- CMake problems on target installation !94
- Support for {fmt} >= 9.0.0 !90 !91 !93 !129
- Docker image now uses `dune-copas` executable instead of `dune-copasi-[sd|md]` !91
- CI jobs now passes since the re-write !89
- Solver on linear problems was wrongly reused !85
### Removed
- Unused header files from version [1.1.0] !183
- Dependency on `dune-testtools` !122
- Inherited `parafield-core` tests !112
- Fallback for `std::filesystem` !94
### Security
- Update `follow-redirects` in web documentation !126
## [1.1.0] ([git-diff][1.1.0-diff]) - 2021-04-29
### Added
- Dune options file receives `CMAKE_OPTIONS` and `MAKE_OPTIONS` !60
......@@ -66,7 +179,7 @@ Types of changes
- 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
- CI scripts are improved to simplify 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
......@@ -136,7 +249,8 @@ 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/v1.1.0...master
[Unreleased-diff]: https://gitlab.dune-project.org/copasi/dune-copasi/compare/v2.0.0...master
[2.0.0-diff]: https://gitlab.dune-project.org/copasi/dune-copasi/compare/v1.1.0...v2.0.0
[1.1.0-diff]: https://gitlab.dune-project.org/copasi/dune-copasi/compare/v1.0.0...v1.1.0
[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
......
cmake_minimum_required(VERSION 3.13)
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
project(dune-copasi CXX)
include(GNUInstallDirs)
cmake_policy(SET CMP0074 NEW)
if(POLICY CMP0087)
cmake_policy(SET CMP0087 OLD)
endif()
# define cmake options
option(DUNE_COPASI_SD_EXECUTABLE
"Build SingleDomain executable by default"
OFF
)
option(DUNE_COPASI_SD_LIBRARY
"Include precompiled SingleDomain objects in dune-copasi library (optional)"
${DUNE_COPASI_SD_EXECUTABLE}
)
option(DUNE_COPASI_MD_EXECUTABLE
"Build MultiDimain executable by default"
ON
)
option(DUNE_COPASI_MD_LIBRARY
"Include precompiled MultiDimain objects in dune-copasi library (optional)"
${DUNE_COPASI_MD_EXECUTABLE}
)
option(DUNE_COPASI_COMPILE_3D
"Compile 3D cases in libraries and executables"
OFF
)
########## Setup dependencies ##########
# find dune dependencies
......@@ -45,157 +16,109 @@ dune_project()
# make sure to find and install our own cmake modules
add_subdirectory(cmake/modules)
# find specific dune-copasi dependencies
find_package(muparser REQUIRED)
find_package(TIFF REQUIRED)
find_package(Filesystem)
########## Include other scripts ##########
# if standard C++ filesystem is not found, using a fallback is mandatory
include(CMakeDependentOption)
cmake_dependent_option(DUNE_USE_FALLBACK_FILESYSTEM
"Use bundled std::filesystem alternative (enable this for macOS older than 10.15)" OFF
"Filesystem_FOUND" ON
)
# include header files
add_subdirectory(dune)
if(DUNE_USE_FALLBACK_FILESYSTEM)
# let's use ghc_filesystem
find_package(ghc_filesystem QUIET)
# ... library not installed, we provide it from git
if (NOT ghc_filesystem_FOUND)
include(FetchContent)
message("-- Declaring GHC Filesystem")
FetchContent_Declare(
ghc_filesystem
GIT_REPOSITORY https://github.com/gulrak/filesystem.git
GIT_TAG 0f6f0af4b42480ad5e0e4c033e5c37659842c252
)
if(NOT ghc_filesystem_POPULATED)
message("-- Populating GHC Filesystem")
FetchContent_Populate(ghc_filesystem)
add_subdirectory("${ghc_filesystem_SOURCE_DIR}" "${ghc_filesystem_BINARY_DIR}")
endif()
endif()
endif()
# source files for final libraries and executables
add_subdirectory(src)
########## Setup dependency target ##########
# create a target to gather all dependencies
add_library(dune-copasi-deps INTERFACE)
target_link_libraries(dune-copasi-deps INTERFACE muparser::muparser ${DUNE_LIBS})
# get properties defined by dune macros
get_property(all_incs GLOBAL PROPERTY ALL_PKG_INCS)
get_property(all_defs GLOBAL PROPERTY ALL_PKG_DEFS)
get_property(all_opts GLOBAL PROPERTY ALL_PKG_OPTS)
get_property(all_libs GLOBAL PROPERTY ALL_PKG_LIBS)
# ...apply them to the dependency target
target_include_directories(dune-copasi-deps INTERFACE ${all_incs})
target_compile_definitions(dune-copasi-deps INTERFACE ${all_defs})
target_compile_options(dune-copasi-deps INTERFACE ${all_opts})
target_link_libraries(dune-copasi-deps INTERFACE ${all_libs})
# Set up filesystem. Where do we get it from?
if(DUNE_USE_FALLBACK_FILESYSTEM)
# and add ghc_filesystem to our filesystem target
target_link_libraries(dune-copasi-deps INTERFACE ghcFilesystem::ghc_filesystem)
target_compile_definitions(dune-copasi-deps INTERFACE DUNE_USE_FALLBACK_FILESYSTEM)
else()
# ... else we don't need a back up. Link agaist standard library
target_link_libraries(dune-copasi-deps INTERFACE std::filesystem)
endif()
# documentation files
add_subdirectory(doc)
########## Create main targets ##########
########## Setup config file ##########
# create main library target
add_library(dune-copasi)
set_target_properties(dune-copasi PROPERTIES LIBRARY_OUTPUT_NAME dunecopasi)
set_target_properties(dune-copasi PROPERTIES ARCHIVE_OUTPUT_NAME dunecopasi)
target_link_libraries(dune-copasi PUBLIC dune-copasi-deps PRIVATE TIFF::TIFF)
# include targets file in config file
set(DUNE_CUSTOM_PKG_CONFIG_SECTION "${DUNE_CUSTOM_PKG_CONFIG_SECTION}
set(DUNE_COPASI_GRID_DIMENSIONS ${DUNE_COPASI_GRID_DIMENSIONS})
set(DUNE_COPASI_PARSER_LIST ${DUNE_COPASI_PARSER_LIST})
# ensure dune cmake modules are found and used
set(PREVIOUS_CMAKE_MODULE_PATH \${CMAKE_MODULE_PATH})
list(PREPEND CMAKE_MODULE_PATH \"\${dune-copasi_MODULE_PATH}\")
# create executable targets
if(DUNE_COPASI_SD_EXECUTABLE)
add_executable(singledomain-exec)
endif()
if(DUNE_COPASI_MD_EXECUTABLE)
add_executable(multidomain-exec)
endif()
include(CMakeFindDependencyMacro)
")
########## Include other scripts ##########
foreach(module ${ALL_DEPENDENCIES})
if(${${module}_FOUND})
set(DUNE_CUSTOM_PKG_CONFIG_SECTION "${DUNE_CUSTOM_PKG_CONFIG_SECTION}
find_dependency(${module} REQUIRED)
list(APPEND CMAKE_MODULE_PATH \"\${${module}_MODULE_PATH}\")")
endif()
endforeach()
# include header files
add_subdirectory(dune)
# include main library set up
add_subdirectory(lib)
if(TARGET MPI::MPI_C)
set(DUNE_CUSTOM_PKG_CONFIG_SECTION "${DUNE_CUSTOM_PKG_CONFIG_SECTION}
find_dependency(MPI 3.0 REQUIRED COMPONENTS C)")
endif()
# source files for final libraries and executables
add_subdirectory(src)
set(DUNE_CUSTOM_PKG_CONFIG_SECTION "${DUNE_CUSTOM_PKG_CONFIG_SECTION}
find_dependency(TIFF REQUIRED)
find_dependency(spdlog REQUIRED)
find_dependency(fmt REQUIRED)
find_dependency(TBB CONFIG REQUIRED)")
# documentation files
add_subdirectory(doc)
if(TARGET METIS::METIS)
set(DUNE_CUSTOM_PKG_CONFIG_SECTION "${DUNE_CUSTOM_PKG_CONFIG_SECTION}
find_dependency(METIS REQUIRED)")
endif()
# finalize the dune project: Generate and install config.h, cmake target and version file
finalize_dune_project(GENERATE_CONFIG_H_CMAKE)
target_compile_definitions(dune-copasi INTERFACE HAVE_DUNE_COPASI_CONFIG_H)
if(TARGET Dune::Wrapper::SymEngine)
set(DUNE_CUSTOM_PKG_CONFIG_SECTION "${DUNE_CUSTOM_PKG_CONFIG_SECTION}
find_dependency(SymEngine 0.8.0 REQUIRED)
add_library(Dune::Wrapper::SymEngine INTERFACE IMPORTED)
target_link_libraries(Dune::Wrapper::SymEngine INTERFACE \${SYMENGINE_LIBRARIES})
target_include_directories(Dune::Wrapper::SymEngine INTERFACE \${SYMENGINE_INCLUDE_DIRS})")
endif()
# install generated config in build and install directories
file(COPY "${CMAKE_CURRENT_BINARY_DIR}/config.h"
DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/dune/copasi"
)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/dune/copasi/config.h"
COMPONENT Development
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dune/copasi"
)
if(TARGET muparser::muparser)
set(DUNE_CUSTOM_PKG_CONFIG_SECTION "${DUNE_CUSTOM_PKG_CONFIG_SECTION}
find_dependency(muparser REQUIRED)")
endif()
# If the FC.h file is generated (dune-common<=2.7), install into build and install directories
file(TOUCH "${CMAKE_CURRENT_BINARY_DIR}/FC.h")
file(COPY "${CMAKE_CURRENT_BINARY_DIR}/FC.h"
DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/dune/copasi"
)
if(TARGET parafields::parafields)
set(DUNE_CUSTOM_PKG_CONFIG_SECTION "${DUNE_CUSTOM_PKG_CONFIG_SECTION}
find_dependency(parafields REQUIRED)")
endif()
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/dune/copasi/FC.h"
COMPONENT Development
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dune/copasi"
)
if(TARGET SuiteSparse::UMFPACK)
set(DUNE_CUSTOM_PKG_CONFIG_SECTION "${DUNE_CUSTOM_PKG_CONFIG_SECTION}
find_dependency(SuiteSparse REQUIRED COMPONENTS UMFPACK)")
endif()
# taget configuration for downstream projects
install(TARGETS dune-copasi-deps dune-copasi
EXPORT dune-copasi-targets
LIBRARY DESTINATION "${DUNE_INSTALL_LIBDIR}/cmake/dune-copasi"
COMPONENT Libraries
NAMELINK_COMPONENT Development
ARCHIVE DESTINATION "${DUNE_INSTALL_LIBDIR}/cmake/dune-copasi"
COMPONENT Development
)
if(TARGET SuperLU::SuperLU)
set(DUNE_CUSTOM_PKG_CONFIG_SECTION "${DUNE_CUSTOM_PKG_CONFIG_SECTION}
find_dependency(SuperLU REQUIRED)")
endif()
set(DUNE_CUSTOM_PKG_CONFIG_SECTION "${DUNE_CUSTOM_PKG_CONFIG_SECTION}
list(REMOVE_DUPLICATES CMAKE_MODULE_PATH)
get_filename_component(_dir \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)
include(\"\${_dir}/dune-copasi-installed-targets.cmake\")
# restore previous CMAKE_MODULE_PATH
set(CMAKE_MODULE_PATH \${PREVIOUS_CMAKE_MODULE_PATH})
unset(PREVIOUS_CMAKE_MODULE_PATH)
")
# finalize the dune project: Generate and install config headers, cmake targets and version files
finalize_dune_project()
# export targets to be used with installed tree
install(EXPORT dune-copasi-targets
FILE dune-copasi-targets.cmake
NAMESPACE dune-copasi::
FILE dune-copasi-installed-targets.cmake
NAMESPACE Dune::
COMPONENT Development
DESTINATION "${DUNE_INSTALL_LIBDIR}/cmake/dune-copasi"
)
# export targets to be used with build tree
export(EXPORT dune-copasi-targets
FILE "${CMAKE_CURRENT_BINARY_DIR}/dune-copasi-targets.cmake"
NAMESPACE dune-copasi::
FILE "${CMAKE_CURRENT_BINARY_DIR}/dune-copasi-installed-targets.cmake"
NAMESPACE Dune::
)
# create read-only targets
add_library(dune-copasi::dune-copasi ALIAS dune-copasi)
if(TARGET singledomain-exec)
add_executable(dune-copasi::singledomain-exec ALIAS singledomain-exec)
endif()
if(TARGET multidomain-exec)
add_executable(dune-copasi::multidomain-exec ALIAS multidomain-exec)
endif()
# include tests as a sub project
include(CTest)
if(BUILD_TESTING)
......
......@@ -60,7 +60,7 @@ representative at an online or offline event.
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
*santiago.ospina at uni-heidelberg.de*.
*dune-copasi at dune-project.org*.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
......@@ -126,4 +126,3 @@ enforcement ladder](https://github.com/mozilla/diversity).
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
......@@ -5,7 +5,7 @@ When contributing to `dune-copasi`, first discuss the change you wish to make vi
Try to do this before anything else. This will greately improve both your and
our experience working together :-). We follow the
[GitLab Workflow](https://about.gitlab.com/blog/2016/10/25/gitlab-workflow-an-overview/)
in our software development cycle and we expet you to be part of it. In short,
in our software development cycle and we expect you to be part of it. In short,
contributing single features can be summarized by following these steps:
1. **ISSUE**: Create an issue in our
......@@ -16,15 +16,15 @@ contributing single features can be summarized by following these steps:
2. In the created issue, discuss with others the whole idea of your proposal.
This is important because you may get input from someone that know the
software on how to do it effectively, and poimting out considerations you may
have missed. It also syncronizes ideas so that changes are more easily
have missed. It also synchronizes ideas so that changes are more easily
accepted.
3. **CODE**: Implement what you proposed :-) in a new branch.
4. Create a [Merge Request (MR)](https://docs.gitlab.com/ee/gitlab-basics/add-merge-request.html)
using suitable template. Mark the MR as
[*Work In Progres* (WIP)](https://docs.gitlab.com/ee/user/project/merge_requests/work_in_progress_merge_requests.html)
[*Work In Progress* (WIP)](https://docs.gitlab.com/ee/user/project/merge_requests/work_in_progress_merge_requests.html)
until is sent to review for approval. MR differ from issues in that MR
discuss *how* to implement the idea rather than the idea itself. A MR is
filled of technical details that ensure that the *task* idea is fullfiled.
filled of technical details that ensure that the *task* idea is fulfilled.
5. **COMMIT**: In the MR, discuss with others the details of your
implementation. If discussions show that your proposal has to be modified to
be accepted, push new commits and update the MR with the new technical
......@@ -42,4 +42,3 @@ contributing single features can be summarized by following these steps:
assigning a maintainer to review your modification.
Check out our [code of conduct](CODE_OF_CONDUCT.md), please follow it in our interactions.