Skip to content
Snippets Groups Projects
Commit 2d7e2aa7 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

[j.20] backport .gitlab-ci from main ()

Merging branch 'j.20'  into 'r21'.

See merge request !2541
parents fafdb7e3 5e0a8864
No related branches found
No related tags found
2 merge requests!2542merge r21 into main,!2541backport .gitlab-ci from main
Pipeline #141400 passed
...@@ -5,76 +5,136 @@ stages: ...@@ -5,76 +5,136 @@ stages:
variables: variables:
GIT_DEPTH: "1" GIT_DEPTH: "1"
native_Debian_clang: .linux_build: &linux_build
tags: &native stage: build
artifacts:
paths:
- build/installer/BornAgain*.sh
- build/py/wheel/manylinux/*.whl
expire_in: 3 days
native_Debian:
tags:
- Debian - Debian
before_script: &debian_clang <<: *linux_build
before_script: &native_before
- pwd - pwd
- export CC=gcc; export CXX=g++ - export CC=gcc; export CXX=g++
- export PYTHONPATH=$CI_PROJECT_DIR/build/lib - export CHECK_FLAGS="-DZERO_TOLERANCE=ON -DDEVELOPER_CHECKS=ON"
- export MPLBACKEND=Agg - export MPLBACKEND=Agg
# avoid using the default Debian Qt framework
- QTCMAKE="/usr/local/Qt6/6.2.3/gcc_64/lib/cmake" - QTCMAKE="/usr/local/Qt6/6.2.3/gcc_64/lib/cmake"
- PYPLAT="/home/build/.pyenv/versions/3.11.6/"
- cmake --version - cmake --version
- clang --version
stage: build
script: &native_scr script: &native_scr
- env - env
- mkdir build - mkdir build
- cd build - cd build
- time cmake .. -GNinja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DBA_PY_PACKAGE=ON -DCMAKE_PREFIX_PATH="$PYPLAT;$QTCMAKE" -DZERO_TOLERANCE=ON -DDEVELOPER_CHECKS=ON # NOTE: CMake's Ninja generator should not be used with CMake < 3.26 due to internal bugs.
- time ninja - time cmake .. -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_PREFIX_PATH="$QTCMAKE" $CHECK_FLAGS
- time xvfb-run -a ctest -j16 --output-on-failure - time make -j16
- time ninja package_source - time ctest -j16 --output-on-failure
- time make package_source
- time bash var/mk_pypack_linux.sh - time bash var/mk_pypack_linux.sh
- time cpack -B ./installer . - time cpack -V -B ./installer
artifacts:
paths: .compile_dependency: &compile_dependency
- build/installer/BornAgain*.sh - mkdir build
- build/PythonPackage/py*/wheel/manylinux/*.whl - cd build
expire_in: 10 days - cmake .. -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- make -j4
- ctest
- make install
.debian_oldstable_py311: &debian_oldstable
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
tags:
- LinuxDocker
<<: *linux_build
image: scg-debian-oldstable:latest
script: &docker_build
- export CHECK_FLAGS=""
- ORIGINAL_DIR=$(pwd)
- export CC=gcc; export CXX=g++
- export MPLBACKEND=Agg
- ldd --version
- cmake --version
- eval "$(pyenv init -)"
- python --version
- cd /libheinz
- *compile_dependency
- cd /libcerf
- *compile_dependency
- cd /libformfactor
- *compile_dependency
- cd $ORIGINAL_DIR
- *native_scr
debian_oldstable_py311:
<<: *debian_oldstable
before_script:
- pyenv global 3.11
debian_oldstable_py310:
<<: *debian_oldstable
before_script:
- pyenv global 3.10
debian_oldstable_py39:
<<: *debian_oldstable
before_script:
- pyenv global 3.9
debian_oldstable_py38:
<<: *debian_oldstable
before_script:
- pyenv global 3.8
versiondocs: versiondocs:
rules: rules:
- if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH' - if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
tags: tags:
- www - www
before_script: *debian_clang before_script: *native_before
stage: build stage: build
script: script:
- hugo version - hugo version
- mkdir build - mkdir build
- cd build - cd build
- time cmake .. -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_PREFIX_PATH=$QTCMAKE -DBATCH_MODE=ON - time cmake .. -GNinja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DBA_GUI=OFF
- time make -j8 - time ninja -j8
- time make -j8 webdoc - time ninja -j8 webdoc
- rm -rf ~www/ba/git-main/hugo-public - rm -rf ~www/ba/git-main/hugo-public
- cp -r ../hugo/public ~www/ba/git-main/hugo-public - cp -r ../hugo/public ~www/ba/git-main/hugo-public
mac_x64: mac_x64:
tags: tags:
- mac_x64 - mac_x64_cloud
stage: build stage: build
before_script: before_script:
# obtain nr of logical CPUs via `sysctl hw.logicalcpu` - NPROC=12 # number of logical CPUs obtained from `sysctl hw.logicalcpu`
- NPROC=6 - BREWDIR="/opt/homebrew-x86"
- QTDIR=/usr/local/opt/qt - QTDIR="$BREWDIR/Cellar/qt/6.6.0"
- PYPLAT="/Users/scguser/.pyenv/versions/3.11.5/" - PYPLAT="/Users/qtisas/.pyenv/versions/3.11.6/"
- PATH="$BREWDIR:$PATH"
script: &mac_script script: &mac_script
- OPTDIR="/Users/Shared/Software" - OPTDIR="/Users/Shared/Software/scg"
# print environmental variables - CCACHE="$BREWDIR/bin/ccache"
- env - env
- mkdir build - mkdir build
- cd build - cd build
- cmake .. -DCMAKE_PREFIX_PATH="$PYPLAT;$OPTDIR;$QTDIR/lib/cmake" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DBA_APPLE_BUNDLE=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=11 -DCMAKE_INSTALL_PREFIX=/tmp/ba -DBA_PY_PACKAGE=ON - >
cmake .. -DCMAKE_PREFIX_PATH="$OPTDIR;$QTDIR/lib/cmake;$BREWDIR" -DCMAKE_BUILD_TYPE=Release
-DPython3_ROOT_DIR="$PYPLAT" -DCMAKE_CXX_COMPILER_LAUNCHER="$CCACHE" -DBA_APPLE_BUNDLE=ON
-DCMAKE_OSX_DEPLOYMENT_TARGET=11 -DCMAKE_INSTALL_PREFIX=/tmp/ba -DZERO_TOLERANCE=ON
- make -j$NPROC - make -j$NPROC
- ctest -j3 --output-on-failure - ctest -j3 --output-on-failure
- python3 var/mac_py_package.py - python3 var/mac_py_package.py
- cpack -B ./installer . - cpack -V -B ./installer
artifacts: &mac_artifacts artifacts: &mac_artifacts
paths: paths:
- build/installer/*.dmg - build/installer/*.dmg
- build/PythonPackage/py*/wheel/*.whl - build/py/wheel/*.whl
expire_in: 10 days expire_in: 10 days
mac_arm: mac_arm:
...@@ -82,10 +142,10 @@ mac_arm: ...@@ -82,10 +142,10 @@ mac_arm:
- mac_arm - mac_arm
stage: build stage: build
before_script: before_script:
- QTDIR="/opt/homebrew/opt/qt" - NPROC=14 # number of logical CPUs obtained from `sysctl hw.logicalcpu`
- PYPLAT="/Users/scguser/.pyenv/versions/3.11.5/" - BREWDIR="/opt/homebrew"
# obtain nr of logical CPUs via `sysctl hw.logicalcpu` - QTDIR="$BREWDIR/opt/qt"
- NPROC=14 - PYPLAT="/Users/qtisas/.pyenv/versions/3.11.6/"
script: *mac_script script: *mac_script
artifacts: *mac_artifacts artifacts: *mac_artifacts
...@@ -102,23 +162,28 @@ windows: ...@@ -102,23 +162,28 @@ windows:
# paths: # paths:
# - build/ # - build/
script: script:
# add x64 MSVC variables to the environment
- . ./devtools/deploy/windows/setx64vcvars.ps1
- $OPT_DIR = "C:/opt/x64" - $OPT_DIR = "C:/opt/x64"
- $BOOST_DIR = "$OPT_DIR/boost_current" - $BOOST_DIR = "$OPT_DIR/boost_current"
- $BOOST_INCLUDE_DIR = "$BOOST_DIR/include"
- $BOOST_LIB_DIR = "$BOOST_DIR/lib"
- $QT_MSVC_DIR = "C:/Qt/6.2.4/msvc2019_64" - $QT_MSVC_DIR = "C:/Qt/6.2.4/msvc2019_64"
- $QTCMake_DIR = "$QT_MSVC_DIR/lib/cmake" - $QTCMake_DIR = "$QT_MSVC_DIR/lib/cmake"
- $PY_PLATFORM_DIR = "C:/Users/admin/.pyenv/pyenv-win/versions/3.11.5/" - $PY_PLATFORM_DIR = "C:/Users/admin/.pyenv/pyenv-win/versions/3.11.5/"
- $BUILD_DIR = "build" - $BUILD_DIR = "build"
# change the system PATH temporarily (needed for tests)
- $env:PYTHONPATH += "$CI_PROJECT_DIR/build/lib"
- $env:PATH = "$QT_MSVC_DIR/bin;$env:PATH"
# list powershell properties # list powershell properties
- echo "# Path '<$Env:Path>'" - echo "# Path '<$Env:Path>'"
- echo "# PythonPath '<$Env:PYTHONPATH>'" - echo "# PythonPath '<$Env:PYTHONPATH>'"
- echo "# Powershell <$PSHOME>`n PS Profile <$PROFILE>`n PS Command-Path <$PSCOMMANDPATH>" - echo "# Powershell <$PSHOME>`n PS Profile <$PROFILE>`n PS Command-Path <$PSCOMMANDPATH>"
# Visual Studio path <https://github.com/microsoft/vswhere/wiki/Find-VC>
- >
$vsPath = &"${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
-latest -products *
-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationpath
- echo "Microsoft Visual Studio path = '$vsPath'"
- >
Import-Module
(Get-ChildItem $vsPath -Recurse -File -Filter Microsoft.VisualStudio.DevShell.dll).FullName
- Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation -DevCmdArguments '-arch=x64'
- Set-Item -Path "env:CC" -Value "cl.exe"
- Set-Item -Path "env:CXX" -Value "cl.exe"
# list all environmental variables # list all environmental variables
- 'dir Env:' - 'dir Env:'
# make the CMake build directory # make the CMake build directory
...@@ -129,14 +194,25 @@ windows: ...@@ -129,14 +194,25 @@ windows:
- pwd - pwd
# configure, make, test, pack # configure, make, test, pack
- cmake --version - cmake --version
- cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$PY_PLATFORM_DIR;$OPT_DIR;$QTCMake_DIR" -DCMAKE_INCLUDE_PATH="$BOOST_INCLUDE_DIR" -DCMAKE_LIBRARY_PATH="$BOOST_LIB_DIR" -DBA_PY_PACKAGE=ON -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" -B. .. - >
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release
-DCMAKE_PREFIX_PATH="$OPT_DIR;$QTCMake_DIR;$BOOST_DIR"
-DPython3_ROOT_DIR="$PY_PLATFORM_DIR"
-DCPACK_IFW_ROOT="C:/Qt/Tools/QtInstallerFramework/4.5"
-DCMAKE_C_COMPILER_LAUNCHER="buildcache.exe"
-DCMAKE_CXX_COMPILER_LAUNCHER="buildcache.exe"
- pwd - pwd
- if($CI_PIPELINE_SOURCE -eq "schedule") { cmake --build . --target clean; echo "redundant target purge done" } - >
if($CI_PIPELINE_SOURCE -eq "schedule")
{ cmake --build . --target clean; echo "redundant target purge done" }
- cmake --build . -j20 --config Release - cmake --build . -j20 --config Release
- ctest -C Release --parallel 20 --output-on-failure - >
- cpack -C Release -B ./installer . $env:PYTHONPATH += "$CI_PROJECT_DIR/build/lib";
$env:PATH = "$QT_MSVC_DIR/bin;$env:PATH";
ctest -C Release --parallel 20 --output-on-failure
- cpack -V -C Release -B ./installer
artifacts: artifacts:
paths: paths:
- build/installer/BornAgain*.exe - build/installer/BornAgain*.exe
- build/PythonPackage/py*/wheel/*.whl - build/py/wheel/*.whl
expire_in: 10 days expire_in: 10 days
\ No newline at end of file
...@@ -50,7 +50,7 @@ option(BA_DEBUG_OPTIMIZATION "Build with debug optimization (gcc only)" OFF) ...@@ -50,7 +50,7 @@ option(BA_DEBUG_OPTIMIZATION "Build with debug optimization (gcc only)" OFF)
option(BA_TIDY "Invokes clang-tidy" OFF) option(BA_TIDY "Invokes clang-tidy" OFF)
option(BATCH_MODE "Suppress some output" OFF) option(BATCH_MODE "Suppress some output" OFF)
option(ALGORITHM_DIAGNOSTIC "Let some algorithms set diagnostic variables" OFF) option(ALGORITHM_DIAGNOSTIC "Let some algorithms set diagnostic variables" OFF)
option(BA_PY_PACKAGE "Build a Python wheel with the default Python platform, or a given Python platform (via BA_PY_PLATFORM)" OFF) option(BA_PY_PACKAGE "Build a Python wheel with the default Python platform, or a given Python platform (via BA_PY_PLATFORM)" ON)
option(BUILD_DEBIAN "Build a debian package" OFF) option(BUILD_DEBIAN "Build a debian package" OFF)
option(BA_APPLE_BUNDLE "Create a MacOS bundle" OFF) option(BA_APPLE_BUNDLE "Create a MacOS bundle" OFF)
option(BA_CPP_API "Install header files" OFF) option(BA_CPP_API "Install header files" OFF)
......
...@@ -25,8 +25,8 @@ if(NOT WIN32) ...@@ -25,8 +25,8 @@ if(NOT WIN32)
endif() endif()
string(APPEND CMAKE_CXX_FLAGS " -Wno-unused-const-variable") string(APPEND CMAKE_CXX_FLAGS " -Wno-unused-const-variable")
elseif(GCC) elseif(GCC)
string(APPEND CMAKE_CXX_FLAGS " -Wno-unused-but-set-variable")
endif() endif()
string(APPEND CMAKE_CXX_FLAGS " -Wno-unused-but-set-variable")
else() else()
string(APPEND CMAKE_CXX_FLAGS " /wd4244 /wd4267 /wd5033") string(APPEND CMAKE_CXX_FLAGS " /wd4244 /wd4267 /wd5033")
endif() endif()
......
...@@ -40,6 +40,8 @@ string(APPEND CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS " -m64 ${DEADSTRIP_LFLAGS}") ...@@ -40,6 +40,8 @@ string(APPEND CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS " -m64 ${DEADSTRIP_LFLAGS}")
string(APPEND CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS " -m64 ${DEADSTRIP_LFLAGS}") string(APPEND CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS " -m64 ${DEADSTRIP_LFLAGS}")
string(APPEND CMAKE_CXX_FLAGS " -m64 -I${CMAKE_SOURCE_DIR}/Wrap") string(APPEND CMAKE_CXX_FLAGS " -m64 -I${CMAKE_SOURCE_DIR}/Wrap")
string(APPEND CMAKE_C_FLAGS " -m64") string(APPEND CMAKE_C_FLAGS " -m64")
add_compile_options("-Wno-deprecated-declarations;-Wno-unused-parameter;-Wno-deprecated-copy") # TODO remove after r21
# string(APPEND CMAKE_C_LINK_FLAGS " -bind_at_load -m64") # string(APPEND CMAKE_C_LINK_FLAGS " -bind_at_load -m64")
# string(APPEND CMAKE_CXX_LINK_FLAGS " -bind_at_load -m64") # string(APPEND CMAKE_CXX_LINK_FLAGS " -bind_at_load -m64")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment