poetry2nix icon indicating copy to clipboard operation
poetry2nix copied to clipboard

torch doesn't build on Darwin

Open tscholak opened this issue 3 years ago • 1 comments

I'm seeing this:

patching script interpreter paths in /nix/store/0rqj5xsicj4rw2hhmwcsyh76ihbnm1w9-python3.8-torch-1.9.0
    Traceback (most recent call last):
      File "/nix/store/6sd8810np0z3k5rsbipgmyq6abfjrvn3-python3.8-numpy-1.21.0/lib/python3.8/site-packages/numpy/core/__init__.py", line 22, in <module>
        from . import multiarray
      File "/nix/store/6sd8810np0z3k5rsbipgmyq6abfjrvn3-python3.8-numpy-1.21.0/lib/python3.8/site-packages/numpy/core/multiarray.py", line 12, in <module>
        from . import overrides
      File "/nix/store/6sd8810np0z3k5rsbipgmyq6abfjrvn3-python3.8-numpy-1.21.0/lib/python3.8/site-packages/numpy/core/overrides.py", line 7, in <module>
        from numpy.core._multiarray_umath import (
    ImportError: dlopen(/nix/store/6sd8810np0z3k5rsbipgmyq6abfjrvn3-python3.8-numpy-1.21.0/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so, 2): Symbol not found: __cvtmask32_u32
      Referenced from: /nix/store/6sd8810np0z3k5rsbipgmyq6abfjrvn3-python3.8-numpy-1.21.0/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so
      Expected in: flat namespace
     in /nix/store/6sd8810np0z3k5rsbipgmyq6abfjrvn3-python3.8-numpy-1.21.0/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so

Relevant piece is Symbol not found: __cvtmask32_u32.

Nix code is here: https://github.com/hasktorch/hasktorch-datasets/blob/6cd79115cbfc3202bfe45bdb3972db6feb982603/models/huggingface/default.nix

System description:

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-darwin"`
 - host os: `Darwin 19.6.0, macOS 10.15.7`
 - multi-user?: `no`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.3.10`
 - channels(torsten.scholak): `"darwin, home-manager, nixpkgs-21.05pre291295.efee454783c"`
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
 - nixpkgs: `/Users/torsten.scholak/.nix-defexpr/channels/nixpkgs`

tscholak avatar Jul 22 '21 11:07 tscholak

See https://github.com/numpy/numpy/issues/19624

cpcloud avatar Sep 02 '21 13:09 cpcloud