The UFZ services GitLab and Mattermost will be unavailable on Monday, October 25 from 06:00 AM to 08:00 AM due to maintenance work.

Commit 0570b4b6 authored by Robert Schweppe's avatar Robert Schweppe
Browse files

merged with origin develop and solved merge conflicts

parents 6930ba73 de4ac666
Pipeline #24193 failed with stages
in 8 minutes and 28 seconds
0.6.6
\ No newline at end of file
......@@ -65,7 +65,7 @@ instance/
.scrapy
# Sphinx documentation
docs/_build/
doc/_build/
# PyBuilder
target/
......
# to use the env-var "GIT_CLONE_PATH", set the following in
# ./gitlab-runner/config.toml under [[runners]]:
# [runners.custom_build_dir]
# enabled = true
# This will prevent git clone conflicts for jobs ran in parallel
stages:
- info
- build
- test
- coverage
- deploy
workflow:
rules:
- if: $CI_COMMIT_REF_NAME =~ /-wip$/
when: never
- when: always
variables:
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_RUNNER_SHORT_TOKEN/$CI_PROJECT_PATH/$CI_COMMIT_REF_NAME/$CI_JOB_NAME/$CI_CONCURRENT_ID
MAKE_FLAGS: -j 4
EXECUTABLE: MPR
show-env-vars:
stage: info
variables:
SEP: "#################################################################"
S00: "commit date - "
S01: "project: ${CI_PROJECT_PATH}"
S02: "branch: ${CI_COMMIT_REF_NAME}"
S03: "commit: ${CI_COMMIT_SHA}"
S04: "commit msg: ${CI_COMMIT_MESSAGE}"
S05: "clone base path: "
S06: "runner token: ${CI_RUNNER_SHORT_TOKEN}"
script:
- echo -e "${SEP}\n${S00}$(date)\n${SEP}\n${S01}\n${S02}\n${S03}\n${S04}\n${SEP}\n${S05}${GIT_CLONE_PATH}\n${S06}\n${SEP}"
# how the job build directory is erected
.setup_build: &setup_build_dir
- mkdir -p $BUILD_DIR
- cd $BUILD_DIR
# make command
.cmake: &cmake
- cmake .. $CMAKE_FLAGS
- echo -e "${PATH}"
- which python
# make command
.make: &make
- make $MAKE_FLAGS
# make test command
.make_test: &make_test
- ctest -V
# make test command
.make_coverage: &make_coverage
- make $MAKE_FLAGS MPR_coverage_CI
# cleanup after scripts
.cleanup: &cleanup
- cp $EXECUTABLE ..
- cd -
# waiting on https://gitlab.com/groups/gitlab-org/-/epics/3589
# until this is fixed, we need to additionally set the CMAKE_FLAGS in the jobs as the expansion does not work
# debug variables
.debug_vars: &debug_vars
BUILD_DIR: build_debug
CMAKE_FLAGS: '$CMAKE_FLAGS -DCMAKE_BUILD_TYPE=Debug'
# release variables
.release_vars: &release_vars
BUILD_DIR: build_release
CMAKE_FLAGS: '$CMAKE_FLAGS -DCMAKE_BUILD_TYPE=Release'
# no test variables
.no_test_vars: &no_test_vars
CMAKE_FLAGS: '$CMAKE_FLAGS -DBUILD_TESTING=OFF'
# coverage variables
.coverage_vars: &coverage_vars
CMAKE_FLAGS: '$CMAKE_FLAGS -DCMAKE_WITH_COVERAGE=ON'
# #################
# ### TEMPLATES ###
# #################
# template for build jobs
.build_template: &build_template
stage: build
artifacts:
paths:
- $EXECUTABLE
script:
- source $MODULE_LOAD_SCRIPT
- python -m src_python.pre_proc.update_tfs_in_fortran_source
- *setup_build_dir
- *cmake
- *make
- *cleanup
# template for test jobs
.test_template: &test_template
stage: test
script:
- source $MODULE_LOAD_SCRIPT
- *setup_build_dir
- *cmake
- *make
- *make_test
- *cleanup
artifacts:
when: always
paths:
- $BUILD_DIR/Testing/Temporary
# template for valgrind jobs
.valgrind_template: &valgrind_template
stage: test
when: always
script:
- source $MODULE_LOAD_SCRIPT
# Valgrind 3.16.1 for foss/2019b, 3.14.0 for foss/2018b , 3.13.0 for foss/2018a -> do not specify version
- module load Valgrind
- valgrind --version
- valgrind --tool=memcheck --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose ./$EXECUTABLE
# execute mem-use check
- valgrind --tool=massif --stacks=yes --time-unit=i --massif-out-file=massif.out.0 ./$EXECUTABLE
- ms_print massif.out.0
artifacts:
paths:
- massif.out.0
# template for coverage jobs
.coverage_template: &coverage_template
stage: coverage
script:
- source $MODULE_LOAD_SCRIPT
- *setup_build_dir
- *cmake
- *make
- *make_coverage
- *cleanup
artifacts:
when: always
paths:
- $BUILD_DIR/MPR_coverage_CI.info
- $BUILD_DIR/MPR_coverage_CI
# template for documentation jobs
.documentation_template: &documentation_template
#only:
# - develop
stage: build
script:
- module load foss/2019b
- module load texlive/2019
- module load Graphviz/2.42.2
- module use /global/apps/modulefiles
- module load python_env_mpr/0.2.0
# use doxygen from the mpr_env conda environment
- doxygen doc/doxygen.config > doxygen_log_dev.txt
# create pdf documentation
- cd latex/ && make > ../doxygen_latex_dev.txt
- cp refman.pdf ../html/mpr_doc.pdf
- cp refman.pdf ../mpr_doc_dev.pdf
- cp refman.pdf ../mpr_doc_mas.pdf # TODO: remove once we have a decent version on master, too
- cd .. && mv html html_dev
- mv doxygen_warn.txt doxygen_warn_dev.txt
- rm -rf latex
# TODO: activate once we have a decent version on master, too
# # same for master
# - git checkout master
# - test -f doc/doxygen-1.8.8.config && cp doc/doxygen-1.8.8.config doc/doxygen.config
# - doxygen doc/doxygen.config > doxygen_log_mas.txt
# - cd latex/ && make > ../doxygen_latex_mas.txt
# - cp refman.pdf ../html/mpr_doc.pdf
# - cp refman.pdf ../mpr_doc_mas.pdf
# - cd .. && mv html html_mas
# care about warnings file (maybe missing on master)
- |
if [ -f doxygen_warn.txt ]; then
mv doxygen_warn.txt doxygen_warn_mas.txt
else
touch doxygen_warn_mas.txt
fi
artifacts:
name: "$CI_COMMIT_REF_NAME"
when: always
paths:
- html_dev
- mpr_doc_dev.pdf
- doxygen_log_dev.txt
- doxygen_latex_dev.txt
- doxygen_warn_dev.txt
#- html_mas
- mpr_doc_mas.pdf
#- doxygen_log_mas.txt
#- doxygen_latex_mas.txt
#- doxygen_warn_mas.txt
# ##################
# ### BUILD JOBS ###
# ##################
### DEBUG ###
build-nag62-debug:
variables:
<<: *debug_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.nagfor62
CMAKE_FLAGS: '-DCMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX=64 -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF'
<<: *build_template
build-gfortran64MPI-debug:
variables:
<<: *debug_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran64MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF'
<<: *build_template
build-gfortran73MPI-debug:
variables:
<<: *debug_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran73MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF'
<<: *build_template
build-gfortran83-debug:
variables:
<<: *debug_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran83
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF'
<<: *build_template
build-gfortran83MPI-debug:
variables:
<<: *debug_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran83MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF'
<<: *build_template
build-gfortran102-debug:
variables:
<<: *debug_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran102
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF'
<<: *build_template
build-gfortran102MPI-debug:
variables:
<<: *debug_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran102MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF'
<<: *build_template
build-intel18-debug:
variables:
<<: *debug_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.intel18
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF'
<<: *build_template
build-intel19-debug:
variables:
<<: *debug_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.intel19
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF'
<<: *build_template
build-intel19MPI-debug:
variables:
<<: *debug_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.intel19MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF'
<<: *build_template
# ### RELEASE ###
build-nag62-release:
variables:
<<: *release_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.nagfor62
CMAKE_FLAGS: '-DCMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX=64 -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF'
<<: *build_template
build-gfortran64MPI-release:
variables:
<<: *release_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran64MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF'
<<: *build_template
build-gfortran73MPI-release:
variables:
<<: *release_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran73MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF'
<<: *build_template
build-gfortran83-release:
variables:
<<: *release_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran83
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF'
<<: *build_template
build-gfortran83MPI-release:
variables:
<<: *release_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran83MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF'
<<: *build_template
build-gfortran102-release:
variables:
<<: *release_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran102
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF'
<<: *build_template
build-gfortran102MPI-release:
variables:
<<: *release_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran102MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF'
<<: *build_template
build-intel18-release:
variables:
<<: *release_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.intel18
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF'
<<: *build_template
build-intel19-release:
variables:
<<: *release_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.intel19
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF'
<<: *build_template
build-intel19MPI-release:
variables:
<<: *release_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.intel19MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF'
<<: *build_template
# ######################
# ### ANALYTICS JOBS ###
# #####################
valgrind-gfortran64MPI-debug:
needs:
- job: build-gfortran64MPI-debug
variables:
<<: *debug_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran64MPI
<<: *valgrind_template
valgrind-gfortran73MPI-debug:
needs:
- job: build-gfortran73MPI-debug
variables:
<<: *debug_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran73MPI
<<: *valgrind_template
valgrind-gfortran83-debug:
needs:
- job: build-gfortran83-debug
variables:
<<: *debug_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran83
<<: *valgrind_template
### # Valgrind not available for Intel and NAG
# valgrind-intel19-debug:
# needs:
# - job: build-intel19-debug
# artifacts: true
# variables:
# <<: *debug_vars
# MODULE_LOAD_SCRIPT: hpc-module-loads/eve.intel19
# <<: *valgrind_template
#
# valgrind-nag62-debug:
# needs:
# - job: build-nag62-debug
# artifacts: true
# variables:
# <<: *debug_vars
# MODULE_LOAD_SCRIPT: hpc-module-loads/eve.nagfor62
# <<: *valgrind_template
#################
### TEST JOBS ###
#################
test-nag62-debug:
needs:
- job: build-nag62-debug
artifacts: false
variables:
<<: *debug_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.nagfor62
CMAKE_FLAGS: '-DCMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX=64 -DCMAKE_BUILD_TYPE=Debug'
<<: *test_template
test-nag62-release:
needs:
- job: build-nag62-release
artifacts: false
variables:
<<: *release_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.nagfor62
CMAKE_FLAGS: '-DCMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX=64 -DCMAKE_BUILD_TYPE=Release'
<<: *test_template
test-gfortran83MPI-release:
needs:
- job: build-gfortran83MPI-release
artifacts: false
variables:
<<: *release_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran83MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release'
<<: *test_template
test-gfortran73MPI-release:
needs:
- job: build-gfortran73MPI-release
artifacts: false
variables:
<<: *release_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran73MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release'
<<: *test_template
test-gfortran73MPI-debug:
needs:
- job: build-gfortran73MPI-debug
artifacts: false
variables:
<<: *debug_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran73MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Debug'
<<: *test_template
test-gfortran83-release:
needs:
- job: build-gfortran83-release
artifacts: false
variables:
<<: *release_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran83
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release'
<<: *test_template
test-intel18-release:
needs:
- job: build-intel18-release
artifacts: false
variables:
<<: *release_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.intel18
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release'
<<: *test_template
test-intel19-release:
needs:
- job: build-intel19-release
artifacts: false
variables:
<<: *release_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.intel19
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release'
<<: *test_template
test-intel19MPI-release:
needs:
- job: build-intel19MPI-release
artifacts: false
variables:
<<: *release_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.intel19MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release'
<<: *test_template
# ###################
# ### DEPLOY JOBS ###
# ###################
coverage-gcc73:
needs:
- job: test-gfortran73MPI-debug
variables:
<<: *debug_vars
<<: *coverage_vars
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran73MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Debug -DCMAKE_WITH_COVERAGE=ON'
<<: *coverage_template
documentation:
<<: *documentation_template
pages:
only:
- develop
stage: deploy
dependencies:
- documentation
# - coverage-gcc73
script:
# create public dir (remove if already present)
- test -d public && rm -rf public
- mkdir -p public
# create the subdir
- mkdir public/latest/
# TODO: activate once we have a decent version on master, too
- mkdir public/stable/
# copy the doxygen generated html page to the public site
- cp html_dev/* public/latest/ -R
# TODO: activate once we have a decent version on master, too
# - cp html_mas/* public/stable/ -R
- cp html_dev/* public/stable/ -R
# create an index.html that redirects to the master documentation (in master folder)
- cp doc/html_files/index.html public/
# create the coverage site
- \[ -d build_debug/MPR_coverage_CI \] && mkdir -p public/coverage && cp build_debug/MPR_coverage_CI/* public/coverage -R
- echo "success!"
artifacts:
name: "$CI_COMMIT_REF_NAME"
paths:
- public
cmake_minimum_required(VERSION 3.14)
# check version file
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake-modules)
# get version and date from files (version.txt and version_date.txt)
include(version)
get_version(MPR_VER MPR_VER_DEV MPR_DATE)
# This cmake file is not meant to be edited for a special setup.
# For special setups use cache line files or command line options, as described a few
# lines ahead concerning module INDEPENDENT builds
cmake_minimum_required(VERSION 3.5)
# create the project
project(MPR
VERSION ${MPR_VER}
DESCRIPTION "Multiscale Parameter Regionalization"
HOMEPAGE_URL "https://www.ufz.de/index.php?en=40126"
LANGUAGES Fortran)
project(MPR Fortran)
# add full version and date to pre-processor flags (qoutes need in before hand)
add_compile_definitions(MPRVERSION='${MPR_VER_DEV}' MPRDATE='${MPR_DATE}')
# common (default) options to cmake
# -DCMAKE_BUILD_TYPE=Release - compile in debug or release mode
......@@ -17,34 +26,15 @@ project(MPR Fortran)
# automatically enables testing
include(CTest)
set(CMAKE_BUILD_MODULE_SYSTEM_INDEPENDENT OFF CACHE STRING "build the module INDEPENDENT of the module system, so the build in the build tree works even after a module purge")
# The variable "CMAKE_BUILD_MODULE_SYSTEM_INDEPENDENT" can be set before executing cmake via a cache command:
# $cmake -DCMAKE_BUILD_MODULE_SYSTEM_INDEPENDENT:STRING=ON ..
# or cache file:
# $cmake -C ../CMakeCacheFiles/eve ..
# or after executing CMake editing the CMakeCache.txt, preferably with a corresponding cmake editor i.e ccmake
option(CMAKE_BUILD_MODULE_SYSTEM_INDEPENDENT "build the module INDEPENDENT of the module system, so the build in the build tree works even after a module purge")
# set compiling flags for debug and relese version
if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
# https://www.mankier.com/1/gfortran#Options-Options_to_request_or_suppress_errors_and_warnings
# this is super detailed...
# set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -Og -g -Wall -Wextra -Warray-temporaries -Wconversion -Wrealloc-lhs-all -fimplicit-none -fbacktrace -fcheck=all -ffpe-trap=zero,overflow,underflow -finit-real=snan")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -Og -g -Wall -Wextra -fimplicit-none -fbacktrace -fcheck=all -ffpe-trap=zero,overflow,underflow -finit-real=snan")
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -Ofast")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-none")
endif()
if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -warn all -g -debug extended -traceback -fp-stack-check -O0 -check all -fstack-protector-all -fstack-security-check -fpe0")
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -O3 -qoverride-limits")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -assume byterecl -fp-model=source -m64 -assume realloc_lhs")
endif()
if(CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -g -nan -O0 -C=all -strict95 -ieee=stop")
# set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -pedantic -Wall -W -O -g")
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -O4 -ieee=full")
# set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp -colour -unsharedf95 -ideclient")
endif()
if(CMAKE_Fortran_COMPILER_ID MATCHES "PGI")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -C -c -g -traceback -O0")
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -fast")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mfree -mcmodel=medium")
endif()
# same with coverage
option(CMAKE_WITH_COVERAGE "build the module with gcov coverage support")