Testing Embree4 + WinArm #453
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
| name: Build | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CTEST_OUTPUT_ON_FAILURE: ON | |
| CTEST_PARALLEL_LEVEL: 1 | |
| jobs: | |
| #################### | |
| # Linux / macOS | |
| #################### | |
| Unix: | |
| name: ${{ matrix.os }} (${{ matrix.compiler }}, ${{ matrix.config }}, ${{ matrix.sanitizer }}Sanitizer) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-24.04, macos-15-intel, macos-15] | |
| config: [RelWithDebInfo, Debug] | |
| compiler: [gcc, apple, llvm] | |
| sanitizer: ["Address", "Thread"] # TODO: Add Memory+Undefined Sanitizer | |
| exclude: | |
| - os: macos-15-intel | |
| compiler: gcc | |
| - os: macos-15-intel | |
| sanitizer: Thread | |
| - os: macos-15-intel | |
| config: Debug | |
| - os: macos-15 | |
| compiler: gcc | |
| - os: ubuntu-24.04 | |
| compiler: apple | |
| steps: | |
| - name: Free Disk Space | |
| if: runner.os == 'Linux' | |
| uses: jlumbroso/free-disk-space@main | |
| with: | |
| # this might remove tools that are actually needed, | |
| # if set to "true" but frees about 6 GB | |
| tool-cache: false | |
| # all of these default to true, but feel free to set to | |
| # "false" if necessary for your workflow | |
| android: true | |
| dotnet: true | |
| haskell: true | |
| large-packages: true | |
| docker-images: true | |
| swap-storage: true | |
| - name: Set swap space | |
| if: runner.os == 'Linux' && matrix.compiler == 'gcc' && matrix.config == 'RelWithDebInfo' | |
| uses: pierotofy/set-swap-space@fc79b3f67fa8a838184ce84a674ca12238d2c761 | |
| with: | |
| swap-size-gb: 16 | |
| - name: Show disk and memory space | |
| run: | | |
| echo "disk usage:" | |
| df -h | |
| echo "memory:" | |
| if command -v free &>/dev/null; then free -h; else sysctl hw.memsize; fi | |
| - name: Select build dir (Linux) | |
| if: runner.os == 'Linux' | |
| # Find mount point with the largest available space for our build dir... | |
| run: | | |
| space_cwd=$(df --output=avail . | tail -1 | tr -d ' ') | |
| space_mnt=$(df --output=avail /mnt 2>/dev/null | tail -1 | tr -d ' ') | |
| echo "Space available on ./: $space_cwd KB" | |
| echo "Space available on /mnt: $space_mnt KB" | |
| if [ -n "$space_mnt" ] && [ "$space_mnt" -gt "$space_cwd" ]; then | |
| echo "build_dir=/mnt/build" >> "$GITHUB_ENV" | |
| echo "Selected /mnt/build (/mnt has $((space_mnt/1024/1024)) GB free vs ./ has $((space_cwd/1024/1024)) GB free)" | |
| sudo mkdir -p /mnt/build | |
| sudo chown $USER /mnt/build | |
| else | |
| echo "build_dir=build" >> "$GITHUB_ENV" | |
| echo "Selected ./build (./ has $((space_cwd/1024/1024)) GB free)" | |
| fi | |
| - name: Select build dir (macOS) | |
| if: runner.os == 'macOS' | |
| run: echo "build_dir=build" >> "$GITHUB_ENV" | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # Note: Update to actions/checkout@6 once 6.0.2 is out, and remove the fetch-depth: 0 | |
| # https://github.com/actions/checkout/issues/1471 | |
| with: | |
| fetch-tags: true | |
| fetch-depth: 0 | |
| - name: Install Ninja | |
| uses: seanmiddleditch/gha-setup-ninja@master | |
| - name: Install mold | |
| uses: rui314/setup-mold@v1 | |
| - name: Dependencies (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| if [ "${{ matrix.compiler }}" = "gcc" ]; then | |
| sudo apt-get install -y g++ | |
| echo "CC=gcc" >> $GITHUB_ENV | |
| echo "CXX=g++" >> $GITHUB_ENV | |
| else | |
| sudo apt-get install -y clang | |
| echo "CC=clang" >> $GITHUB_ENV | |
| echo "CXX=clang++" >> $GITHUB_ENV | |
| fi | |
| sudo apt-get install -y xorg-dev | |
| - name: Dependencies (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| if [ "${{ matrix.compiler }}" = "llvm" ]; then | |
| brew install llvm@17 | |
| echo "CC='$(brew --prefix llvm@17)/bin/clang'" >> $GITHUB_ENV | |
| echo "CXX='$(brew --prefix llvm@17)/bin/clang++'" >> $GITHUB_ENV | |
| fi | |
| - name: Ccache | |
| uses: hendrikmuhs/ccache-action@v1.2 | |
| with: | |
| key: ${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.sanitizer }}-${{ matrix.config }} | |
| - name: Setup Xcode version | |
| if: matrix.os == 'macos-15-intel' | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: '16.4' | |
| - name: Setup Xcode version | |
| if: matrix.os == 'macos-15' | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: '26.0.1' | |
| - name: Select embree isa (Linux) | |
| if: runner.os == 'Linux' | |
| run: echo "embree_max_isa=SSE2" >> $GITHUB_ENV | |
| - name: Select embree isa (macOS x64) | |
| if: runner.os == 'macOS' && runner.arch == 'X64' | |
| # Cap at SSE2: DEFAULT builds all ISAs, OOM-killing the 14 GB intel runner. | |
| run: echo "embree_max_isa=SSE2" >> $GITHUB_ENV | |
| - name: Select embree isa (macOS arm64) | |
| if: runner.os == 'macOS' && runner.arch == 'ARM64' | |
| run: echo "embree_max_isa=NONE" >> $GITHUB_ENV | |
| - name: Get number of CPU cores | |
| uses: SimenB/github-actions-cpu-cores@v1 | |
| id: cpu-cores | |
| - name: Configure | |
| run: | | |
| cmake --version | |
| cmake -B ${{ env.build_dir }} -S . -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=${{ matrix.config }} \ | |
| -DLAGRANGE_JENKINS=ON \ | |
| -DLAGRANGE_ALL=ON \ | |
| -DLAGRANGE_LIMIT_PARALLELISM=ON \ | |
| -DOPENVDB_CORE_SHARED=ON \ | |
| -DOPENVDB_CORE_STATIC=OFF \ | |
| -DUSE_EXPLICIT_INSTANTIATION=OFF \ | |
| -DLAGRANGE_POLYSCOPE_MOCK_BACKEND=ON \ | |
| -DEMBREE_MAX_ISA=${{ env.embree_max_isa }} \ | |
| -DUSE_SANITIZER="${{ matrix.sanitizer }}" | |
| - name: Build | |
| run: cmake --build ${{ env.build_dir }} -j ${{ steps.cpu-cores.outputs.count }} | |
| - name: Show disk space | |
| if: always() | |
| run: | | |
| echo "disk usage:" | |
| df -h | |
| - name: Tests | |
| run: cd ${{ env.build_dir }}; ctest --verbose -j ${{ steps.cpu-cores.outputs.count }} | |
| #################### | |
| # Windows | |
| #################### | |
| Windows: | |
| name: ${{ matrix.os }} (${{ matrix.config }}) | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| SCCACHE_GHA_ENABLED: "true" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-2025, windows-11-arm] | |
| config: [Release, Debug] | |
| steps: | |
| - name: Show disk space | |
| run: Get-PSDrive | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-tags: true | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v5 | |
| if: matrix.os != 'windows-11-arm' | |
| with: | |
| python-version: 3.13 | |
| # On windows-11-arm the hostedtoolcache Python ships only the interpreter binary; | |
| # it lacks include/ headers and libs/python3XX.lib, so CMake cannot satisfy the | |
| # Development.Module component. Use uv instead: it pulls python-build-standalone | |
| # distributions which include full dev files. uv defaults to x64-emulated Python | |
| # on ARM64 Windows (uv PR #13724), so we must pin the aarch64 specifier. | |
| - uses: astral-sh/setup-uv@v6 | |
| if: matrix.os == 'windows-11-arm' | |
| - name: Install native ARM64 Python via uv | |
| if: matrix.os == 'windows-11-arm' | |
| shell: pwsh | |
| run: | | |
| uv python install cpython-3.13-windows-aarch64 | |
| $pyExe = (uv python find cpython-3.13-windows-aarch64).Trim() | |
| echo "PYTHON_ARM64_EXE=$($pyExe -replace '\\', '/')" >> $env:GITHUB_ENV | |
| - name: Install Ninja | |
| uses: seanmiddleditch/gha-setup-ninja@master | |
| - name: Set env variable for sccache | |
| run: | | |
| echo "appdata=$env:LOCALAPPDATA" >> ${env:GITHUB_ENV} | |
| # Disable idle timeout: embree AVX2 files take 12+ min each and can occupy all job slots, | |
| # starving sccache of requests until the default 600s timeout kills the server. | |
| echo "SCCACHE_IDLE_TIMEOUT=0" >> ${env:GITHUB_ENV} | |
| - name: Get number of CPU cores | |
| uses: SimenB/github-actions-cpu-cores@v1 | |
| id: cpu-cores | |
| - name: Sccache | |
| uses: mozilla-actions/sccache-action@v0.0.10 | |
| - name: Set x64 vars | |
| if: matrix.os == 'windows-2025' | |
| run: | | |
| echo "BUILD_DIR=D:/build" >> ${env:GITHUB_ENV} | |
| echo "ARCH=x64" >> ${env:GITHUB_ENV} | |
| - name: Set arm64 vars | |
| if: matrix.os == 'windows-11-arm' | |
| run: | | |
| echo "BUILD_DIR=C:/build" >> ${env:GITHUB_ENV} | |
| echo "ARCH=arm64" >> ${env:GITHUB_ENV} | |
| - name: Setup MSVC Developer Command Prompt | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| with: | |
| arch: ${{ env.ARCH }} | |
| # Cmd uses ^ to break commands into multiple lines, powershell uses ` | |
| - name: Configure | |
| if: matrix.os != 'windows-11-arm' | |
| run: | | |
| cmake --version | |
| cmake -G Ninja ` | |
| -DCMAKE_BUILD_TYPE=${{ matrix.config }} ` | |
| -DLAGRANGE_JENKINS=ON ` | |
| -DLAGRANGE_ALL=ON ` | |
| -DLAGRANGE_POLYSCOPE_MOCK_BACKEND=ON ` | |
| -B ${{ env.BUILD_DIR }} ` | |
| -S . | |
| # Force CMake to use the ARM64 Python (now complete with dev files) | |
| # and skip the Windows registry so it doesn't fall back to x64 Python. | |
| - name: Configure (ARM64) | |
| if: matrix.os == 'windows-11-arm' | |
| run: | | |
| cmake --version | |
| cmake -G Ninja ` | |
| -DCMAKE_BUILD_TYPE=${{ matrix.config }} ` | |
| -DLAGRANGE_JENKINS=ON ` | |
| -DLAGRANGE_ALL=ON ` | |
| -DLAGRANGE_POLYSCOPE_MOCK_BACKEND=ON ` | |
| -DPython_EXECUTABLE="$env:PYTHON_ARM64_EXE" ` | |
| -DPython_FIND_REGISTRY=NEVER ` | |
| -B ${{ env.BUILD_DIR }} ` | |
| -S . | |
| - name: Build | |
| run: cmake --build ${{ env.BUILD_DIR }} -j ${{ steps.cpu-cores.outputs.count }} | |
| - name: Sccache stats | |
| if: always() | |
| shell: bash | |
| run: ${SCCACHE_PATH} --show-stats | |
| - name: Show disk space | |
| if: always() | |
| run: Get-PSDrive | |
| - name: Tests | |
| run: cd ${{ env.BUILD_DIR }}; ctest --verbose -j ${{ steps.cpu-cores.outputs.count }} |