Opened 2 years ago

Closed 2 years ago

#63814 closed defect (fixed)

py-numpy: missed runtime dependency on macOS Monterey M1

Reported by: catap (Kirill A. Korinsky) Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: monterey Cc: michaelld (Michael Dickens), cooljeanius (Eric Gallager)
Port: py-numpy libgcc11

Description

When I install numpy it can't be used:

catap@Mac-mini ~ % sudo port install --unrequested py39-numpy 
--->  Computing dependencies for py39-numpy
--->  Fetching archive for py39-numpy
--->  Attempting to fetch py39-numpy-1.21.3_1+gfortran+openblas.darwin_21.arm64.tbz2 from https://nue.de.packages.macports.org/py39-numpy
--->  Attempting to fetch py39-numpy-1.21.3_1+gfortran+openblas.darwin_21.arm64.tbz2.rmd160 from https://nue.de.packages.macports.org/py39-numpy
--->  Installing py39-numpy @1.21.3_1+gfortran+openblas
--->  Activating py39-numpy @1.21.3_1+gfortran+openblas
--->  Cleaning py39-numpy
--->  Updating database of binaries
--->  Scanning binaries for linking errors
--->  No broken files found.
--->  No broken ports found.
catap@Mac-mini ~ % otool -L /opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-darwin.so
2021-11-05 17:13:06.155 xcodebuild[31525:239753] XType: com.apple.fonts is not accessible.
2021-11-05 17:13:06.156 xcodebuild[31525:239753] XType: XTFontStaticRegistry is enabled.
/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-darwin.so:
	/opt/local/lib/libopenblas-r1.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
