Install CPU verison of PyTorch. #18
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: CMake | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
unit-tests: | |
runs-on: ubuntu-latest | |
container: | |
image: ubuntu:latest | |
steps: | |
- name: Checkout source code | |
id: checkout | |
uses: actions/checkout@v4 | |
- name: Configure apt recommendations | |
id: configure_apt | |
run: | | |
echo 'APT::Install-Recommends "false";' >> /etc/apt/apt.conf | |
echo 'APT::Install-Suggests "false";' >> /etc/apt/apt.conf | |
- name: Install third-party libraries | |
id: install_packages | |
run: | | |
apt-get update | |
apt-get install -y libunwind-dev | |
apt-get install -y cmake build-essential libboost-test-dev libfmt-dev python3-pip | |
- name: Install PyTorch (CPU) | |
id: install_torch_cpu | |
run: | | |
pip3 install torch+cpu --index-url --index-url https://download.pytorch.org/whl/cpu | |
- name: Find PyTorch CMake path | |
id: find_libtorch | |
run: > | |
echo "cmake_prefix_path=$(python3 -c 'import torch; print(torch.utils.cmake_prefix_path)')" | |
>> $GITHUB_OUTPUT | |
- name: List content | |
run: ls -l ${{steps.find_libtorch.outputs.cmake_prefix_path}} | |
- name: Configure CMake | |
run: > | |
cmake | |
-DCMAKE_PREFIX_PATH=${{steps.find_libtorch.outputs.cmake_prefix_path}} | |
-B ${{github.workspace}}/build | |
- name: Build | |
run: > | |
cmake | |
-DCMAKE_PREFIX_PATH=${{steps.find_libtorch.outputs.cmake_prefix_path}} | |
--build ${{github.workspace}}/build | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: make test ARGS=--verbose" |