Opened 3 years ago

Closed 3 years ago

#62847 closed defect (fixed)

opencv4: fix build failures for MacOS 10.7 and 10.8

Reported by: mascguy (Christopher Nielsen) Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: opencv4

Description

When compiling opencv4 for MacOS 10.7 and 10.8, the following compilation error occurs:

In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_graphics_opencv4/opencv4/work/opencv-4.5.2/modules/imgcodecs/src/apple_conversions.mm:5:
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_graphics_opencv4/opencv4/work/opencv-4.5.2/modules/imgcodecs/src/apple_conversions.h:6:
In file included from /System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h:20:
In file included from /System/Library/Frameworks/vecLib.framework/Headers/vecLib.h:69:
/System/Library/Frameworks/vecLib.framework/Headers/vForce.h:31:19: error: reference to 'complex' is ambiguous
        template<> class complex<float>;
                         ^
/System/Library/Frameworks/vecLib.framework/Headers/vForce.h:30:26: note: candidate found by name lookup is 'std::complex'
        template<class T> class complex;
                                ^
/opt/local/libexec/llvm-9.0/bin/../include/c++/v1/complex:261:28: note: candidate found by name lookup is 'std::__1::complex'
class _LIBCPP_TEMPLATE_VIS complex
                           ^

I believe this issue started occurring with OpenCV releases > 4.3.0.

Since this port used to build successfully for MacOS releases as old as 10.7, we should fix this if possible.

Attachments (1)

opencv4-buildbot-compilation-error-macos-10.8.txt.gz (27.3 KB) - added by mascguy (Christopher Nielsen) 3 years ago.

Download all attachments as: .zip

Change History (10)

Changed 3 years ago by mascguy (Christopher Nielsen)

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

Full log attached, for our MacOS 10.8 buildbot. Though the error is the same for 10.7.

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

Update: It looks like this issue started with 4.5.1, which should help make it easier to figure out the delta.

In the interim, I may simply update the port to revert to 4.5.0 for MacOS 10.8 and earlier, until I've done the analysis.

comment:3 Changed 3 years ago by kencu (Ken)

This is an old issue I have worked around before, several years ago.

I will see if I can sort out what I did to fix it.

comment:4 Changed 3 years ago by Christopher Nielsen <mascguy@…>

In 81728bfa7dc91877aecdd83877652ce49e1435fb/macports-ports (master):

opencv4: revert to 4.5.0 for MacOS 10.8 and earlier

See: #62847

comment:5 in reply to:  3 Changed 3 years ago by mascguy (Christopher Nielsen)

Replying to kencu:

This is an old issue I have worked around before, several years ago.

I will see if I can sort out what I did to fix it.

Sounds great Ken, I appreciate the help!

I've reverted to 4.5.0 on MacOS 10.8 and earlier for now, to stop the bleeding. But a fix would be great!

comment:7 Changed 3 years ago by kencu (Ken)

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

The latter looks promising, I'll see if it works. Thanks Ken!

comment:9 in reply to:  7 Changed 3 years ago by mascguy (Christopher Nielsen)

Resolution: fixed
Status: assignedclosed

Replying to kencu:

there is a workaround here for a similar issue:

https://xrefs.me/WebCore/webcore/Source/WebCore/platform/audio/Biquad.cpp.html

This fix works for 10.8, and 4.5.2 builds to completion. It also eliminates the errors on 10.7, but alas, there are additional unrelated problems there.

4.5.0 builds and works on 10.8 and 10.7, and is only two minor revs behind, so that's a huge improvement. To avoid having to maintain multiple patches for these two older MacOS releases, let's run with that approach for now.

Closing as fixed.

Note: See TracTickets for help on using tickets.