LibTorch Linux x86_64 #2
This file contains 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: LibTorch Linux x86_64 | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
type: string | |
description: The name of the branch you want to build. | |
required: true | |
jobs: | |
build: | |
runs-on: ['ubuntu-latest'] | |
container: ubuntu:20.04 | |
timeout-minutes: 120 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
activate-environment: pytorch | |
- name: Conda deps | |
run: | | |
conda install cmake ninja python==3.13 | |
- name: Clone | |
run: | | |
git clone -b ${{ github.event.inputs.branch }} --recurse-submodule https://github.com/pytorch/pytorch.git | |
- run: | | |
cd pytorch | |
pip install -r requirements.txt | |
pip install mkl-static mkl-include | |
- name: Build Libtorch | |
run: | | |
mkdir pytorch-build | |
cd pytorch-build | |
cmake \ | |
-DBUILD_SHARED_LIBS:BOOL=ON \ | |
-DCMAKE_BUILD_TYPE:STRING=Release \ | |
-DBUILD_PYTHON=OFF \ | |
-DUSE_CUDA=OFF \ | |
-DCMAKE_INSTALL_PREFIX:PATH=../libtorch \ | |
../pytorch | |
cmake --build . --target install --parallel 8 | |
- name: Create archive | |
run: | | |
zip -r libtorch-linux-x86_64-${{ github.event.inputs.branch }}.zip libtorch/ | |
- uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: libtorch-linux-x86_64-${{ github.event.inputs.branch }}.zip | |
overwrite: true | |
file_glob: true | |
tag: LibTorch-for-R | |