CMake: Require c++20 #6
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
| # Build within the manylinux 2_28 container, to check ensure compatability for python wheels. | |
| name: Manylinux_2_28 | |
| # Run on branch push events (i.e. not tag pushes) and on pull requests | |
| on: | |
| # Branch pushes that do not only modify other workflow files | |
| push: | |
| branches: | |
| - '**' | |
| paths: | |
| - "**" | |
| - "!.github/**" | |
| - ".github/scripts/install_cuda_el8.sh" | |
| - ".github/workflows/Manylinux_2_28.yml" | |
| # Disabled for now. See https://github.com/FLAMEGPU/FLAMEGPU2/pull/644 | |
| # pull_request: | |
| # Allow manual invocation. | |
| workflow_dispatch: | |
| defaults: | |
| run: | |
| shell: bash | |
| # A single job, which builds manylinux_2_28 wheels, which ships with GCC 12. | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.cudacxx.os }} | |
| # Run steps inside a manylinux container. | |
| container: quay.io/pypa/manylinux_2_28_x86_64 | |
| strategy: | |
| fail-fast: false | |
| # Multiplicative build matrix | |
| # optional exclude: can be partial, include: must be specific | |
| matrix: | |
| cudacxx: | |
| - cuda: "13.0" | |
| cuda_arch: "75" | |
| hostcxx: gcc-toolset-12 | |
| os: ubuntu-24.04 | |
| - cuda: "12.0" | |
| cuda_arch: "50" | |
| hostcxx: gcc-toolset-9 | |
| os: ubuntu-24.04 | |
| config: | |
| - name: "Release" | |
| config: "Release" | |
| # Name the job based on matrix/env options | |
| name: "build (${{ matrix.cudacxx.cuda }}, ${{ matrix.config.name }}, ${{ matrix.cudacxx.os }})" | |
| env: | |
| # Control if static GLEW should be built and used or not. | |
| USE_STATIC_GLEW: "ON" | |
| # Define constants | |
| BUILD_DIR: "build" | |
| # Port matrix options to environment, for more portability. | |
| CUDA: ${{ matrix.cudacxx.cuda }} | |
| CUDA_ARCH: ${{ matrix.cudacxx.cuda_arch }} | |
| HOSTCXX: ${{ matrix.cudacxx.hostcxx }} | |
| OS: ${{ matrix.cudacxx.os }} | |
| CONFIG: ${{ matrix.config.config }} | |
| # Kept for portable steps between this and the main repository. | |
| VISUALISATION: "ON" | |
| # Short term fix to use node16 not node20 for actions. This will stop working eventually, forcing our hand in dropping manylinux2014 support. | |
| ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Downgrade the gcc-toolset in the image based on the build matrix | |
| - name: Install RHEL gcc-toolset (EL 8) | |
| if: ${{ startsWith(env.HOSTCXX, 'gcc-toolset-') }} | |
| run: | | |
| # Install gcc-toolset-X | |
| yum install -y ${{ env.HOSTCXX }} | |
| # Enable the toolset via source not scl enable which doesn't get on with multi-step GHA | |
| source /opt/rh/${{ env.HOSTCXX }}/enable | |
| # Export the new environment / compilers for subsequent steps. | |
| echo "PATH=${PATH}" >> $GITHUB_ENV | |
| echo "CC=$(which gcc)" >> $GITHUB_ENV | |
| echo "CXX=$(which g++)" >> $GITHUB_ENV | |
| echo "CUDAHOSTCXX=$(which g++)" >> $GITHUB_ENV | |
| - name: Install CUDA (EL 8) | |
| if: ${{ env.CUDA != '' }} | |
| env: | |
| cuda: ${{ env.CUDA }} | |
| run: .github/scripts/install_cuda_el8.sh | |
| # Downgrade CMake for DeVIL and rapidjson. See https://github.com/FLAMEGPU/FLAMEGPU2/issues/1276 | |
| - name: Install CMake < 4.0, overwriting the pipx installed version from manylinux | |
| run: | | |
| pipx install --global --force 'cmake<4.0' | |
| - name: Install Visualisation Dependencies (EL 8) | |
| if: ${{ env.VISUALISATION == 'ON' }} | |
| run: | | |
| yum install -y glew-devel fontconfig-devel SDL2-devel freetype-devel | |
| # Build/Install DevIL from source. | |
| yum install -y freeglut-devel | |
| git clone --depth 1 https://github.com/DentonW/DevIL.git | |
| cd DevIL/DevIL | |
| mkdir -p build | |
| cd build | |
| cmake .. -DCMAKE_BUILD_TYPE=${{ env.CONFIG }} -Wno-error=dev | |
| make -j `nproc` | |
| make install | |
| - name: Build and install GLEW including static GLEW | |
| if: ${{ env.VISUALISATION == 'ON' && env.USE_STATIC_GLEW == 'ON' }} | |
| env: | |
| GLEW_VERSION: "2.2.0" | |
| run: | | |
| yum install -y wget | |
| wget https://github.com/nigels-com/glew/releases/download/glew-${{ env.GLEW_VERSION }}/glew-${{ env.GLEW_VERSION }}.tgz | |
| tar -zxf glew-${{ env.GLEW_VERSION }}.tgz | |
| cd glew-${{ env.GLEW_VERSION }} | |
| make | |
| make install | |
| - name: Add custom problem matchers for annotations | |
| run: echo "::add-matcher::.github/problem-matchers.json" | |
| # For manylinux, also set if Using static glew, and to use legacy opengl bindings. | |
| - name: Configure cmake | |
| run: > | |
| cmake . -B "${{ env.BUILD_DIR }}" | |
| -DCMAKE_BUILD_TYPE="${{ env.CONFIG }}" | |
| -Werror=dev | |
| -DCMAKE_WARN_DEPRECATED="OFF" | |
| -DFLAMEGPU_WARNINGS_AS_ERRORS="OFF" | |
| -DCMAKE_CUDA_ARCHITECTURES="${{ env.CUDA_ARCH }}" | |
| -DGLEW_USE_STATIC_LIBS="${{ env.USE_STATIC_GLEW }}" | |
| -DOpenGL_GL_PREFERENCE:STRING=LEGACY | |
| - name: Build | |
| working-directory: ${{ env.BUILD_DIR }} | |
| run: cmake --build . --target all --verbose -j `nproc` |