Commit f537a000 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

Merge branch 'develop'

parents b9c2565c b4c6cc35
Pipeline #34349 failed with stage
in 21 minutes and 46 seconds
image: Visual Studio 2019
matrix:
fast_finish: true
platform:
- x64
# http://www.appveyor.com/docs/installed-software
environment:
BOOSTDIR: C:\Libraries\boost_1_73_0
PYTHONDIR: "C:\\Python38-x64"
QTDIR: "C:\\Qt\\5.14\\msvc2017_64"
PATH: "%QTDIR%\\bin;%PYTHONDIR%;%PYTHONDIR%\\Scripts;%BOOSTDIR%\\lib64-msvc-14.2;%PATH%"
PYTHONPATH: "%PYTHONDIR%;%PYTHONDIR%\\Lib;%PYTHONDIR%\\Lib\\site-packages;%PYTHONDIR%\\DLLs"
PYEXE: "%PYTHONDIR%\\python.exe"
PYLIB: "%PYTHONDIR%\\libs\\python38.lib"
build:
parallel: true
init:
- echo "BornAgain init" %CD%
- echo %PATH%
install:
- git submodule -q update --init
before_build:
- echo "BornAgain before_build" %CD%
- dir C:\Python38-x64\libs
- python -m pip install --upgrade pip
- python -m pip install numpy
- mkdir C:\projects\deps
- C:\cygwin\bin\wget -q http://apps.jcns.fz-juelich.de/src/WinLibs/libgsl.win64.zip -O %temp%\libgsl.zip
- 7z x %temp%\libgsl.zip -oC:\projects\deps
- dir C:\projects\deps
- dir C:\projects\deps\include
- C:\cygwin\bin\wget -q http://apps.jcns.fz-juelich.de/src/WinLibs/libtiff.win64.zip -O %temp%\libtiff.zip
- 7z x %temp%\libtiff.zip -oC:\projects\deps
- dir C:\projects\deps
- dir C:\projects\deps\include
- C:\cygwin\bin\wget -q http://apps.jcns.fz-juelich.de/src/WinLibs/libcblas.win64.zip -O %temp%\libcblas.zip
- 7z x %temp%\libcblas.zip -oC:\projects\deps
- dir C:\projects\deps
- dir C:\projects\deps\include
- C:\cygwin\bin\wget -q http://apps.jcns.fz-juelich.de/src/WinLibs/libfftw3.win64.zip -O %temp%\libfftw3.zip
- 7z x %temp%\libfftw3.zip -oC:\projects\deps
- dir C:\projects\deps
- dir C:\projects\deps\include
- set CMAKE_URL="https://cmake.org/files/v3.17/cmake-3.17.2-win64-x64.zip"
- appveyor DownloadFile %CMAKE_URL% -FileName %temp%\cmake.zip
- 7z x %temp%\cmake.zip -oC:\projects\deps > nul
- move C:\projects\deps\cmake-* C:\projects\deps\cmake # Move to a version-agnostic directory
- set PATH=C:\projects\deps\lib;C:\projects\deps\cmake\bin;%PATH%
build_script:
- echo "BornAgain build_script" %CD%
- echo %PATH%
- echo "PYEXE" %PYEXE% "PYLIB" %PYLIB%
- mkdir build
- cd build
- cmake --version
- cmake -G "Visual Studio 16 2019" -DBOOST_ROOT=%BOOSTDIR% -DPython_LIBRARY=%PYLIB% -DPython_EXECUTABLE=%PYEXE% -DCMAKE_INCLUDE_PATH=C:/projects/deps/include ..
- cmake --build . --config Release
test_script:
- echo "BornAgain test_script" %CD%
- echo %PATH%
- echo %PYTHONPATH%
- echo %PYTHONHOME%
- ps: >-
ctest -LE Fullcheck --output-on-failure
if (-not $?) {
type Testing/Temporary/LastTest.log
throw "tests failed"
}
on_failure:
- appveyor PushArtifact Testing/Temporary/LastTest.log
#- echo "Going RDP"
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
BasedOnStyle: LLVM BasedOnStyle: LLVM
IndentWidth: 4
UseTab: Never
BreakBeforeBraces: Linux
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false
ColumnLimit: 100
AccessModifierOffset: -4 AccessModifierOffset: -4
BreakBeforeBinaryOperators: NonAssignment AllowAllConstructorInitializersOnNextLine: true
AllowShortFunctionsOnASingleLine: Inline AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: false
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: WebKit
BreakConstructorInitializers : BeforeComma
ColumnLimit: 100
ConstructorInitializerAllOnOneLineOrOnePerLine: true
IndentCaseLabels: false
IndentWidth: 4
PointerAlignment: Left PointerAlignment: Left
UseTab: Never
--- ---
#
# This is the BornAgain configuration for clang-tidy.
#
# To invoke clang-tidy, run
# cmake -DBORNAGAIN_TIDY=ON -DBORNAGAIN_PYTHON=OFF -DBORNAGAIN_GUI=OFF ..
# make
#
# Below, we select all checks ('*'), then deselect quite a number of them.
#
# As we are not aware of an official way to insert comments in a long string literal,
# we do a dirty little trick: we write comments as if they were no-check specifiers.
#
Checks: '*, Checks: '*,
-SectionComment_We_disagree_with_the_following_checks__They_shall_remain_permanently_disabled,
-*-braces-around-statements, -*-braces-around-statements,
-*-convert-member-functions-to-static, -*-convert-member-functions-to-static,
-*-implicit-bool-conversion, -*-implicit-bool-conversion,
...@@ -28,6 +43,12 @@ Checks: '*, ...@@ -28,6 +43,12 @@ Checks: '*,
-misc-throw-by-value-catch-by-reference, -misc-throw-by-value-catch-by-reference,
-performance-unnecessary-value-param, -performance-unnecessary-value-param,
-SectionComment_Resolving_the_following_checks_would_be_too_much_work_right_now,
-cppcoreguidelines-owning-memory,
-SectionComment_Temporarily_disabled_checks__We_need_to_investigate_them_one_by_one,
-*-avoid-c-arrays, -*-avoid-c-arrays,
-*-avoid-goto, -*-avoid-goto,
-*-container-size-empty, -*-container-size-empty,
...@@ -43,8 +64,11 @@ Checks: '*, ...@@ -43,8 +64,11 @@ Checks: '*,
-*-statically-constructed-objects, -*-statically-constructed-objects,
-*-use-auto, -*-use-auto,
-*-use-emplace, -*-use-emplace,
-*-use-override,
-bugprone-argument-comment,
-bugprone-copy-constructor-init, -bugprone-copy-constructor-init,
-bugprone-exception-escape, -bugprone-exception-escape,
-bugprone-fold-init-type,
-bugprone-misplaced-widening-cast, -bugprone-misplaced-widening-cast,
-bugprone-narrowing-conversions, -bugprone-narrowing-conversions,
-bugprone-unhandled-self-assignment, -bugprone-unhandled-self-assignment,
...@@ -67,6 +91,7 @@ Checks: '*, ...@@ -67,6 +91,7 @@ Checks: '*,
-google-readability-avoid-underscore-in-googletest-name, -google-readability-avoid-underscore-in-googletest-name,
-google-readability-casting, -google-readability-casting,
-google-runtime-references, -google-runtime-references,
-hicpp-explicit-conversions,
-hicpp-move-const-arg, -hicpp-move-const-arg,
-hicpp-multiway-paths-covered, -hicpp-multiway-paths-covered,
-hicpp-no-array-decay, -hicpp-no-array-decay,
...@@ -85,6 +110,7 @@ Checks: '*, ...@@ -85,6 +110,7 @@ Checks: '*,
-modernize-raw-string-literal, -modernize-raw-string-literal,
-modernize-return-braced-init-list, -modernize-return-braced-init-list,
-modernize-use-equals-default, -modernize-use-equals-default,
-modernize-use-nodiscard,
-modernize-use-nullptr, -modernize-use-nullptr,
-modernize-use-using, -modernize-use-using,
-performance-for-range-copy, -performance-for-range-copy,
...@@ -100,8 +126,12 @@ Checks: '*, ...@@ -100,8 +126,12 @@ Checks: '*,
-readability-inconsistent-declaration-parameter-name, -readability-inconsistent-declaration-parameter-name,
-readability-non-const-parameter, -readability-non-const-parameter,
-readability-redundant-control-flow, -readability-redundant-control-flow,
-readability-redundant-declaration,
-readability-redundant-string-cstr, -readability-redundant-string-cstr,
-readability-uppercase-literal-suffix, -readability-uppercase-literal-suffix,
-readability-qualified-auto,
-clang-analyzer-core.NonNullParamChecker, -clang-analyzer-core.NonNullParamChecker,
-llvmlibc-implementation-in-namespace,
-llvmlibc-callee-namespace,
-llvm-qualified-auto,
' '
<!-- TEMPLATE FOR BUG REPORTS -->
### Expected behavior
### Actual behavior
### Steps to reproduce the behavior
### Platforms affected
## ************************************************************************** ##
##
## BornAgain: simulate and fit scattering at grazing incidence
##
##! @file .github/workflows/ba-linux.yml
##! @brief GitHub runner configuration for building BornAgain under Linux
##!
##! @homepage http://www.bornagainproject.org
##! @license GNU General Public License v3 or higher (see COPYING)
##! @copyright Forschungszentrum Jülich GmbH 2020
##! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
##
## ************************************************************************** ##
##! Build scripts for GitHub Actions were introduced with BornAgain-1.17.
##! This script incorporates code by
##! - Andrew Nelson (https://github.com/reflectivity/analysis)
##! - Cristian Adam (https://cristianadam.eu/20200113/speeding-up-c-plus-plus-github-actions-using-ccache/)
name: Linux
on:
push:
branches: [ master, develop]
paths-ignore:
- 'Doc/**'
pull_request:
branches: [ master, develop ]
paths-ignore:
- 'Doc/**'
jobs:
build:
runs-on: ubuntu-20.04
strategy:
max-parallel: 3
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python3
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: setup apt dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential\
gfortran cmake ccache \
libgsl-dev libboost-all-dev libfftw3-dev libtiff5-dev libcerf-dev libeigen3-dev \
qt5-default libqt5designercomponents5 qttools5-dev libqt5svg5-dev
- name: Install Python packages
run: |
python3 -m pip install --upgrade pip
python3 -m pip install wheel setuptools
python3 -m pip install numpy matplotlib
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files for BornAgain
uses: actions/cache@v1.1.0
with:
path: .ccache
key: ba-linux-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
ba-linux-ccache-
- name: Build BornAgain
env:
CCACHE_DIR: $GITHUB_WORKSPACE/.ccache
CCACHE_COMPRESS: "true"
CCACHE_COMPRESSLEVEL: "6"
CCACHE_MAXSIZE: "400M"
run: |
cd $GITHUB_WORKSPACE && pwd && ls
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache ../
make package_source
make -j4
- name: Upload tarball
uses: actions/upload-artifact@v2
if: success()
with:
name: BornAgainTar
path: ./build/BornAgain-*.tar.gz
- name: Testing
run: |
cd $GITHUB_WORKSPACE/build
ccache -s
ctest -LE Fullcheck --output-on-failure
- name: Upload test logs
uses: actions/upload-artifact@v2
if: failure()
with:
name: LastTest.log
path: ./build/Testing/Temporary/LastTest.log
## ************************************************************************** ##
##
## BornAgain: simulate and fit scattering at grazing incidence
##
##! @file .github/workflows/ba-macos.yml
##! @brief GitHub runner configuration for building BornAgain under macOS
##!
##! @homepage http://www.bornagainproject.org
##! @license GNU General Public License v3 or higher (see COPYING)
##! @copyright Forschungszentrum Jülich GmbH 2020
##! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
##
## ************************************************************************** ##
##! Build scripts for GitHub Actions were introduced with BornAgain-1.17.
##! This script incorporates code by
##! - Andrew Nelson (https://github.com/reflectivity/analysis)
##! - Cristian Adam (https://cristianadam.eu/20200113/speeding-up-c-plus-plus-github-actions-using-ccache/)
name: MacOS
on:
push:
branches: [ master, develop]
paths-ignore:
- 'Doc/**'
pull_request:
branches: [ master, develop ]
paths-ignore:
- 'Doc/**'
jobs:
build:
runs-on: macos-latest
strategy:
max-parallel: 3
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: setup dependencies
run: |
brew install cmake ccache fftw gsl boost qt5 libtiff eigen python numpy scipy
echo "Qt5 is installed to $QTDIR"
wget http://apps.jcns.fz-juelich.de/src/MacLibs/cerf-1.14-Darwin.zip
unzip cerf-1.14-Darwin.zip
mv cerf-1.14-Darwin/lib/* /usr/local/bin/
mv cerf-1.14-Darwin/include/* /usr/local/include/
- name: Install Python packages
run: |
pip3 install wheel setuptools matplotlib
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files for BornAgain
uses: actions/cache@v1.1.0
with:
path: .ccache
key: ba-macos-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
ba-macos-ccache-
- name: Build BornAgain
env:
CCACHE_DIR: $GITHUB_WORKSPACE/.ccache
CCACHE_COMPRESS: "true"
CCACHE_COMPRESSLEVEL: "6"
CCACHE_MAXSIZE: "400M"
CXX: clang++
USE_CPP: 14
CMAKE_CXX_STANDARD: 14
PYTHON_VERSION: 3.8
LLVM_BC_GENERATOR: /usr/bin/clang++
LDFLAGS: "-L/usr/local/opt/qt/lib"
CPPFLAGS: "-I/usr/local/opt/qt/include"
run: |
echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> /Users/runner/.bash_profile
cd $GITHUB_WORKSPACE
mkdir build && cd build
cmake -DCMAKE_PREFIX_PATH=/usr/local/opt/qt -DBORNAGAIN_APPLE_BUNDLE=ON \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache ../
make -j4
- name: Testing
shell: bash
run: |
cd $GITHUB_WORKSPACE/build
ccache -s
ctest -LE Fullcheck --output-on-failure
- name: Upload test logs
uses: actions/upload-artifact@v2
if: failure()
with:
name: LastTest.log
path: ./build/Testing/Temporary/LastTest.log
- name: Build package
env:
QTDIR: /usr/local/opt/qt
shell: bash
run: |
cd $GITHUB_WORKSPACE/build
echo $QTDIR
cpack -V
- name: Upload package
uses: actions/upload-artifact@v2
if: success()
with:
name: BornAgainMacInstaller
path: ./build/*.dmg
## ************************************************************************** ##
##
## BornAgain: simulate and fit scattering at grazing incidence
##
##! @file .github/workflows/ba-windows.yml
##! @brief GitHub runner configuration for building BornAgain under Windows
##!
##! @homepage http://www.bornagainproject.org
##! @license GNU General Public License v3 or higher (see COPYING)
##! @copyright Forschungszentrum Jülich GmbH 2020
##! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
##
## ************************************************************************** ##
##! Build scripts for GitHub Actions were introduced with BornAgain-1.17.
##! This script incorporates code by
##! - Andrew Nelson (https://github.com/reflectivity/analysis)
##! - Cristian Adam (https://cristianadam.eu/20200113/speeding-up-c-plus-plus-github-actions-using-ccache/)
name: Windows
env:
CCACHE_VERSION: 3.7.7
NINJA_VERSION: 1.10.0
on:
push:
branches: [ master, develop]
paths-ignore:
- 'Doc/**'
pull_request:
branches: [ master, develop ]
paths-ignore:
- 'Doc/**'
jobs:
build:
runs-on: windows-latest
strategy:
max-parallel: 3
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python3
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: setup dependencies
shell: powershell
run: |
Get-Date -Format G
$Env:Path += ";C:\msys64\usr\bin"
cd ${{github.workspace}}
mkdir deps
Get-Date -Format G
wget http://apps.jcns.fz-juelich.de/src/WinLibs/libboost1.73.win64.zip -O ${{runner.temp}}\libboost.zip
wget http://apps.jcns.fz-juelich.de/src/WinLibs/libcerf1.14.win64.zip -O ${{runner.temp}}\libcerf.zip
wget http://apps.jcns.fz-juelich.de/src/WinLibs/libfftw3.win64.zip -O ${{runner.temp}}\libfftw.zip
wget http://apps.jcns.fz-juelich.de/src/WinLibs/libgsl-static.win64.zip -O ${{runner.temp}}\libgsl.zip
wget http://apps.jcns.fz-juelich.de/src/WinLibs/libtiff.win64.zip -O ${{runner.temp}}\libtiff.zip
wget http://apps.jcns.fz-juelich.de/src/WinLibs/libyaml.win64.zip -O ${{runner.temp}}\libyaml.zip
wget http://apps.jcns.fz-juelich.de/src/WinLibs/eigen3.3.7.zip -O ${{runner.temp}}\eigen.zip
Get-Date -Format G
7z x ${{runner.temp}}\libboost.zip -odeps
7z x ${{runner.temp}}\libcerf.zip -odeps
7z x ${{runner.temp}}\libfftw.zip -odeps
7z x ${{runner.temp}}\libgsl.zip -odeps
7z x ${{runner.temp}}\libtiff.zip -odeps
7z x ${{runner.temp}}\libyaml.zip -odeps
7z x ${{runner.temp}}\eigen.zip -odeps
Get-Date -Format G
dir deps
dir deps/include
dir deps/lib
- name: Install Python packages
run: |
python -m pip install --upgrade pip
python -m pip install wheel setuptools
python -m pip install numpy matplotlib
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: '5.14.2'
host: 'windows'
target: 'desktop'
arch: 'win64_msvc2017_64'
dir: '${{ github.workspace }}/qt5/'
install-deps: 'true'
modules: 'qtcharts qtwebengine'
cached: 'false'
- name: Download ccache, Ninja, Nsis
id: ccache
shell: cmake -P {0}
run: |
set(ccache_url "https://github.com/cristianadam/ccache/releases/download/v$ENV{CCACHE_VERSION}/${{ runner.os }}.tar.xz")
file(DOWNLOAD "${ccache_url}" ./ccache.tar.xz SHOW_PROGRESS)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./ccache.tar.xz)
set(ninja_url "https://github.com/ninja-build/ninja/releases/download/v$ENV{NINJA_VERSION}/ninja-win.zip")
file(DOWNLOAD "${ninja_url}" ./ninja.zip SHOW_PROGRESS)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./ninja.zip)
set(nsis_url "https://sourceforge.net/projects/nsis/files/NSIS%203/3.04/nsis-3.04.zip")
file(DOWNLOAD "${nsis_url}" ./nsis.zip SHOW_PROGRESS)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./nsis.zip)
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files for BornAgain
uses: actions/cache@v1.1.0
with:
path: .ccache
key: ba-windows-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
ba-windows-ccache-
- name: Build BornAgain
shell: cmd
env:
CCACHE_BASEDIR: $GITHUB_WORKSPACE
CCACHE_DIR: $GITHUB_WORKSPACE/.ccache
CCACHE_COMPRESS: "true"
CCACHE_COMPRESSLEVEL: "6"
CCACHE_MAXSIZE: "1000M"
run: |
call "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
set OPTLIBS=${{github.workspace}}\deps
set EIGENDIR=${{github.workspace}}\eigen\eigen-3.3.7
set QTDIR=${{github.workspace}}\qt5\Qt\5.14.2\msvc2017_64
set PATH=${{github.workspace}};%OPTLIBS%\lib;%QTDIR%\bin;%PATH%
cd ${{github.workspace}}
dir
mkdir build
cd build
cmake -G "Visual Studio 16 2019" -G Ninja -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_INCLUDE_PATH=%OPTLIBS%/include -DCMAKE_LIBRARY_PATH=%OPTLIBS%/lib -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" ..
ccache -z
ccache -p
cmake --build . --config Release -j4
- name: Testing
shell: cmd
run: |
echo %QTDIR%
echo %OPTLIBS%
set OPTLIBS=${{github.workspace}}\deps
set PATH=%OPTLIBS%\lib;%QTDIR%\bin;%PATH%
echo %PATH%
cd ${{github.workspace}}\build
ccache -s
ctest -LE Fullcheck --output-on-failure
- name: Upload test logs
uses: actions/upload-artifact@v2
if: failure()
with:
name: LastTest.log
path: ./build/Testing/Temporary/LastTest.log
- name: Build package
if: success()
shell: cmd
run: |
cd ${{github.workspace}}\build
set PATH=${{github.workspace}}\nsis-3.04;%PATH%
cpack --debug -c Release
- name: Upload CPack log