Opened 7 years ago
Closed 4 years ago
#56411 closed defect (worksforme)
opencv @3.4.1_2+contrib fails to build with protobuf-cpp
Reported by: | duchowski | Owned by: | stromnov (Andrey Stromnov) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.4.3 |
Keywords: | Cc: | detlevd (Detlev Droege), llamafilm, meghadri (meghadri) | |
Port: | opencv |
Description
What I really want is opencv +contrib+eigen+python27 but it appears that +python27 is what's broken. Something to do with protobuf? From the main.log file:
:info:build 1 error generated. :info:build make[2]: *** [3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/stubs/int128.cc.o] Error 1 :info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_opencv/opencv/work/opencv-3.4.1/3rdparty/protobuf/src/google/protobuf/extension_set.cc:180:48: error: no type named 'Arena' in namespace 'google::protobuf'
but that's one excerpt; various errors (over 20) are generated when in
3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/
Attachments (2)
Change History (14)
Changed 7 years ago by duchowski
comment:1 Changed 7 years ago by mf2k (Frank Schima)
Owner: | set to stromnov |
---|---|
Port: | +python27 removed |
Status: | new → assigned |
In the future, please Cc the port maintainer(s) (port info --maintainers opencv
), if any.
comment:2 Changed 7 years ago by detlevd (Detlev Droege)
Cc: | detlevd added |
---|
comment:3 Changed 7 years ago by detlevd (Detlev Droege)
Same here with opencv-3.4.1_2 and +python36, with and without +contrib
comment:4 Changed 7 years ago by pmetzger (Perry E. Metzger)
I suspect this is the issue:
depends_lib-append path:${prefix}/lib/libprotobuf.dylib:protobuf-cpp
We're in the middle of a protobuf-cpp to protobuf3-cpp transition and this variant seems to have somehow been missed in our list of things to look at. The way that is written, it will depend on whatever version of protobuf happens to be installed, which probably means that you can get bad accidents.
comment:5 Changed 7 years ago by detlevd (Detlev Droege)
Indeed - that helped. I changed that line in opencv/Portfile to
depends_lib-append path:${prefix}/lib/libprotobuf.dylib:protobuf3-cpp
(that is just adding the '3' to the port name) and after (force) deinstalling protobuf-cpp and installing protobuf3-cpp opencv @3.4.1_2+contrib+python36 installed just fine. Thanks! (I meanwhile attached a diff file.)
Changed 7 years ago by detlevd (Detlev Droege)
Attachment: | Portfile_opencv_3.4.1_2.diff added |
---|
comment:6 Changed 6 years ago by llamafilm
Cc: | llamafilm added |
---|
comment:7 Changed 6 years ago by johankytt
Changing
depends_lib-append path:${prefix}/lib/libprotobuf.dylib:protobuf3-cpp
in the portfile works on OSX 10.11.6 as well.
The issue is also present in opencv 3.3.1 portfile, commit 650b04a from 17.12.2017. Didn't check any earlier ones.
comment:8 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)
Cc: | meghadri added |
---|---|
Summary: | opencv @3.4.1_2 +python27 fails to build on 10.13.4 HighSierra → opencv @3.4.1_2+contrib fails to build with protobuf-cpp |
The +contrib variant is the one that uses protobuf, not the +python* variants.
The suggested patch is not correct, in that the use of a path:
-style dependency is not correct, because that allows either protobuf-cpp or protobuf3-cpp to satisfy the dependency (whichever is already installed). If only protobuf3-cpp will work, then that is what the port should depend on.
Has duplicate #56634.
See also #56135 for the overall effort to move all ports from protobuf 2 to protobuf 3.
comment:9 Changed 4 years ago by mascguy (Christopher Nielsen)
opencv has been using protobuf3 for some time. Can this be closed?
comment:10 follow-up: 11 Changed 4 years ago by duchowski
I think this can be closed.
To be honest, I gave up on this and instead compiled OpenCV from source including the contrib modules, which is what was at the heart of this ticket. Then it was a matter of linking in the cv2.so library into the python framework provided by macports.
OpenCV is now well beyond v2.4.3 and v3.4.1 anyway.
comment:11 Changed 4 years ago by mascguy (Christopher Nielsen)
Replying to duchowski:
I think this can be closed.
To be honest, I gave up on this and instead compiled OpenCV from source including the contrib modules, which is what was at the heart of this ticket. Then it was a matter of linking in the cv2.so library into the python framework provided by macports.
OpenCV is now well beyond v2.4.3 and v3.4.1 anyway.
Sounds good. Can someone close this?
comment:12 Changed 4 years ago by raimue (Rainer Müller)
Resolution: | → worksforme |
---|---|
Status: | assigned → closed |
main.log