ocaml-torch
ocaml-torch copied to clipboard
installing on macos in presence of other pytorch instances
I'm able to opam install ocaml-torch on my intel mac, macos 12.6.3 when i first uninstall other pytorch distributions on the system
- anaconda installed pytorch
- homebrew installed pytorch
if either of these is present, opam installation of ocaml-torch fails.
for example, after brew install pytorch at version 1.13.1, and retrying opam reinstall torch i then get an opam error containing
# /Users/nbecker/.opam/414torch/lib/libtorch/include/torch/csrc/api/include/torch/ordered_dict.h:375:33: error: redefinition of 'insert'
# Value& OrderedDict<Key, Value>::insert(K&& key, V&& value) {
# ^
# /usr/local/include/torch/csrc/api/include/torch/ordered_dict.h:375:33: note: previous definition is here
this appears to indicate that the homebrew version of pytorch in /usr/local/include/torch was somehow mixed up with the vendored version in ~/.opam//414torch/lib/libtorch/
some environment variables that might be relevant