如何解决如何在 mac OS X 中安装 ocaml-pytorch 没有错误?
我最近尝试安装 opam install torch
,但出现链接器问题。您在 mac os x 上运行的安装命令是什么?
我的错误:
(automl-meta-learning) brando~/ML4Coq ❯ opam install torch
[NOTE] It seems you have not updated your repositories for a while. Consider updating them with:
opam update
The following actions will be performed:
- install torch 0.10
<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[torch.0.10] found in cache
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ERROR] The compilation of torch failed at "/Users/brando/.opam/opam-init/hooks/sandbox.sh build dune build -p torch -j 15".
#=== ERROR while compiling torch.0.10 =========================================#
# context 2.0.7 | macos/x86_64 | ocaml-variants.4.07.1+flambda | https://opam.ocaml.org#bcb3c300
# path ~/.opam/4.07.1+flambda/.opam-switch/build/torch.0.10
# command ~/.opam/opam-init/hooks/sandbox.sh build dune build -p torch -j 15
# exit-code 1
# env-file ~/.opam/log/torch-46975-6d07ae.env
# output-file ~/.opam/log/torch-46975-6d07ae.out
### output ###
# ocamlmklib src/wrapper/dlltorch_core_stubs.so,src/wrapper/libtorch_core_stubs.a (exit 2)
# (cd _build/default && /Users/brando/.opam/4.07.1+flambda/bin/ocamlmklib.opt -g -o src/wrapper/torch_core_stubs src/wrapper/torch_api.o src/wrapper/torch_stubs.o -lstdc++ -Wl,-rpath,/Users/brando/anaconda3/envs/automl-meta-learning/lib/python3.8/site-packages/torch/lib -L/Users/brando/anaconda3/envs/automl-meta-learning/lib/python3.8/site-packages/torch/lib -lc10 -ltorch_cpu -ltorch -Wl,-rpath[...]
# ld: file not found: @rpath/libiomp5.dylib for architecture x86_64
# clang: error: linker command failed with exit code 1 (use -v to see invocation)
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+- The following actions failed
| - build torch 0.10
+-
- No changes have been performed
# Run eval $(opam env) to update the current shell environment
到目前为止,我已经运行了以下 .sh 脚本:
opam update
#apt-get install pkg-config
brew install pkg-config
# apt-get install libffi
brew install libffi
opam install torch
交叉发布:https://github.com/LaurentMazare/ocaml-torch/issues/2
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。