catap@Mac-mini ~ % otool -L /opt/local/lib/libopenblas-r1.dylib
/opt/local/lib/libopenblas-r1.dylib:
	/opt/local/lib/libopenblas-r1.dylib (compatibility version 0.0.0, current version 0.0.0)
	@rpath/libgfortran.5.dylib (compatibility version 6.0.0, current version 6.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
catap@Mac-mini ~ % otool -L /opt/local/lib/libgcc/libgfortran.5.dylib
/opt/local/lib/libgcc/libgfortran.5.dylib:
	@rpath/libgfortran.5.dylib (compatibility version 6.0.0, current version 6.0.0)
	@rpath/libgcc_s.1.1.dylib (compatibility version 1.0.0, current version 1.1.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
catap@Mac-mini ~ % python3.9                                         
Python 3.9.7 (default, Oct 31 2021, 06:09:35) 
[Clang 13.0.0 (clang-1300.0.29.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/__init__.py", line 22, in <module>
    from . import multiarray
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/multiarray.py", line 12, in <module>
    from . import overrides
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/overrides.py", line 7, in <module>
    from numpy.core._multiarray_umath import (
ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-darwin.so, 0x0002): Library not loaded: @rpath/libgcc_s.1.1.dylib
  Referenced from: /opt/local/lib/libgcc/libgfortran.5.dylib
  Reason: tried: '/opt/local/lib/libgcc/libgcc_s.1.1.dylib' (no such file), '/opt/local/lib/libgcc_s.1.1.dylib' (no such file), '/opt/local/lib/libgcc_s.1.1.dylib' (no such file), '/opt/local/lib/gcc-devel/gcc/aarch64-apple-darwin21/12.0.0/libgcc_s.1.1.dylib' (no such file), '/opt/local/lib/gcc-devel/gcc/aarch64-apple-darwin21/12.0.0/../../../libgcc_s.1.1.dylib' (no such file), '/opt/local/lib/libgcc/libgcc_s.1.1.dylib' (no such file), '/usr/local/lib/libgcc_s.1.1.dylib' (no such file), '/usr/lib/libgcc_s.1.1.dylib' (no such file)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/__init__.py", line 150, in <module>
    from . import core
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/__init__.py", line 48, in <module>
    raise ImportError(msg)
ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.9 from "/opt/local/bin/python3.9"
  * The NumPy version is: "1.21.3"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-darwin.so, 0x0002): Library not loaded: @rpath/libgcc_s.1.1.dylib
  Referenced from: /opt/local/lib/libgcc/libgfortran.5.dylib
  Reason: tried: '/opt/local/lib/libgcc/libgcc_s.1.1.dylib' (no such file), '/opt/local/lib/libgcc_s.1.1.dylib' (no such file), '/opt/local/lib/libgcc_s.1.1.dylib' (no such file), '/opt/local/lib/gcc-devel/gcc/aarch64-apple-darwin21/12.0.0/libgcc_s.1.1.dylib' (no such file), '/opt/local/lib/gcc-devel/gcc/aarch64-apple-darwin21/12.0.0/../../../libgcc_s.1.1.dylib' (no such file), '/opt/local/lib/libgcc/libgcc_s.1.1.dylib' (no such file), '/usr/local/lib/libgcc_s.1.1.dylib' (no such file), '/usr/lib/libgcc_s.1.1.dylib' (no such file)

>>> 

Change History (8)

comment:1 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: michaelld added
Keywords: monterey added
Port: py-numpy libgcc11 added

I've seen this in a build log before too, and the fact that the problem seems to be that /opt/local/lib/libgcc/libgfortran.5.dylib cannot find /opt/local/lib/libgcc/libgcc_s.1.1.dylib makes it sound to me like a defect in the port that provides /opt/local/lib/libgcc/libgfortran.5.dylib, which on my High Sierra system at least is libgcc11, and we already know that does not build on Monterey (#63677, #63780) so I'm not sure how we even got to the point of py39-numpy being able to be installed.

comment:2 Changed 2 years ago by catap (Kirill A. Korinsky)

The most wired things. When I rebuild it from scratch -s it works very well:

catap@Mac-mini ~ % sudo port -s install --unrequested py39-numpy 
--->  Computing dependencies for py39-numpy
--->  Fetching distfiles for py39-numpy
--->  Attempting to fetch numpy-1.21.3.tar.gz from https://github.com/numpy/numpy/tarball/v1.21.3
--->  Verifying checksums for py39-numpy                                                     
--->  Extracting py39-numpy
--->  Applying patches to py39-numpy
--->  Configuring py39-numpy
--->  Building py39-numpy
--->  Staging py39-numpy into destroot                   
--->  Installing py39-numpy @1.21.3_1+gfortran+openblas  
--->  Activating py39-numpy @1.21.3_1+gfortran+openblas
--->  Cleaning py39-numpy
--->  Updating database of binaries
--->  Scanning binaries for linking errors
--->  No broken files found.
--->  No broken ports found.
catap@Mac-mini ~ % python3.9
Python 3.9.7 (default, Oct 31 2021, 06:09:35) 
[Clang 13.0.0 (clang-1300.0.29.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> 

comment:3 Changed 2 years ago by catap (Kirill A. Korinsky)

and removing or installing gcc-devel is enough to fix it.

Version 0, edited 2 years ago by catap (Kirill A. Korinsky) (next)

comment:4 Changed 2 years ago by bal-agates

See #63864 I just created. This suggests a quick fix that worked on my system. I am new to portfiles and it will take me some time to figure out if the problem can be fixed in the libgcc-devel portfile.

comment:5 Changed 2 years ago by catap (Kirill A. Korinsky)

I'd love to confirm that #63864 fixed an issue.

comment:6 Changed 2 years ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added

comment:7 Changed 2 years ago by reneeotten (Renee Otten)

so is this indeed fixed by the other ticket - if so, we should close this ticket

comment:8 Changed 2 years ago by michaelld (Michael Dickens)

Resolution: fixed
Status: newclosed

Guessing this issue was indeed fixed as noted. Closing.

Note: See TracTickets for help on using tickets.