Default to Accelerate for SIMD math on macOS #277
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: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build-and-test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| compiler: [gcc] | |
| include: | |
| - os: windows-latest | |
| compiler: clang-cl | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up MSVC (Windows) | |
| if: runner.os == 'Windows' | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| - name: Build library | |
| shell: bash | |
| run: | | |
| if [ "$RUNNER_OS" == "Windows" ]; then | |
| # Visual Studio generators are multi-config; select Release at build time. | |
| cmake -S . -B build -G "Visual Studio 17 2022" -T ClangCL \ | |
| -DCMAKE_C_COMPILER=clang-cl | |
| grep -Ei '^CMAKE_C_COMPILER:(FILEPATH|STRING|UNINITIALIZED)=.*clang-cl' build/CMakeCache.txt | |
| else | |
| cmake -S . -B build -DCMAKE_BUILD_TYPE=Release | |
| fi | |
| if [ "$RUNNER_OS" == "Windows" ]; then | |
| cmake --build build --config Release | |
| else | |
| cmake --build build --parallel | |
| fi | |
| - name: Build and run tests | |
| shell: bash | |
| run: | | |
| if [ "$RUNNER_OS" == "Windows" ]; then | |
| ctest --test-dir build -C Release --output-on-failure || \ | |
| ctest --test-dir build -C Release --rerun-failed --output-on-failure | |
| else | |
| ctest --test-dir build --output-on-failure || \ | |
| ctest --test-dir build --rerun-failed --output-on-failure | |
| fi | |
| - name: Trace DSL JIT backend activity | |
| if: ${{ false }} | |
| shell: bash | |
| run: | | |
| set -o pipefail | |
| if [ "$RUNNER_OS" == "Windows" ]; then | |
| ME_DSL_TRACE=1 ctest --test-dir build -C Release -R "^test_dsl_jit_runtime_cache$" -V \ | |
| 2>&1 | tee build/dsl-jit-trace.log | |
| else | |
| ME_DSL_TRACE=1 ctest --test-dir build -R "^test_dsl_jit_runtime_cache$" -V \ | |
| 2>&1 | tee build/dsl-jit-trace.log | |
| fi | |
| grep -E "jit ir built:|jit runtime (built|skip|hit|stubbed):" build/dsl-jit-trace.log || true | |
| linux-arm64-jit: | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Configure (JIT enabled) | |
| shell: bash | |
| run: | | |
| cmake -S . -B build-arm64-jit -DCMAKE_BUILD_TYPE=Release -DMINIEXPR_ENABLE_TCC_JIT=ON | |
| grep -E '^MINIEXPR_ENABLE_TCC_JIT:BOOL=ON$' build-arm64-jit/CMakeCache.txt | |
| - name: Build | |
| shell: bash | |
| run: | | |
| cmake --build build-arm64-jit --parallel | |
| - name: Test | |
| shell: bash | |
| run: | | |
| ME_DSL_JIT=1 ctest --test-dir build-arm64-jit --output-on-failure || \ | |
| ME_DSL_JIT=1 ctest --test-dir build-arm64-jit --rerun-failed --output-on-failure | |
| linux-arm64-interpreter: | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Configure (interpreter only) | |
| shell: bash | |
| run: | | |
| cmake -S . -B build-arm64-interpreter -DCMAKE_BUILD_TYPE=Release -DMINIEXPR_ENABLE_TCC_JIT=OFF | |
| grep -E '^MINIEXPR_ENABLE_TCC_JIT:BOOL=OFF$' build-arm64-interpreter/CMakeCache.txt | |
| - name: Build | |
| shell: bash | |
| run: | | |
| cmake --build build-arm64-interpreter --parallel | |
| - name: Test | |
| shell: bash | |
| run: | | |
| ME_DSL_JIT=0 ctest --test-dir build-arm64-interpreter -E "^test_dsl_jit_runtime_cache$" --output-on-failure || \ | |
| ME_DSL_JIT=0 ctest --test-dir build-arm64-interpreter -E "^test_dsl_jit_runtime_cache$" --rerun-failed --output-on-failure | |
| windows-arm64: | |
| runs-on: windows-11-arm | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up MSVC (Windows/ARM64) | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| with: | |
| arch: arm64 | |
| - name: Configure | |
| shell: bash | |
| run: | | |
| # Keep Windows/ARM64 on interpreter mode until minicc/libtcc supports this target. | |
| cmake -S . -B build-win-arm64 -G "Visual Studio 17 2022" -A ARM64 -T ClangCL \ | |
| -DCMAKE_C_COMPILER=clang-cl \ | |
| -DMINIEXPR_BUILD_BUNDLED_LIBTCC=OFF \ | |
| -DMINIEXPR_ENABLE_TCC_JIT=OFF | |
| grep -Ei '^CMAKE_C_COMPILER:(FILEPATH|STRING|UNINITIALIZED)=.*clang-cl' build-win-arm64/CMakeCache.txt | |
| grep -E '^MINIEXPR_BUILD_BUNDLED_LIBTCC:BOOL=OFF$' build-win-arm64/CMakeCache.txt | |
| grep -E '^MINIEXPR_ENABLE_TCC_JIT:BOOL=OFF$' build-win-arm64/CMakeCache.txt | |
| - name: Build | |
| shell: bash | |
| run: | | |
| cmake --build build-win-arm64 --config Release | |
| - name: Test | |
| shell: bash | |
| run: | | |
| ME_DSL_JIT=0 ctest --test-dir build-win-arm64 -C Release -E "^test_dsl_jit_runtime_cache$" --output-on-failure || \ | |
| ME_DSL_JIT=0 ctest --test-dir build-win-arm64 -C Release -E "^test_dsl_jit_runtime_cache$" --rerun-failed --output-on-failure | |
| miniexpr-wasm32: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| - name: Set up Emscripten | |
| uses: mymindstorm/setup-emsdk@v14 | |
| with: | |
| version: latest | |
| - name: Configure wasm32 build | |
| shell: bash | |
| run: | | |
| emcmake cmake -S . -B build-wasm32 -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_CROSSCOMPILING_EMULATOR=node \ | |
| -DMINIEXPR_BUILD_SHARED=OFF \ | |
| -DMINIEXPR_BUILD_STATIC=ON \ | |
| -DMINIEXPR_BUILD_BENCH=OFF \ | |
| -DMINIEXPR_BUILD_EXAMPLES=OFF \ | |
| -DMINIEXPR_USE_SLEEF=OFF \ | |
| -DMINIEXPR_BUILD_BUNDLED_LIBTCC=OFF \ | |
| -DMINIEXPR_DSL_TRACE_DEFAULT=ON | |
| - name: Verify wasm32 CMake flags | |
| shell: bash | |
| run: | | |
| grep -E '^MINIEXPR_BUILD_BUNDLED_LIBTCC:BOOL=OFF$' build-wasm32/CMakeCache.txt | |
| grep -E '^MINIEXPR_ENABLE_TCC_JIT:BOOL=ON$' build-wasm32/CMakeCache.txt | |
| grep -E '^MINIEXPR_WASM32_SIDE_MODULE:BOOL=ON$' build-wasm32/CMakeCache.txt | |
| - name: Build wasm32 miniexpr + tests | |
| shell: bash | |
| run: | | |
| cmake --build build-wasm32 -j | |
| - name: Run wasm32 tests | |
| shell: bash | |
| run: | | |
| ctest --test-dir build-wasm32 --output-on-failure || \ | |
| ctest --test-dir build-wasm32 --rerun-failed --output-on-failure | |
| - name: Verify wasm32 side-module JIT helper path | |
| shell: bash | |
| run: | | |
| set -o pipefail | |
| ME_DSL_TRACE=1 ctest --test-dir build-wasm32 -R "^test_dsl_jit_side_module$" -V \ | |
| | tee build-wasm32/side-module-trace.log | |
| grep -Eq "\\[me-dsl\\] jit runtime built: fp=.* compiler=tcc" \ | |
| build-wasm32/side-module-trace.log | |
| - name: Trace DSL JIT behavior (wasm32) | |
| shell: bash | |
| run: | | |
| set -o pipefail | |
| : > build-wasm32/dsl-trace.log | |
| node -e 'global.Module={ENV:{ME_DSL_TRACE:"1"}}; require("./build-wasm32/tests/test_dsl_jit_ir.js");' \ | |
| >> build-wasm32/dsl-trace.log 2>&1 | |
| node -e 'global.Module={ENV:{ME_DSL_TRACE:"1"}}; require("./build-wasm32/tests/test_dsl_syntax.js");' \ | |
| >> build-wasm32/dsl-trace.log 2>&1 | |
| echo "=== DSL JIT Trace Summary (wasm32) ===" | |
| if grep -E "\\[me-dsl\\] (jit ir (built|skip|reject):|jit runtime (built|skip|hit|stubbed):)" \ | |
| build-wasm32/dsl-trace.log > /tmp/dsl-trace-summary.raw; then | |
| sed -E 's/fingerprint=[0-9a-f]+/fingerprint=<fp>/g; s/key=[0-9a-f]+/key=<key>/g' \ | |
| /tmp/dsl-trace-summary.raw \ | |
| | sort \ | |
| | uniq -c \ | |
| | sed -E 's/^ +//' | |
| else | |
| echo "No DSL JIT trace lines captured" | |
| fi | |
| echo "=== End Summary ===" |