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

backport .gitlab-ci from main

corrections:
- restore var/mk_pypack_linux.sh call
- suppress warning from clang about Root
parent fafdb7e3
No related branches found
No related tags found
2 merge requests!2542merge r21 into main,!2541backport .gitlab-ci from main
Pipeline #141382 failed
......@@ -5,76 +5,136 @@ stages:
variables:
GIT_DEPTH: "1"
native_Debian_clang:
tags: &native
.linux_build: &linux_build
stage: build
artifacts:
paths:
- build/installer/BornAgain*.sh
- build/py/wheel/manylinux/*.whl
expire_in: 3 days
native_Debian:
tags:
- Debian
before_script: &debian_clang
<<: *linux_build
before_script: &native_before
- pwd
- 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
# avoid using the default Debian Qt framework
- QTCMAKE="/usr/local/Qt6/6.2.3/gcc_64/lib/cmake"
- PYPLAT="/home/build/.pyenv/versions/3.11.6/"
- cmake --version
- clang --version
stage: build
script: &native_scr
- env
- mkdir 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
- time ninja
- time xvfb-run -a ctest -j16 --output-on-failure
- time ninja package_source
# NOTE: CMake's Ninja generator should not be used with CMake < 3.26 due to internal bugs.
- time cmake .. -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_PREFIX_PATH="$QTCMAKE" $CHECK_FLAGS
- time make -j16
- time ctest -j16 --output-on-failure
- time make package_source
- time bash var/mk_pypack_linux.sh
- time cpack -B ./installer .
artifacts:
paths:
- build/installer/BornAgain*.sh
- build/PythonPackage/py*/wheel/manylinux/*.whl
expire_in: 10 days
- time cpack -V -B ./installer
.compile_dependency: &compile_dependency
- mkdir build
- cd build
- 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:
rules:
- if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
tags:
- www
before_script: *debian_clang
before_script: *native_before
stage: build
script:
- hugo version
- mkdir build
- cd build
- time cmake .. -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_PREFIX_PATH=$QTCMAKE -DBATCH_MODE=ON
- time make -j8
- time make -j8 webdoc
- time cmake .. -GNinja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DBA_GUI=OFF
- time ninja -j8
- time ninja -j8 webdoc
- rm -rf ~www/ba/git-main/hugo-public
- cp -r ../hugo/public ~www/ba/git-main/hugo-public
mac_x64:
tags:
- mac_x64
- mac_x64_cloud
stage: build
before_script:
# obtain nr of logical CPUs via `sysctl hw.logicalcpu`
- NPROC=6
- QTDIR=/usr/local/opt/qt
- PYPLAT="/Users/scguser/.pyenv/versions/3.11.5/"
- NPROC=12 # number of logical CPUs obtained from `sysctl hw.logicalcpu`
- BREWDIR="/opt/homebrew-x86"
- QTDIR="$BREWDIR/Cellar/qt/6.6.0"
- PYPLAT="/Users/qtisas/.pyenv/versions/3.11.6/"
- PATH="$BREWDIR:$PATH"
script: &mac_script
- OPTDIR="/Users/Shared/Software"
# print environmental variables
- OPTDIR="/Users/Shared/Software/scg"
- CCACHE="$BREWDIR/bin/ccache"
- env
- mkdir 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
- ctest -j3 --output-on-failure
- python3 var/mac_py_package.py
- cpack -B ./installer .
- cpack -V -B ./installer
artifacts: &mac_artifacts
paths:
- build/installer/*.dmg
- build/PythonPackage/py*/wheel/*.whl
- build/py/wheel/*.whl
expire_in: 10 days
mac_arm:
......@@ -82,10 +142,10 @@ mac_arm:
- mac_arm
stage: build
before_script:
- QTDIR="/opt/homebrew/opt/qt"
- PYPLAT="/Users/scguser/.pyenv/versions/3.11.5/"
# obtain nr of logical CPUs via `sysctl hw.logicalcpu`
- NPROC=14
- NPROC=14 # number of logical CPUs obtained from `sysctl hw.logicalcpu`
- BREWDIR="/opt/homebrew"
- QTDIR="$BREWDIR/opt/qt"
- PYPLAT="/Users/qtisas/.pyenv/versions/3.11.6/"
script: *mac_script
artifacts: *mac_artifacts
......@@ -102,23 +162,28 @@ windows:
# paths:
# - build/
script:
# add x64 MSVC variables to the environment
- . ./devtools/deploy/windows/setx64vcvars.ps1
- $OPT_DIR = "C:/opt/x64"
- $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"
- $QTCMake_DIR = "$QT_MSVC_DIR/lib/cmake"
- $PY_PLATFORM_DIR = "C:/Users/admin/.pyenv/pyenv-win/versions/3.11.5/"
- $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
- echo "# Path '<$Env:Path>'"
- echo "# PythonPath '<$Env:PYTHONPATH>'"
- 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
- 'dir Env:'
# make the CMake build directory
......@@ -129,14 +194,25 @@ windows:
- pwd
# configure, make, test, pack
- 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
- 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
- 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:
paths:
- build/installer/BornAgain*.exe
- build/PythonPackage/py*/wheel/*.whl
expire_in: 10 days
- build/py/wheel/*.whl
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)
option(BA_TIDY "Invokes clang-tidy" OFF)
option(BATCH_MODE "Suppress some output" 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(BA_APPLE_BUNDLE "Create a MacOS bundle" OFF)
option(BA_CPP_API "Install header files" OFF)
......
......@@ -25,8 +25,8 @@ if(NOT WIN32)
endif()
string(APPEND CMAKE_CXX_FLAGS " -Wno-unused-const-variable")
elseif(GCC)
string(APPEND CMAKE_CXX_FLAGS " -Wno-unused-but-set-variable")
endif()
string(APPEND CMAKE_CXX_FLAGS " -Wno-unused-but-set-variable")
else()
string(APPEND CMAKE_CXX_FLAGS " /wd4244 /wd4267 /wd5033")
endif()
......
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