Opened 4 years ago

Closed 4 years ago

#62744 closed defect (fixed)

py39-opencv4 4.5.2: staging into destroot fails

Reported by: phosphide (Jakub Tomczyński) Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: Cc: stromnov (Andrey Stromnov)
Port: py39-opencv4

Description

py39-opencv4 build successfully, but staging fails with the following output:

--->  Fetching distfiles for py39-opencv4
--->  Verifying checksums for py39-opencv4
--->  Extracting py39-opencv4
--->  Applying patches to py39-opencv4
--->  Configuring py39-opencv4
--->  Building py39-opencv4
--->  Staging py39-opencv4 into destroot
Error: No files have been installed in the destroot directory!
Error: Please make sure that this software supports 'make install DESTDIR=${destroot}' or implement an alternative destroot mechanism in the Portfile.
Error: Files might have been installed directly into your system, check before proceeding.
Error: Failed to destroot py39-opencv4: Staging py39-opencv4 into destroot failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_opencv4/py39-opencv4/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port py39-opencv4 failed

macOS Big Sur 11.2.3, Apple M1. Full log is attached.

Attachments (1)

main.log (2.0 MB) - added by phosphide (Jakub Tomczyński) 4 years ago.
py39-opencv4 @4.5.2 main.log

Download all attachments as: .zip

Change History (14)

Changed 4 years ago by phosphide (Jakub Tomczyński)

Attachment: main.log added

py39-opencv4 @4.5.2 main.log

comment:1 Changed 4 years ago by mascguy (Christopher Nielsen)

I'll take this, please reassign to me. Thanks!

comment:2 Changed 4 years ago by mascguy (Christopher Nielsen)

This error occurs when the Python bindings aren't built successfully.

Indeed, I'm seeing the following in the logs. It looks like there's in an issue with py39-numpy:

:info:configure -- Found PythonInterp: /opt/local/bin/python3.9 (found suitable version "3.9.4", minimum required is "3.2") 
:info:configure -- Found PythonLibs: /opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/libpython3.9.dylib (found sui
table exact version "3.9.4") 
:info:configure Traceback (most recent call last):
:info:configure   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/__init__.py", line 22, in <module>
:info:configure     from . import multiarray
:info:configure   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/multiarray.py", line 12, in <module>
:info:configure     from . import overrides
:info:configure   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/overrides.py", line 7, in <module>
:info:configure     from numpy.core._multiarray_umath import (
:info:configure ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-darwin.so, 2): Library not loaded: @rpath/libgcc_s.1.1.dylib
:info:configure   Referenced from: /opt/local/lib/libgcc/libgfortran.5.dylib
:info:configure   Reason: image not found
:info:configure During handling of the above exception, another exception occurred:
:info:configure Traceback (most recent call last):
:info:configure   File "<string>", line 1, in <module>
:info:configure   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/__init__.py", line 145, in <module>
:info:configure     from . import core
:info:configure   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/__init__.py", line 48, in <module>
:info:configure     raise ImportError(msg)
:info:configure ImportError: 
:info:configure IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
:info:configure Importing the numpy C-extensions failed. This error can happen for
:info:configure many reasons, often due to issues with your setup or how NumPy was
:info:configure installed.
:info:configure We have compiled some common reasons and troubleshooting tips at:
:info:configure     https://numpy.org/devdocs/user/troubleshooting-importerror.html
:info:configure Please note and check the following:
:info:configure   * The Python version is: Python3.9 from "/opt/local/bin/python3.9"
:info:configure   * The NumPy version is: "1.20.2"
:info:configure and make sure that they are the versions you expect.
:info:configure Please carefully study the documentation linked above for further help.
:info:configure 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, 2): Library not loaded: @rpath/libgcc_s.1.1.dylib
:info:configure   Referenced from: /opt/local/lib/libgcc/libgfortran.5.dylib
:info:configure   Reason: image not found
Last edited 4 years ago by mascguy (Christopher Nielsen) (previous) (diff)

comment:3 Changed 4 years ago by mascguy (Christopher Nielsen)

Fellow Maintainers, are any of you folks successfully using py39-numpy on an M1 Mac?

comment:4 Changed 4 years ago by mascguy (Christopher Nielsen)

I suspect this is an issue with upstream dependency OpenBLAS, on M1 Macs. Not 100% certain though.

Two related tickets:

OpenBlas fails to build on macOS BigSur (Apple Silicon)

OpenBLAS fails to build on Apple M1

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

Port: py-opencv4 added; py39-opencv4 removed

comment:6 Changed 4 years ago by phosphide (Jakub Tomczyński)

Owner: changed from stromnov to mascguy

I reassigned to mascguy.

As for OpenBLAS/numpy , I have OpenBLAS @0.3.14_0+gccdevel+lapack+native successfully installed. py39-numpy is also installed, but when I try to import it I get:

Python 3.9.4 (default, Apr 17 2021, 10:08:48) 
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
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, 2): Library not loaded: @rpath/libgcc_s.1.1.dylib
  Referenced from: /opt/local/lib/libgcc/libgfortran.5.dylib
  Reason: image not found

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

Port: py39-opencv4 added; py-opencv4 removed

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

Cc: stromnov added; mascguy removed

comment:9 Changed 4 years ago by freedomtan ("freedom" Koan-Sin Tan)

This is kinda rpath problem. If library path such as /opt/local/lib/gcc-devel/ is added to LD_LIBRARY_PATH, it should run well. This may be caused by recent gcc-devel changes though.

comment:11 Changed 4 years ago by mascguy (Christopher Nielsen)

Jakub, this issue may be resolved, as dependencies like OpenBLAS and py39-numpy are now building on Big Sur ARM/M1.

Are you still seeing this issue?

comment:12 Changed 4 years ago by phosphide (Jakub Tomczyński)

I have temporarily switched to emulated x86_64, but today I reinstalled everything (python 3.9, py39-numpy, py39-opencv4) natively and it seems to be working, thank you!

comment:13 Changed 4 years ago by mascguy (Christopher Nielsen)

Resolution: fixed
Status: assignedclosed

Beautiful, glad everything's working for you!

Closing as resolved.

Note: See TracTickets for help on using tickets.