I want to use CMake to build PyTorch and LibTorch instead of using python setup.py install
1 Like
You can build and install both PyTorch and LibTorch with CMake. First, clone the repository using git clone --recursive https://github.com/pytorch/pytorch
, then install the necessary dependencies. Create a build directory and configure with cmake ..
, adding any options you need (like CPU-only or GPU). Build with cmake --build . --config Release
, and finally, install using sudo cmake --install .