Opened 5 years ago

Closed 5 years ago

#59631 closed defect (worksforme)

py37-numpy: Library not loaded: @rpath/libmkl_rt.dylib

Reported by: mf2k (Frank Schima) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.6.99
Keywords: Cc:
Port: py-numpy

Description

I'm seeing the following build error for py37-torchvision.

:debug:build system:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_macports_macports-ports_python_py-torchvision/py37-torchvision/work/vision-0.4.1" && /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 setup.py build 
:info:build Traceback (most recent call last):
:info:build   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/__init__.py", line 17, in <module>
:info:build     from . import multiarray
:info:build   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/multiarray.py", line 14, in <module>
:info:build     from . import overrides
:info:build   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/overrides.py", line 7, in <module>
:info:build     from numpy.core._multiarray_umath import (
:info:build ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/_multiarray_umath.cpython-37m-darwin.so, 9): Library not loaded: @rpath/libmkl_rt.dylib
:info:build   Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/_multiarray_umath.cpython-37m-darwin.so
:info:build   Reason: image not found
:info:build During handling of the above exception, another exception occurred:
:info:build Traceback (most recent call last):
:info:build   File "setup.py", line 13, in <module>
:info:build     import torch
:info:build   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/torch/__init__.py", line 81, in <module>
:info:build     from torch._C import *
:info:build   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/__init__.py", line 142, in <module>
:info:build     from . import core
:info:build   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/__init__.py", line 47, in <module>
:info:build     raise ImportError(msg)
:info:build ImportError: 
:info:build IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
:info:build Importing the numpy c-extensions failed.
:info:build - Try uninstalling and reinstalling numpy.
:info:build - If you have already done that, then:
:info:build   1. Check that you expected to use Python3.7 from "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7",
:info:build      and that you have no directories in your PATH or PYTHONPATH that can
:info:build      interfere with the Python and numpy version "1.17.3" you're trying to use.
:info:build   2. If (1) looks fine, you can open a new issue at
:info:build      https://github.com/numpy/numpy/issues.  Please include details on:
:info:build      - how you installed Python
:info:build      - how you installed numpy
:info:build      - your operating system
:info:build      - whether or not you have multiple versions of Python installed
:info:build      - if you built from source, your compiler versions and ideally a build log
:info:build - If you're working with a numpy git repository, try `git clean -xdf`
:info:build   (removes all files not under version control) and rebuild numpy.
:info:build Note: this error has many possible causes, so please don't comment on
:info:build an existing issue about this - open a new one instead.
:info:build Original error was: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/_multiarray_umath.cpython-37m-darwin.so, 9): Library not loaded: @rpath/libmkl_rt.dylib
:info:build   Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/_multiarray_umath.cpython-37m-darwin.so
:info:build   Reason: image not found

I am seeing this on Mojave and Xcode 11.2.

Attachments (1)

main.log (12.7 KB) - added by mf2k (Frank Schima) 5 years ago.

Download all attachments as: .zip

Change History (7)

Changed 5 years ago by mf2k (Frank Schima)

Attachment: main.log added

comment:1 Changed 5 years ago by cjones051073 (Chris Jones)

Looks to me the issue is in fact with numpy and nor directly torch vision ?

Last edited 5 years ago by cjones051073 (Chris Jones) (previous) (diff)

comment:2 Changed 5 years ago by cjones051073 (Chris Jones)

Also builds just fine for me here, on macOS10.15.

Can you please run some tests to see if py37-numpy is working ok ?

comment:3 Changed 5 years ago by mf2k (Frank Schima)

Port: py-numpy added; py-torchvision removed
Summary: py37-torchvision: Library not loaded: @rpath/libmkl_rt.dylibpy37-numpy: Library not loaded: @rpath/libmkl_rt.dylib

You are right, that is the issue. I'll look into it. I think we can call this a py-numpy issue.

comment:4 Changed 5 years ago by mf2k (Frank Schima)

Owner: changed from cjones051073 to michaelld

comment:5 Changed 5 years ago by mf2k (Frank Schima)

Maybe a problem with the +openblas variant?

$ port installed py37-numpy
The following ports are currently installed:
  py37-numpy @1.17.3_0+gfortran+openblas (active)

comment:6 Changed 5 years ago by mf2k (Frank Schima)

Resolution: worksforme
Status: assignedclosed

I no longer see this issue.

Note: See TracTickets for help on using tickets.