Add support for modular build structure. #258
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright (c) 2020 Mohammad Ashar Khan | |
| # Copyright (c) 2021 Cem Bassoy | |
| # Distributed under Boost Software License, Version 1.0 | |
| # (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) | |
| name: "Linux" | |
| on: | |
| push: | |
| paths-ignore: | |
| - '**.md' | |
| - 'doc/**' | |
| pull_request: | |
| paths-ignore: | |
| - '**.md' | |
| - 'doc/**' | |
| jobs: | |
| build: | |
| name: Ubuntu "cxx=${{matrix.config.cxx}}, std=c++${{matrix.config.cxxstd}}, variant=c++${{matrix.config.variant}}" | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ${{matrix.config.container}} | |
| volumes: | |
| - /node20217:/node20217:rw,rshared | |
| - ${{ startsWith(matrix.config.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }} | |
| strategy: | |
| fail-fast: false | |
| # If any compiler fails to compile, continue CI for next compiler in matrix instead of failing early | |
| matrix: | |
| config: | |
| - { name: clang, cc: clang-10, cxx: clang++-10, cxxstd: 20, variant: debug, opt: off, container: 'ubuntu:20.04' } | |
| - { name: clang, cc: clang-11, cxx: clang++-11, cxxstd: 20, variant: debug, opt: off, container: 'ubuntu:20.04' } | |
| - { name: clang, cc: clang-10, cxx: clang++-10, cxxstd: 20, variant: release, opt: speed, cxxflags: -fopenmp, ldflags: -lgomp=libomp5, container: 'ubuntu:20.04' } | |
| - { name: clang, cc: clang-11, cxx: clang++-11, cxxstd: 20, variant: release, opt: speed, cxxflags: -fopenmp, ldflags: -lgomp=libomp5, container: 'ubuntu:20.04' } | |
| - { name: gcc, cc: gcc-10, cxx: g++-10, cxxstd: 20, variant: debug, opt: off, container: 'ubuntu:20.04' } | |
| - { name: gcc, cc: gcc-10, cxx: g++-10, cxxstd: 20, variant: release, opt: speed, cxxflags: -fopenmp, ldflags: -lgomp, container: 'ubuntu:20.04' } | |
| steps: | |
| - name: Setup container environment | |
| if: matrix.config.container | |
| run: | | |
| apt-get update | |
| apt-get -y install sudo python3 git g++ curl xz-utils | |
| - name: Install nodejs20glibc2.17 | |
| if: ${{ startsWith( matrix.config.container, 'ubuntu:1' ) }} | |
| run: | | |
| curl -LO https://archives.boost.io/misc/node/node-v20.9.0-linux-x64-glibc-217.tar.xz | |
| tar -xf node-v20.9.0-linux-x64-glibc-217.tar.xz --strip-components 1 -C /node20217 | |
| ldd /__e/node20/bin/node | |
| - name: Install g++-10 | |
| if: matrix.config.cxx == 'g++-10' | |
| run: sudo apt update && sudo apt-get install -y g++-10 libomp-dev | |
| - name: Install Clang 10 | |
| if: matrix.config.cxx == 'clang++-10' | |
| run: sudo apt-get update && sudo apt-get install -y clang-10 | |
| - name: Install Clang 11 | |
| if: matrix.config.cxx == 'clang++-11' | |
| run: sudo apt-get update && sudo apt-get install -y clang-11 | |
| - uses: actions/checkout@v4 | |
| - name: Git Clone Boost.uBlas | |
| run: | | |
| cd ${GITHUB_WORKSPACE} | |
| cd .. | |
| git clone -b master --depth 1 https://github.com/boostorg/boost.git boost-root | |
| cd boost-root | |
| echo "BOOST_ROOT=${PWD}" >> ${GITHUB_ENV} | |
| echo $BOOST_ROOT | |
| git submodule update --init --depth=1 --jobs 8 tools/build | |
| git submodule update --init --depth=1 --jobs 8 libs/config | |
| git submodule update --init --depth=1 --jobs 8 tools/boostdep | |
| mkdir -p libs/numeric/ | |
| cp -rp ${GITHUB_WORKSPACE}/. libs/numeric/ublas | |
| python3 tools/boostdep/depinst/depinst.py -g " --depth=1" -I benchmarks numeric/ublas | |
| - name: Bootstrap Boost and Compile Boost | |
| run: | | |
| cd $BOOST_ROOT | |
| ./bootstrap.sh | |
| ./b2 -j8 headers | |
| echo "using ${{ matrix.config.name }} : : ${{ matrix.config.cxx }} ;" >> ~/user-config.jam; | |
| # - name: Test Benchmarks | |
| # run: | | |
| # cd $BOOST_ROOT | |
| # cd libs/numeric/ublas | |
| # $BOOST_ROOT/b2 -j 4 benchmarks toolset=clang cxxstd=${{matrix.config.cxxstd}} cxxflags="-O3" | |
| - name: Test Tensor Examples | |
| run: | | |
| cd $BOOST_ROOT/libs/numeric/ublas | |
| if [ -z "$cxxflags" ] | |
| then | |
| $BOOST_ROOT/b2 -j8 examples/tensor toolset=${{matrix.config.name}} cxxstd=${{matrix.config.cxxstd}} variant=${{matrix.config.variant}} optimization=${{matrix.config.opt}} | |
| else | |
| $BOOST_ROOT/b2 -j8 examples/tensor toolset=${{matrix.config.name}} cxxstd=${{matrix.config.cxxstd}} variant=${{matrix.config.variant}} optimization=${{matrix.config.opt}} cxxflags="${{matrix.config.cxxflags}}" linkflags="${{matrix.config.ldflags}}" | |
| fi | |
| - name: Test Tensor Unit-Tests | |
| run: | | |
| cd $BOOST_ROOT/libs/numeric/ublas | |
| if [ -z "$cxxflags" ] | |
| then | |
| $BOOST_ROOT/b2 -j8 test/tensor toolset=${{matrix.config.name}} cxxstd=${{matrix.config.cxxstd}} variant=${{matrix.config.variant}} optimization=${{matrix.config.opt}} | |
| else | |
| $BOOST_ROOT/b2 -j8 test/tensor toolset=${{matrix.config.name}} cxxstd=${{matrix.config.cxxstd}} variant=${{matrix.config.variant}} optimization=${{matrix.config.opt}} cxxflags="${{matrix.config.cxxflags}}" linkflags="${{matrix.config.ldflags}}" | |
| fi | |