fix setup script for github workflow #2
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: | |
| push: | |
| pull_request: | |
| env: | |
| BUILD_TYPE: Release | |
| LIBTORCH_URL: https://download.pytorch.org/libtorch/cu126/libtorch-cxx11-abi-shared-with-deps-2.7.0%2Bcu126.zip | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| container: | |
| image: nvidia/cuda:12.6.0-devel-ubuntu24.04 | |
| steps: | |
| - name: Install tools needed for checkout | |
| run: | | |
| apt-get update | |
| apt-get install -y --no-install-recommends git ca-certificates | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive # fetch RAMA submodule here | |
| - name: Install build deps | |
| run: | | |
| apt-get update | |
| apt-get install -y --no-install-recommends \ | |
| build-essential cmake ninja-build pkg-config \ | |
| curl unzip \ | |
| libopencv-dev libopencv-contrib-dev | |
| - name: Cache LibTorch | |
| id: cache-libtorch | |
| uses: actions/cache@v4 | |
| with: | |
| path: _deps/libtorch | |
| key: ${{ runner.os }}-libtorch-${{ env.LIBTORCH_URL }} | |
| - name: Download LibTorch | |
| if: steps.cache-libtorch.outputs.cache-hit != 'true' | |
| run: | | |
| mkdir -p _deps | |
| cd _deps | |
| curl -L "$LIBTORCH_URL" -o libtorch.zip | |
| unzip -q libtorch.zip | |
| rm -f libtorch.zip | |
| - name: Setup repo (submodule + patches + configure) | |
| env: | |
| TORCH_DIR: ${{ github.workspace }}/_deps/libtorch | |
| run: | | |
| chmod +x ./setup.sh | |
| ./setup.sh -GNinja -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DENABLE_CUDA=ON | |
| - name: Build | |
| run: cmake --build build -j 2 |