ocaml-torch icon indicating copy to clipboard operation
ocaml-torch copied to clipboard

installing on macos in presence of other pytorch instances

Open nilsbecker opened this issue 2 years ago • 11 comments

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/

torch.out.txt

some environment variables that might be relevant

torch.env.redacted.txt

nilsbecker avatar Feb 16 '23 09:02 nilsbecker