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
# Script for installing libtorch from scratch (without any python dependencies) | |
# This clones the ``pytorch`` folder in the current directory, creates a ``pytorch-build`` directory containing all the intermediate files for building, and creates a ``pytorch-install`` folder for storing the compiled library. | |
# After the build, you can use it by setting ``CMAKE_PREFIX_PATH=(path to pytorch-install folder)``. | |
# Note that you need to have all the dependencies needed before running this script! (Read README.md in the main pytorch repo) | |
git clone --recursive https://github.com/pytorch/pytorch -b v1.7.1 --depth 1 | |
mkdir -p pytorch-build | |
mkdir -p pytorch-install | |
pushd pytorch-build |