diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be2c2faaf4..7a2144e64f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Gambit CI +name: Gambit Ubuntu CI on: push: @@ -9,6 +9,8 @@ on: - cron: '0 5 * * *' jobs: + # A job that builds GAMBIT + scanners, tests the command-line interface + # and runs a minimal test run with spartan.yaml gambit_build: runs-on: [docker, self-hosted] strategy: @@ -48,7 +50,7 @@ jobs: - name: Configure with cmake run: | cd BUILD/ && . buildenv.sh - cmake .. -D WITH_ROOT=OFF -D WITH_RESTFRAMES=OFF -D WITH_HEPMC=ON -D WITH_YODA=ON -D BUILD_FS_MODELS="CMSSM;MSSM;MDM" -D WITH_MPI=OFF + cmake .. -D CMAKE_CXX_FLAGS="-rdynamic" -D WITH_ROOT=OFF -D WITH_RESTFRAMES=OFF -D WITH_HEPMC=ON -D WITH_YODA=ON -D BUILD_FS_MODELS="CMSSM;MSSM;MDM" -D WITH_MPI=OFF - name: Build scanners run: | cd BUILD/ && . buildenv.sh @@ -57,28 +59,208 @@ jobs: - name: Build Gambit run: | cd BUILD && . buildenv.sh + # Build YODA and HepMC first, to avoid race condition during parallel build: https://github.com/GambitBSM/gambit/issues/467 + # Can remove this once issue #467 is fixed. + make -j$(( ($(nproc)+1)/2 )) yoda + make -j$(( ($(nproc)+1)/2 )) hepmc + # Now build Gambit make -j$(( ($(nproc)+1)/2 )) gambit - - name: Build backends - run: | - cd BUILD && . buildenv.sh - #make -j$(( ($(nproc)+1)/2 )) backends - make backends - name: CLI test run: | . BUILD/buildenv.sh ./gambit -h - - name: WC test + - name: Run spartan.yaml run: | . BUILD/buildenv.sh - ./gambit -f yaml_files/WC_lite.yaml - - name: ColliderBit test + ./gambit -rf yaml_files/spartan.yaml + + + # A job that tests the builds for all backends in the "make backends" target. + # Backends that are anyway tested as part of the "test_runs" job can be skipped, + # see the build_backends.sh command below. + backends_build: + if: ${{ always() }} + needs: [gambit_build] # Sets run order + runs-on: [docker, self-hosted] + strategy: + fail-fast: false + matrix: + arch: [ubuntu] #, ubuntu-py2, fedora + #mpi: [ON, OFF] + container: gambitbsm/gambit-base:${{ matrix.arch }} + defaults: + run: + shell: bash -eo pipefail {0} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up build environment + run: | + mkdir -p BUILD + cd BUILD + echo "Sourcing setup.sh" + cat /etc/profile.d/gambit-setup.sh + source /etc/profile.d/gambit-setup.sh + echo "Making buildenv.sh" + > buildenv.sh + echo "source /etc/profile.d/gambit-setup.sh" >> buildenv.sh + echo "export CMAKE_BUILD_TYPE=None" >> buildenv.sh + echo "export CMAKE_C_COMPILER=$(which gcc)" >> buildenv.sh + echo "export CMAKE_CXX_COMPILER=$(which g++)" >> buildenv.sh + echo "export CMAKE_Fortran_COMPILER=$(which gfortran)" >> buildenv.sh + PYTHON_LIBRARY=$(python -c 'from __future__ import print_function; from distutils.sysconfig import get_config_var; print("%s/%s" % (get_config_var("LIBDIR"), get_config_var("INSTSONAME")))') + PYTHON_INCLUDE_DIR=$(python -c 'from __future__ import print_function; from distutils import sysconfig; print(sysconfig.get_config_var("INCLUDEPY"))') + echo "export PYTHON_EXECUTABLE=$(which python)" >> buildenv.sh + echo "export PYTHON_LIBRARY=$PYTHON_LIBRARY" >> buildenv.sh + echo "export PYTHON_INCLUDE_DIR=$PYTHON_INCLUDE_DIR" >> buildenv.sh + echo "export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH" >> buildenv.sh + cat buildenv.sh + pip install --upgrade pyyaml pybind11 h5py scipy numpy pyhf configobj pandas matplotlib setuptools==58.2.0 + - name: Configure with cmake + run: | + cd BUILD/ && . buildenv.sh + cmake .. -D CMAKE_CXX_FLAGS="-rdynamic" -D WITH_ROOT=OFF -D WITH_RESTFRAMES=OFF -D WITH_HEPMC=ON -D WITH_YODA=ON -D BUILD_FS_MODELS="CMSSM;MSSM;MDM" -D WITH_MPI=OFF + - name: Build backends + run: | + cd BUILD && . buildenv.sh + # Build backends, except those that are tested via other jobs. + # This replaces the "make backends" command. + ../cmake/scripts/build_backends.sh -f default_backends.txt -j 1 -s "nulike susyhit rivet contur pythia higgsbounds higgssignals ATLAS_FullLikes superiso heplikedata heplike" + + + # A job for GAMBIT test runs. Only those GAMBIT modules, scanners and backends + # required by the test runs are built. + test_runs: + if: ${{ always() }} + needs: [gambit_build, backends_build] # Sets run order + runs-on: [docker, self-hosted] + strategy: + fail-fast: false + matrix: + arch: [ubuntu] #, ubuntu-py2, fedora + #mpi: [ON, OFF] + container: gambitbsm/gambit-base:${{ matrix.arch }} + defaults: + run: + shell: bash -eo pipefail {0} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up build environment + run: | + mkdir -p BUILD + cd BUILD + echo "Sourcing setup.sh" + cat /etc/profile.d/gambit-setup.sh + source /etc/profile.d/gambit-setup.sh + echo "Making buildenv.sh" + > buildenv.sh + echo "source /etc/profile.d/gambit-setup.sh" >> buildenv.sh + echo "export CMAKE_BUILD_TYPE=None" >> buildenv.sh + echo "export CMAKE_C_COMPILER=$(which gcc)" >> buildenv.sh + echo "export CMAKE_CXX_COMPILER=$(which g++)" >> buildenv.sh + echo "export CMAKE_Fortran_COMPILER=$(which gfortran)" >> buildenv.sh + PYTHON_LIBRARY=$(python -c 'from __future__ import print_function; from distutils.sysconfig import get_config_var; print("%s/%s" % (get_config_var("LIBDIR"), get_config_var("INSTSONAME")))') + PYTHON_INCLUDE_DIR=$(python -c 'from __future__ import print_function; from distutils import sysconfig; print(sysconfig.get_config_var("INCLUDEPY"))') + echo "export PYTHON_EXECUTABLE=$(which python)" >> buildenv.sh + echo "export PYTHON_LIBRARY=$PYTHON_LIBRARY" >> buildenv.sh + echo "export PYTHON_INCLUDE_DIR=$PYTHON_INCLUDE_DIR" >> buildenv.sh + echo "export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH" >> buildenv.sh + cat buildenv.sh + pip install --upgrade pyyaml pybind11 h5py scipy numpy pyhf configobj pandas matplotlib setuptools==58.2.0 + - name: Configure with cmake + run: | + cd BUILD/ && . buildenv.sh + cmake .. -D CMAKE_CXX_FLAGS="-rdynamic" -D WITH_ROOT=OFF -D WITH_RESTFRAMES=OFF -D WITH_HEPMC=ON -D WITH_YODA=ON -D BUILD_FS_MODELS="CMSSM" -D WITH_MPI=OFF -Ditch="DarkBit;CosmoBit;NeutrinoBit;ObjectivesBit" + - name: Build required scanners + run: | + cd BUILD/ && . buildenv.sh + make -j$(( ($(nproc)+1)/2 )) diver + cmake .. + - name: Build required backends + run: | + cd BUILD/ && . buildenv.sh + # Build bakends needed for ColliderBit_CMSSM.yaml + make -j$(( ($(nproc)+1)/2 )) nulike + make -j$(( ($(nproc)+1)/2 )) susyhit + make -j$(( ($(nproc)+1)/2 )) rivet + make -j$(( ($(nproc)+1)/2 )) contur + make -j$(( ($(nproc)+1)/2 )) pythia + make -j$(( ($(nproc)+1)/2 )) higgsbounds + make -j$(( ($(nproc)+1)/2 )) higgssignals + make ATLAS_FullLikes + # Build bakends needed for WC.yaml + make superiso + make -j$(( ($(nproc)+1)/2 )) heplikedata + make -j$(( ($(nproc)+1)/2 )) heplike + - name: Build Gambit + run: | + cd BUILD && . buildenv.sh + # Build YODA and HepMC first, to avoid race condition during parallel build: https://github.com/GambitBSM/gambit/issues/467 + # Can remove this once issue #467 is fixed. + make -j$(( ($(nproc)+1)/2 )) yoda + make -j$(( ($(nproc)+1)/2 )) hepmc + # Now build Gambit + make -j$(( ($(nproc)+1)/2 )) gambit + - name: Run ColliderBit_CMSSM.yaml + run: | + . BUILD/buildenv.sh + ./gambit -rf yaml_files/ColliderBit_CMSSM.yaml + - name: Run WC.yaml run: | . BUILD/buildenv.sh - ./gambit -f yaml_files/ColliderBit_CMSSM.yaml + ./gambit -rf yaml_files/WC.yaml + + + # A job that builds all the standalones + standalones_build: + if: ${{ always() }} + needs: [gambit_build, backends_build, test_runs] # Sets run order + runs-on: [docker, self-hosted] + strategy: + fail-fast: false + matrix: + arch: [ubuntu] #, ubuntu-py2, fedora + #mpi: [ON, OFF] + container: gambitbsm/gambit-base:${{ matrix.arch }} + defaults: + run: + shell: bash -eo pipefail {0} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up build environment + run: | + mkdir -p BUILD + cd BUILD + echo "Sourcing setup.sh" + cat /etc/profile.d/gambit-setup.sh + source /etc/profile.d/gambit-setup.sh + echo "Making buildenv.sh" + > buildenv.sh + echo "source /etc/profile.d/gambit-setup.sh" >> buildenv.sh + echo "export CMAKE_BUILD_TYPE=None" >> buildenv.sh + echo "export CMAKE_C_COMPILER=$(which gcc)" >> buildenv.sh + echo "export CMAKE_CXX_COMPILER=$(which g++)" >> buildenv.sh + echo "export CMAKE_Fortran_COMPILER=$(which gfortran)" >> buildenv.sh + PYTHON_LIBRARY=$(python -c 'from __future__ import print_function; from distutils.sysconfig import get_config_var; print("%s/%s" % (get_config_var("LIBDIR"), get_config_var("INSTSONAME")))') + PYTHON_INCLUDE_DIR=$(python -c 'from __future__ import print_function; from distutils import sysconfig; print(sysconfig.get_config_var("INCLUDEPY"))') + echo "export PYTHON_EXECUTABLE=$(which python)" >> buildenv.sh + echo "export PYTHON_LIBRARY=$PYTHON_LIBRARY" >> buildenv.sh + echo "export PYTHON_INCLUDE_DIR=$PYTHON_INCLUDE_DIR" >> buildenv.sh + echo "export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH" >> buildenv.sh + cat buildenv.sh + pip install --upgrade pyyaml pybind11 h5py scipy numpy pyhf configobj pandas matplotlib setuptools==58.2.0 + - name: Configure with cmake + run: | + cd BUILD/ && . buildenv.sh + cmake .. -D CMAKE_CXX_FLAGS="-rdynamic" -D WITH_ROOT=OFF -D WITH_RESTFRAMES=OFF -D WITH_HEPMC=ON -D WITH_YODA=ON -D BUILD_FS_MODELS="CMSSM;MSSM;MDM" -D WITH_MPI=OFF - name: Build standalones run: | cd BUILD && . buildenv.sh make standalones + + # - name: Validation dependencies # run: | # . BUILD/buildenv.sh diff --git a/.github/workflows/ci_Mac_arm64.yml b/.github/workflows/ci_Mac_arm64.yml index e10f02d9fc..391e2c0dc5 100644 --- a/.github/workflows/ci_Mac_arm64.yml +++ b/.github/workflows/ci_Mac_arm64.yml @@ -1,4 +1,4 @@ -name: Gambit CI +name: Gambit Mac Arm64 CI on: push: @@ -30,18 +30,101 @@ jobs: run: | echo "Configure with cmake" cd BUILD - cmake -DWITH_MPI=ON -DWITH_HEPMC=ON -DWITH_YODA=ON -DBUILD_FS_MODELS="CMSSM;MSSM;MDM" -Ditch="micromegas_DMsimpVectorMedVectorDM" .. + cmake -DCMAKE_CXX_FLAGS="-rdynamic" -DWITH_MPI=ON -DWITH_HEPMC=ON -DWITH_YODA=ON -DBUILD_FS_MODELS="CMSSM;MSSM;MDM" -Ditch="micromegas_DMsimpVectorMedVectorDM" .. - name: Build scanners run: | echo "Build scanners" cd BUILD make -j $(( $(sysctl -n hw.ncpu)/2 )) scanners cmake .. - - name: Build Backends for tests + - name: Build Gambit + run: | + echo "Build GAMBIT." + cd BUILD + # Build YODA and HepMC first, to avoid race condition during parallel build: https://github.com/GambitBSM/gambit/issues/467 + # Can remove this once issue #467 is fixed. + make -j $(( $(sysctl -n hw.ncpu)/2 )) yoda + make -j $(( $(sysctl -n hw.ncpu)/2 )) hepmc + # Now build Gambit + make -j $(( $(sysctl -n hw.ncpu)/2 )) gambit + - name: CLI test + run: | + echo "Run the test of gambit help" + ./gambit -h + - name: Run spartan.yaml + run: | + echo "Testing spartan.yaml (with cout printer)" + sed -i "" 's/ hdf5/ cout/g' yaml_files/spartan.yaml + ./gambit -rf yaml_files/spartan.yaml + + + backends_build: + if: ${{ always() }} + needs: [gambit_build] # Sets run order + runs-on: [self-hosted, macOS, Arm64] + strategy: + fail-fast: false + matrix: + arch: [Arm64] + defaults: + run: + shell: bash -eo pipefail {0} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up build environment + run: | + echo "Set up the build environment" + mkdir -p BUILD + cd BUILD + - name: Configure with cmake + run: | + echo "Configure with cmake" + cd BUILD + cmake -DCMAKE_CXX_FLAGS="-rdynamic" -DWITH_MPI=ON -DWITH_HEPMC=ON -DWITH_YODA=ON -DBUILD_FS_MODELS="CMSSM;MSSM;MDM" -Ditch="micromegas_DMsimpVectorMedVectorDM" .. + - name: Build Backends + run: | + echo "Building all Backends" + cd BUILD + # Build backends, except those that are tested via other jobs. + # This replaces the "make backends" command. + ../cmake/scripts/build_backends.sh -f default_backends.txt -j 1 -s "nulike susyhit rivet contur pythia higgsbounds higgssignals ATLAS_FullLikes superiso heplikedata heplike" + + + test_runs: + if: ${{ always() }} + needs: [gambit_build, backends_build] # Sets run order + runs-on: [self-hosted, macOS, Arm64] + strategy: + fail-fast: false + matrix: + arch: [Arm64] + defaults: + run: + shell: bash -eo pipefail {0} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up build environment + run: | + echo "Set up the build environment" + mkdir -p BUILD + cd BUILD + - name: Configure with cmake + run: | + echo "Configure with cmake" + cd BUILD + cmake -DCMAKE_CXX_FLAGS="-rdynamic" -DWITH_MPI=ON -DWITH_HEPMC=ON -DWITH_YODA=ON -DBUILD_FS_MODELS="CMSSM;MSSM;MDM" -Ditch="micromegas_DMsimpVectorMedVectorDM" .. + - name: Build required scanners + run: | + echo "Build scanners required for test runs" + cd BUILD + make -j $(( $(sysctl -n hw.ncpu)/2 )) diver + cmake .. + - name: Build required backends run: | - echo "Building Backends required for tests" + echo "Building backends required for test runs" cd BUILD - #make -j $(( $(sysctl -n hw.ncpu)/2 )) pythia higgssignals nulike ATLAS_FullLikes susyhit heplike superiso make pythia make higgssignals make nulike @@ -57,33 +140,49 @@ jobs: run: | echo "Build GAMBIT." cd BUILD + # Build YODA and HepMC first, to avoid race condition during parallel build: https://github.com/GambitBSM/gambit/issues/467 + # Can remove this once issue #467 is fixed. + make -j $(( $(sysctl -n hw.ncpu)/2 )) yoda + make -j $(( $(sysctl -n hw.ncpu)/2 )) hepmc + # Now build Gambit make -j $(( $(sysctl -n hw.ncpu)/2 )) gambit - - name: Test spartan yaml - run: | - echo "Testing spartan.yaml (with cout printer)" - sed -i "" 's/ hdf5/ cout/g' yaml_files/spartan.yaml - ./gambit -rf yaml_files/spartan.yaml - - name: CLI test + - name: Run ColliderBit_CMSSM.yaml run: | - echo "Run the test of gambit help" - ./gambit -h - - name: WC test + echo "Test run with ColliderBit_CMSSM.yaml" + ./gambit -f yaml_files/ColliderBit_CMSSM.yaml + - name: Run WC_lite.yaml run: | - echo "Test WC_lite yaml (no printing)" + echo "Test run with WC_lite.yaml (no printing)" sed -i "" 's/ hdf5/ none/g' yaml_files/WC_lite.yaml ./gambit -f yaml_files/WC_lite.yaml - - name: ColliderBit test + + + standalones_build: + if: ${{ always() }} + needs: [gambit_build, backends_build, test_runs] # Sets run order + runs-on: [self-hosted, macOS, Arm64] + strategy: + fail-fast: false + matrix: + arch: [Arm64] + defaults: + run: + shell: bash -eo pipefail {0} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up build environment run: | - echo "Test the ColliderBit CMSSM yaml file" - ./gambit -f yaml_files/ColliderBit_CMSSM.yaml - - name: Build Backends + echo "Set up the build environment" + mkdir -p BUILD + cd BUILD + - name: Configure with cmake run: | - echo "Building all Backends" + echo "Configure with cmake" + cd BUILD + cmake -DCMAKE_CXX_FLAGS="-rdynamic" -DWITH_MPI=ON -DWITH_HEPMC=ON -DWITH_YODA=ON -DBUILD_FS_MODELS="CMSSM;MSSM;MDM" -Ditch="micromegas_DMsimpVectorMedVectorDM" .. + - name: Build standalones + run: | + echo "Test the building of the standalones" cd BUILD - #make -j $(( $(sysctl -n hw.ncpu)/2 )) backends - make backends - #- name: Build standalones - # run: | - # echo "Test the building of the standalones" - # cd BUILD - # make standalones + make standalones diff --git a/.github/workflows/ci_Mac_x64.yml b/.github/workflows/ci_Mac_x64.yml index 54b771efdc..0a16fe27ac 100644 --- a/.github/workflows/ci_Mac_x64.yml +++ b/.github/workflows/ci_Mac_x64.yml @@ -1,4 +1,4 @@ -name: Gambit CI +name: Gambit Mac X64 CI on: push: @@ -31,18 +31,103 @@ jobs: echo "Configure with cmake" cd BUILD # Ditching a few backends that don't currently work on Mac - cmake -DWITH_MPI=ON -DWITH_HEPMC=ON -DWITH_YODA=ON -DBUILD_FS_MODELS="CMSSM;MSSM;MDM" -Ditch="micromegas_DMsimpVectorMedVectorDM" .. + cmake -DCMAKE_CXX_FLAGS="-rdynamic" -DWITH_MPI=ON -DPYTHON_EXECUTABLE=/usr/local/Frameworks/Python.framework/Versions/3.11/bin/python3.11 -DPYTHON_LIBRARY=/usr/local/Frameworks/Python.framework/Versions/3.11/lib/libpython3.11.dylib -DPYTHON_INCLUDE_DIR=/usr/local/Frameworks/Python.framework/Versions/3.11/include/python3.11 -DWITH_HEPMC=ON -DWITH_YODA=ON -DBUILD_FS_MODELS="CMSSM;MSSM;MDM" -Ditch="micromegas_DMsimpVectorMedVectorDM" .. - name: Build scanners run: | echo "Build scanners" cd BUILD make -j $(( $(sysctl -n hw.ncpu)/2 )) scanners cmake .. - - name: Build Backends for tests + - name: Build Gambit + run: | + echo "Build GAMBIT." + cd BUILD + # Build YODA and HepMC first, to avoid race condition during parallel build: https://github.com/GambitBSM/gambit/issues/467 + # Can remove this once issue #467 is fixed. + make -j $(( $(sysctl -n hw.ncpu)/2 )) yoda + make -j $(( $(sysctl -n hw.ncpu)/2 )) hepmc + # Now build Gambit + make -j $(( $(sysctl -n hw.ncpu)/2 )) gambit + - name: CLI test + run: | + echo "Run the test of gambit help" + ./gambit -h + - name: Run spartan.yaml + run: | + echo "Testing spartan.yaml (with cout printer)" + sed -i "" 's/ hdf5/ cout/g' yaml_files/spartan.yaml + ./gambit -rf yaml_files/spartan.yaml + + + backends_build: + if: ${{ always() }} + needs: [gambit_build] # Sets run order + runs-on: [self-hosted, macOS,x64] + strategy: + fail-fast: false + matrix: + arch: [x64] + defaults: + run: + shell: bash -eo pipefail {0} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up build environment + run: | + echo "Set up the build environment" + mkdir -p BUILD + cd BUILD + - name: Configure with cmake run: | - echo "Building Backends" + echo "Configure with cmake" + cd BUILD + # Ditching a few backends that don't currently work on Mac + cmake -DCMAKE_CXX_FLAGS="-rdynamic" -DWITH_MPI=ON -DPYTHON_EXECUTABLE=/usr/local/Frameworks/Python.framework/Versions/3.11/bin/python3.11 -DPYTHON_LIBRARY=/usr/local/Frameworks/Python.framework/Versions/3.11/lib/libpython3.11.dylib -DPYTHON_INCLUDE_DIR=/usr/local/Frameworks/Python.framework/Versions/3.11/include/python3.11 -DWITH_HEPMC=ON -DWITH_YODA=ON -DBUILD_FS_MODELS="CMSSM;MSSM;MDM" -Ditch="micromegas_DMsimpVectorMedVectorDM" .. + - name: Build Backends + run: | + echo "Building all Backends" + cd BUILD + # Build backends, except those that are tested via other jobs. + # This replaces the "make backends" command. + ../cmake/scripts/build_backends.sh -f default_backends.txt -j 1 -s "nulike susyhit rivet contur pythia higgsbounds higgssignals ATLAS_FullLikes superiso heplikedata heplike" + + + test_runs: + if: ${{ always() }} + needs: [gambit_build, backends_build] # Sets run order + runs-on: [self-hosted, macOS,x64] + strategy: + fail-fast: false + matrix: + arch: [x64] + defaults: + run: + shell: bash -eo pipefail {0} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up build environment + run: | + echo "Set up the build environment" + mkdir -p BUILD + cd BUILD + - name: Configure with cmake + run: | + echo "Configure with cmake" + cd BUILD + # Ditching a few backends that don't currently work on Mac + cmake -DCMAKE_CXX_FLAGS="-rdynamic" -DWITH_MPI=ON -DPYTHON_EXECUTABLE=/usr/local/Frameworks/Python.framework/Versions/3.11/bin/python3.11 -DPYTHON_LIBRARY=/usr/local/Frameworks/Python.framework/Versions/3.11/lib/libpython3.11.dylib -DPYTHON_INCLUDE_DIR=/usr/local/Frameworks/Python.framework/Versions/3.11/include/python3.11 -DWITH_HEPMC=ON -DWITH_YODA=ON -DBUILD_FS_MODELS="CMSSM;MSSM;MDM" -Ditch="DarkBit;CosmoBit;NeutrinoBit;ObjectivesBit;micromegas_DMsimpVectorMedVectorDM" .. + - name: Build required scanners + run: | + echo "Build scanners required for test runs" + cd BUILD + make -j $(( $(sysctl -n hw.ncpu)/2 )) diver + cmake .. + - name: Build required backends + run: | + echo "Building backends required for test runs" cd BUILD - #make -j $(( $(sysctl -n hw.ncpu)/2 )) pythia higgssignals nulike ATLAS_FullLikes susyhit heplike superiso make pythia make higgssignals make nulike @@ -58,33 +143,50 @@ jobs: run: | echo "Build GAMBIT." cd BUILD + # Build YODA and HepMC first, to avoid race condition during parallel build: https://github.com/GambitBSM/gambit/issues/467 + # Can remove this once issue #467 is fixed. + make -j $(( $(sysctl -n hw.ncpu)/2 )) yoda + make -j $(( $(sysctl -n hw.ncpu)/2 )) hepmc + # Now build Gambit make -j $(( $(sysctl -n hw.ncpu)/2 )) gambit - - name: Test spartan yaml - run: | - echo "Testing spartan.yaml (with cout printer)" - sed -i "" 's/ hdf5/ cout/g' yaml_files/spartan.yaml - ./gambit -rf yaml_files/spartan.yaml - - name: CLI test + - name: Run ColliderBit_CMSSM.yaml run: | - echo "Run the test of gambit help" - ./gambit -h - - name: WC test + echo "Test run with ColliderBit_CMSSM.yaml" + ./gambit -f yaml_files/ColliderBit_CMSSM.yaml + - name: Run WC_lite.yaml run: | - echo "Test WC_lite yaml (no printing)" + echo "Test run with WC_lite.yaml (no printing)" sed -i "" 's/ hdf5/ none/g' yaml_files/WC_lite.yaml ./gambit -f yaml_files/WC_lite.yaml - - name: ColliderBit test + + + standalones_build: + if: ${{ always() }} + needs: [gambit_build, backends_build, test_runs] # Sets run order + runs-on: [self-hosted, macOS,x64] + strategy: + fail-fast: false + matrix: + arch: [x64] + defaults: + run: + shell: bash -eo pipefail {0} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up build environment run: | - echo "Test the ColliderBit CMSSM yaml file" - ./gambit -f yaml_files/ColliderBit_CMSSM.yaml - - name: Build Backends + echo "Set up the build environment" + mkdir -p BUILD + cd BUILD + - name: Configure with cmake run: | - echo "Building all Backends" + echo "Configure with cmake" + cd BUILD + # Ditching a few backends that don't currently work on Mac + cmake -DCMAKE_CXX_FLAGS="-rdynamic" -DWITH_MPI=ON -DPYTHON_EXECUTABLE=/usr/local/Frameworks/Python.framework/Versions/3.11/bin/python3.11 -DPYTHON_LIBRARY=/usr/local/Frameworks/Python.framework/Versions/3.11/lib/libpython3.11.dylib -DPYTHON_INCLUDE_DIR=/usr/local/Frameworks/Python.framework/Versions/3.11/include/python3.11 -DWITH_HEPMC=ON -DWITH_YODA=ON -DBUILD_FS_MODELS="CMSSM;MSSM;MDM" -Ditch="micromegas_DMsimpVectorMedVectorDM" .. + - name: Build standalones + run: | + echo "Test the building of the standalones" cd BUILD - #make -j $(( $(sysctl -n hw.ncpu)/2 )) backends - make backends - #- name: Build standalones - # run: | - # echo "Test the building of the standalones" - # cd BUILD - # make standalones + make standalones diff --git a/Backends/patches/classy/2.6.3/classy_2.6.3.diff b/Backends/patches/classy/2.6.3/classy_2.6.3.diff index 5a64405a5a..e5811c06c1 100644 --- a/Backends/patches/classy/2.6.3/classy_2.6.3.diff +++ b/Backends/patches/classy/2.6.3/classy_2.6.3.diff @@ -1,5 +1,18 @@ --- a/python/classy.pyx 2017-10-24 14:42:41.000000000 +0100 +++ b/python/classy.pyx 2019-07-03 12:45:27.100272668 +0100 +@@ -85,9 +85,9 @@ + cdef lensing le + cdef file_content fc + +- cpdef int ready # Flag +- cpdef object _pars # Dictionary of the parameters +- cpdef object ncp # Keeps track of the structures initialized, in view of cleaning. ++ cdef int ready # Flag ++ cdef object _pars # Dictionary of the parameters ++ cdef object ncp # Keeps track of the structures initialized, in view of cleaning. + + # Defining two new properties to recover, respectively, the parameters used + # or the age (set after computation). Follow this syntax if you want to @@ -111,8 +111,21 @@ "output":"tCl mPk",} self.set(**_pars) @@ -7,7 +20,7 @@ + # (JR) added to get information from cosmo object + # whether class re-computed or not + #recomputed = True -+ cpdef int recomputed ++ cdef int recomputed + property recomputed: + def __get__(self): + return self.recomputed @@ -17,7 +30,8 @@ + # ------------------ + def __cinit__(self, default=False): - cpdef char* dumc +- cpdef char* dumc ++ cdef char* dumc + self.recomputed = True self.ready = False self._pars = {} diff --git a/Backends/patches/classy/2.9.3/classy_2.9.3.diff b/Backends/patches/classy/2.9.3/classy_2.9.3.diff index 04c247d410..a6b470b4cc 100644 --- a/Backends/patches/classy/2.9.3/classy_2.9.3.diff +++ b/Backends/patches/classy/2.9.3/classy_2.9.3.diff @@ -1,5 +1,20 @@ --- a/python/classy.pyx 2017-10-24 14:42:41.000000000 +0100 +++ b/python/classy.pyx 2019-07-03 12:45:27.100272668 +0100 +@@ -96,10 +96,10 @@ + cdef lensing le + cdef file_content fc + +- cpdef int computed # Flag to see if classy has already computed with the given pars +- cpdef int allocated # Flag to see if classy structs are allocated already +- cpdef object _pars # Dictionary of the parameters +- cpdef object ncp # Keeps track of the structures initialized, in view of cleaning. ++ cdef int computed # Flag to see if classy has already computed with the given pars ++ cdef int allocated # Flag to see if classy structs are allocated already ++ cdef object _pars # Dictionary of the parameters ++ cdef object ncp # Keeps track of the structures initialized, in view of cleaning. + + # Defining two new properties to recover, respectively, the parameters used + # or the age (set after computation). Follow this syntax if you want to @@ -118,13 +118,28 @@ def __get__(self): return self.nl.method @@ -14,7 +29,7 @@ + # (JR) added to get information from cosmo object + # whether class re-computed or not + #recomputed = True -+ cpdef int recomputed ++ cdef int recomputed + property recomputed: + def __get__(self): + return self.recomputed @@ -24,7 +39,8 @@ + # ------------------ + def __cinit__(self, default=False): - cpdef char* dumc +- cpdef char* dumc ++ cdef char* dumc + self.recomputed = True self.allocated = False self.computed = False diff --git a/Backends/patches/classy/2.9.4/classy_2.9.4.diff b/Backends/patches/classy/2.9.4/classy_2.9.4.diff index c9903fdaa3..98d6894240 100644 --- a/Backends/patches/classy/2.9.4/classy_2.9.4.diff +++ b/Backends/patches/classy/2.9.4/classy_2.9.4.diff @@ -1,6 +1,21 @@ --- a/python/classy.pyx 2017-10-24 14:42:41.000000000 +0100 +++ b/python/classy.pyx 2019-07-03 12:45:27.100272668 +0100 -@@ -118,13 +118,28 @@ +@@ -96,10 +96,10 @@ + cdef lensing le + cdef file_content fc + +- cpdef int computed # Flag to see if classy has already computed with the given pars +- cpdef int allocated # Flag to see if classy structs are allocated already +- cpdef object _pars # Dictionary of the parameters +- cpdef object ncp # Keeps track of the structures initialized, in view of cleaning. ++ cdef int computed # Flag to see if classy has already computed with the given pars ++ cdef int allocated # Flag to see if classy structs are allocated already ++ cdef object _pars # Dictionary of the parameters ++ cdef object ncp # Keeps track of the structures initialized, in view of cleaning. + + # Defining two new properties to recover, respectively, the parameters used + # or the age (set after computation). Follow this syntax if you want to +@@ -118,13 +118,28 @@ cdef class Class: def __get__(self): return self.nl.method @@ -14,7 +29,7 @@ + # (JR) added to get information from cosmo object + # whether class re-computed or not + #recomputed = True -+ cpdef int recomputed ++ cdef int recomputed + property recomputed: + def __get__(self): + return self.recomputed @@ -24,7 +39,8 @@ + # ------------------ + def __cinit__(self, default=False): - cpdef char* dumc +- cpdef char* dumc ++ cdef char* dumc + self.recomputed = True self.allocated = False self.computed = False diff --git a/Backends/patches/classy/3.1.0/classy_3.1.0.diff b/Backends/patches/classy/3.1.0/classy_3.1.0.diff index deed35bd06..cb6210d838 100644 --- a/Backends/patches/classy/3.1.0/classy_3.1.0.diff +++ b/Backends/patches/classy/3.1.0/classy_3.1.0.diff @@ -318,6 +318,21 @@ diff --git a/python/classy.pyx b/python/classy.pyx index b61a20e9..748ad4bb 100644 --- a/python/classy.pyx +++ b/python/classy.pyx +@@ -99,10 +99,10 @@ cdef class Class: + cdef distortions sd + cdef file_content fc + +- cpdef int computed # Flag to see if classy has already computed with the given pars +- cpdef int allocated # Flag to see if classy structs are allocated already +- cpdef object _pars # Dictionary of the parameters +- cpdef object ncp # Keeps track of the structures initialized, in view of cleaning. ++ cdef int computed # Flag to see if classy has already computed with the given pars ++ cdef int allocated # Flag to see if classy structs are allocated already ++ cdef object _pars # Dictionary of the parameters ++ cdef object ncp # Keeps track of the structures initialized, in view of cleaning. + + # Defining two new properties to recover, respectively, the parameters used + # or the age (set after computation). Follow this syntax if you want to @@ -126,8 +126,21 @@ cdef class Class: "output":"tCl mPk",} self.set(**_pars) @@ -325,7 +340,7 @@ index b61a20e9..748ad4bb 100644 + # (JR) added to get information from cosmo object + # whether class re-computed or not + #recomputed = True -+ cpdef int recomputed ++ cdef int recomputed + property recomputed: + def __get__(self): + return self.recomputed @@ -335,7 +350,8 @@ index b61a20e9..748ad4bb 100644 + # ------------------ + def __cinit__(self, default=False): - cpdef char* dumc +- cpdef char* dumc ++ cdef char* dumc + self.recomputed = True self.allocated = False self.computed = False @@ -363,7 +379,7 @@ index b61a20e9..748ad4bb 100644 + cdef double tau + cdef int last_index #junk + cdef double * pvecback -+ cpdef double t ++ cdef double t + + self.compute(["background"]) + diff --git a/Backends/patches/classy/exo_2.7.2/classy_exo_2.7.2.diff b/Backends/patches/classy/exo_2.7.2/classy_exo_2.7.2.diff index 703849b132..ec5d5d4e3f 100644 --- a/Backends/patches/classy/exo_2.7.2/classy_exo_2.7.2.diff +++ b/Backends/patches/classy/exo_2.7.2/classy_exo_2.7.2.diff @@ -69,6 +69,21 @@ diff --git a/python/classy.pyx b/python/classy.pyx index fae0dd04..a8020991 100644 --- a/python/classy.pyx +++ b/python/classy.pyx +@@ -86,10 +86,10 @@ cdef class Class: + cdef lensing le + cdef file_content fc + +- cpdef int ready # Flag to see if classy can currently compute +- cpdef int allocated # Flag to see if classy structs are allocated already +- cpdef object _pars # Dictionary of the parameters +- cpdef object ncp # Keeps track of the structures initialized, in view of cleaning. ++ cdef int ready # Flag to see if classy can currently compute ++ cdef int allocated # Flag to see if classy structs are allocated already ++ cdef object _pars # Dictionary of the parameters ++ cdef object ncp # Keeps track of the structures initialized, in view of cleaning. + + # Defining two new properties to recover, respectively, the parameters used + # or the age (set after computation). Follow this syntax if you want to @@ -113,8 +113,21 @@ cdef class Class: "output":"tCl mPk",} self.set(**_pars) @@ -76,7 +91,7 @@ index fae0dd04..a8020991 100644 + # (JR) added to get information from cosmo object + # whether class re-computed or not + #recomputed = True -+ cpdef int recomputed ++ cdef int recomputed + property recomputed: + def __get__(self): + return self.recomputed @@ -86,7 +101,8 @@ index fae0dd04..a8020991 100644 + # ------------------ + def __cinit__(self, default=False): - cpdef char* dumc +- cpdef char* dumc ++ cdef char* dumc + self.recomputed = True self.ready = False self.allocated = False diff --git a/cmake/externals.cmake b/cmake/externals.cmake index 22dc754061..720320d40f 100644 --- a/cmake/externals.cmake +++ b/cmake/externals.cmake @@ -243,9 +243,22 @@ macro(add_error_target name) COMMAND exit 1) endmacro() +# A variable needed for file writing in the function below +set(CREATE_BACKENDS_LIST_FILE TRUE) # Function to set up a new target with a generic name of a backend/scanner and associate it with the default version function(set_as_default_version type name default) + # Construct a text file with the names of all the default backends. + # (Needed by our CI jobs, and maybe useful for other things too.) + if (type STREQUAL "backend") + set(backends_list_file "${CMAKE_CURRENT_BINARY_DIR}/default_backends.txt") + if(CREATE_BACKENDS_LIST_FILE) + file(WRITE "${backends_list_file}" "") + set(CREATE_BACKENDS_LIST_FILE FALSE PARENT_SCOPE) + endif() + file(APPEND "${backends_list_file}" "${name}\n") + endif() + #Retrieve the model name if it is also passed if(${ARGC} GREATER 3) set(model ${ARGV3}) diff --git a/cmake/scripts/build_backends.sh b/cmake/scripts/build_backends.sh new file mode 100755 index 0000000000..a69d79d1db --- /dev/null +++ b/cmake/scripts/build_backends.sh @@ -0,0 +1,87 @@ +# Usage: build_backends.sh -f -s -j + +prefix="build_backends.sh:" +make_j_option=1 + +# Parse arguments +while getopts "f:s:j:" opt; do + case $opt in + f) backends_list_file="${OPTARG}" + ;; + s) skip_backends_list="${OPTARG}" + ;; + j) make_j_option="${OPTARG}" + ;; + \?) printf "${prefix} Invalid option. Valid options: -f -s -j \n" >&2 + exit 1 + ;; + esac + + case $OPTARG in + -*) printf "${prefix} Option $opt needs a valid argument \n" >&2 + exit 1 + ;; + esac +done + +if [ -z ${backends_list_file} ]; +then + printf "${prefix} Need an input file. Example: build_backends.sh -f \n" >&2 + exit 1 +fi + +# Check that the input file exists +if [ ! -f ${backends_list_file} ]; +then + printf "${prefix} Cannot find the file ${backends_list_file}\n" >&2 + exit 1 +fi + +# For each backend listed in the input file: +# - Check if the backend is in the $skip_backends_list. +# - If not, try to build it. +# - If the build fails, add it to $failed_backends_list +did_fail=0 +succeeded_backends_list="" +failed_backends_list="" +while read backend || [[ -n $backend ]]; +do + do_skip_backend=0 + for skip_backend_name in $(echo ${skip_backends_list}); + do + if [ ${skip_backend_name} = ${backend} ]; + then + do_skip_backend=1 + fi + done + + if [ ${do_skip_backend} -eq 1 ]; + then + printf "\n${prefix} Will skip backend ${backend}.\n" + else + printf "\n${prefix} Will now attempt to build backend ${backend}.\n" + + # Now run the build command + make -j${make_j_option} ${backend} + if [ $? -ne 0 ]; + then + did_fail=1 + failed_backends_list="${failed_backends_list}, ${backend}" + else + succeeded_backends_list="${succeeded_backends_list}, ${backend}" + fi + fi +done < ${backends_list_file} + +succeeded_backends_list="${succeeded_backends_list:2}" +failed_backends_list="${failed_backends_list:2}" + +# Report result +printf "\n${prefix} SUMMARY:\n" +printf "${prefix} Successful backend builds: ${succeeded_backends_list}\n" +printf "${prefix} Skipped backend builds: ${skip_backends_list}\n" +printf "${prefix} Failed backend builds: ${failed_backends_list}\n\n" + +# Return correct exit code +exit ${did_fail} + diff --git a/yaml_files/WC.yaml b/yaml_files/WC.yaml index b140c5d49a..cee6319b7a 100644 --- a/yaml_files/WC.yaml +++ b/yaml_files/WC.yaml @@ -67,6 +67,7 @@ Printer: options: output_file: "WC.hdf5" group: "/WC" + delete_file_on_restart: true Scanner: