Method of compile LibTorchSharp on ARM based Mac OS #837
dayo05
started this conversation in
Show and tell
Replies: 2 comments
-
How to test:
NativeLibrary.Load("/Users/dayo/TorchSharp/src/Native/pytorch/build/lib/libtorch.dylib");
NativeLibrary.Load("/Users/dayo/TorchSharp/src/Native/LibTorchSharp/libLibTorchSharp.dylib"); I check that test passed. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I have integrated an arm64 build into the build system using the arm64 torch binaries from anaconda: PR #903 If you're still interested in arm64 support, maybe you can help validate the PR? :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Do this on your risk!!
Before we go, please replace
path/to/TorchSharp
andpath/to/pytorch
to yours!A. Clone https://github.com/pytorch/pytorch.git
B. install dependencies of compile. This is introduced on README.md on pytorch's github repo.
C. Execute setup.py
A. Open /path/to/TorchSharp/src/Native/LibTorchSharp/CMakeLists.txt
B. Remove
crc32c.c
andcrc32c.h
. Those files uses cpuinfo.h which not exists on ARM.A. Generate MakeFile with this command:
CMAKE_PREFIX_PATH=path/to/pytorch/torch/share/cmake Caffe2_DIR=path/to/pytorch/torch/share/cmake/Caffe2 cmake .
B. Build with command
make
If this method works fine, native library will exists on path/to/TorchSharp/src/Native/LibTorchSharp/libTorchSharp.dylib
I don't test this yet but maybe you can load the library via
NativeLibrary.Load
Beta Was this translation helpful? Give feedback.
All reactions