System | Status |
---|---|
Linux | |
MaxOS | |
Windows |
- cmake
- libtorch download here(to get version 1.0.1 just change
-latest
with-1.0.1
)
- Windows:
cmake -DTorch_DIR="YOUR_libtorch_DIR\share\cmake\Torch" . -G "Visual Studio 15 2017 Win64"
- Linux:
cmake -DTorch_DIR="YOUR_libtorch_DIR/share/cmake/Torch" .
- For CUDA support add
-DCMAKE_BUILD_TYPE="Release"
to the commands above.
- Open the generated solution file, click on Properties on the LibTorch project and select Dynamic Library instead of Static in the Configuration type tab (remeber to also change the target extension).
- Build the solution
- (In case VS complains about some Python lib not in the path, go into Properties, Linked, Include, and manually include those libs)
- Just type
make
. ThelibTorchSharp.so
file will be generated in the project location.
- Windows 10 machine (with Linux subsystem)
- Ubuntu 18.04
- libtorch 1.0 and 1.0.1
- Visual Studio 2017 (v141, Windows SDK 10.0.17134.0)