mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Revert "remove use of tmp_install" (#15847)
Summary: This reverts commit 04bf5285896e52ac118d2f9e9b7f582f695f13e2. Pull Request resolved: https://github.com/pytorch/pytorch/pull/15847 Differential Revision: D13603174 Pulled By: anderspapitto fbshipit-source-id: ae321434d3345ad94fad67bf71fd027cddeb4588
This commit is contained in:
committed by
Facebook Github Bot
parent
4f51ca490e
commit
8a5ba577c1
23
docs/libtorch.rst
Normal file
23
docs/libtorch.rst
Normal file
@ -0,0 +1,23 @@
|
||||
libtorch (C++-only)
|
||||
===================
|
||||
|
||||
The core of pytorch can be built and used without Python. A
|
||||
CMake-based build system compiles the C++ source code into a shared
|
||||
object, libtorch.so.
|
||||
|
||||
Building libtorch
|
||||
-----------------
|
||||
|
||||
There is a script which wraps the CMake build. Invoke it with
|
||||
|
||||
::
|
||||
cd pytorch
|
||||
BUILD_TORCH=ON ONNX_NAMESPACE=onnx_torch bash tools/build_pytorch_libs.sh --use-nnpack caffe2
|
||||
ls torch/lib/tmp_install # output is produced here
|
||||
ls torch/lib/tmp_install/lib/libtorch.so # of particular interest
|
||||
|
||||
To produce libtorch.a rather than libtorch.so, set the environment variable `BUILD_SHARED_LIBS=OFF`.
|
||||
|
||||
To use ninja rather than make, set `CMAKE_GENERATOR="-GNinja" CMAKE_INSTALL="ninja install"`.
|
||||
|
||||
Future work will simplify this further.
|
Reference in New Issue
Block a user