[MacPorts] #61908: opencv: @3.4.13: variant 'contrib' fails with link error, for module 'libopencv_sfm'
MacPorts
noreply at macports.org
Fri Jan 29 20:26:07 UTC 2021
#61908: opencv: @3.4.13: variant 'contrib' fails with link error, for module
'libopencv_sfm'
----------------------+----------------------
Reporter: mascguy | Owner: mascguy
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: opencv |
----------------------+----------------------
Comment (by erikbs):
I get the same error on 10.9 too; ver. 3.4.13, variants
`+avx2+contrib+eigen+python39+tbb`.
System/compiler info:
{{{
:debug:sysinfo OS X 10.9 (darwin/13.4.0) arch i386
:debug:sysinfo MacPorts 2.6.4
:debug:sysinfo Xcode 6.2
:debug:sysinfo SDK 10.9
...
:debug:clean Sourcing PortGroup clang_dependency 1.0 from
/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/_resources/port1.0/group/clang_dependency-1.0.tcl
:debug:clean compiler clang 600.0.57 not blacklisted because it doesn't
match {clang < 211.10.1}
}}}
Macports defaults to clang-mp-9.0, but I also tried clang-mp-10 without
success.
Apparently the contrib module that fails to link is SFM (Structure From
Motion). For some strange reason it find gflags, but not glog. Whatever
the reason is, I managed to build it successfully by editing this file:
`/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_opencv/opencv/work/build/modules/sfm/CMakeFiles/opencv_sfm.dir/link.txt`
… where I added `/opt/local/lib/libglog.0.4.0.dylib` right after
`libgflags.2.2.2.dylib` in the list of libraries to link against
When calling `upgrade opencv` again, Macports picks up where it failed and
finishes successfully.
----
I suspect that the error lies in either of these files:
`work/opencv_contrib-3.4.13/modules/sfm/CMakeLists.txt`
`work/opencv_contrib-3.4.13/modules/sfm/cmake/FindGlog.cmake`
Unfortunately I am not sure how to debug these, but it seems like
`find_package(Glog QUIET)` fails. In the first file I see this command:
{{{
set(LIBMV_LIGHT_LIBS
correspondence
multiview
numeric
${GLOG_LIBRARIES}
${GFLAGS_LIBRARIES}
)
}}}
Judging by the contents of `link.txt` (full path above), which is:
{{{
/opt/local/bin/clang++-mp-10 -pipe -Os -DNDEBUG -isystem/opt/local/include
-I/opt/local/include/LegacySupport -stdlib=libc++ -fsigned-char -W -Wall
-Werror=return-type -Werror=non-virtual-dtor -Werror=address -Wformat
-Werror=format-security -Wmissing-prototypes -Wstrict-prototypes -Winit-
self -Wpointer-arith -Wsign-promo -Wuninitialized -Winconsistent-missing-
override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args
-Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-
enum-enum-conversion -fdiagnostics-show-option -Wno-long-long -Qunused-
arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-
sections -msse4.1 -mpopcnt -msse4.2 -mf16c -mfma -mavx2
-fvisibility=hidden -fvisibility-inlines-hidden -Wno-undef -Wno-shadow
-Wno-sign-compare -Wno-missing-declarations -Wno-unused-parameter -Wno-
unused-function -arch x86_64 -mmacosx-version-min=10.9 -dynamiclib
-Wl,-headerpad_max_install_names -L/opt/local/lib
-Wl,-headerpad_max_install_names -lMacportsLegacySupport -Wl,-dead_strip
-compatibility_version 3.4.0 -current_version 3.4.13 -o
../../lib/libopencv_sfm.3.4.13.dylib -install_name
@rpath/libopencv_sfm.3.4.dylib
CMakeFiles/opencv_sfm.dir/src/conditioning.cpp.o
CMakeFiles/opencv_sfm.dir/src/fundamental.cpp.o
CMakeFiles/opencv_sfm.dir/src/io.cpp.o
CMakeFiles/opencv_sfm.dir/src/numeric.cpp.o
CMakeFiles/opencv_sfm.dir/src/projection.cpp.o
CMakeFiles/opencv_sfm.dir/src/reconstruct.cpp.o
CMakeFiles/opencv_sfm.dir/src/robust.cpp.o
CMakeFiles/opencv_sfm.dir/src/simple_pipeline.cpp.o
CMakeFiles/opencv_sfm.dir/src/triangulation.cpp.o
-Wl,-rpath,/opt/local/lib ../../lib/libopencv_imgcodecs.3.4.13.dylib
../../lib/libopencv_xfeatures2d.3.4.13.dylib ../../lib/libcorrespondence.a
../../lib/libmultiview.a ../../lib/libnumeric.a
/opt/local/lib/libgflags.2.2.2.dylib ../../lib/libopencv_ml.3.4.13.dylib
../../lib/libopencv_shape.3.4.13.dylib
../../lib/libopencv_video.3.4.13.dylib
../../lib/libopencv_calib3d.3.4.13.dylib
../../lib/libopencv_features2d.3.4.13.dylib
../../lib/libopencv_flann.3.4.13.dylib
../../lib/libopencv_imgproc.3.4.13.dylib
../../lib/libopencv_core.3.4.13.dylib
}}}
… `GLOG_LIBRARIES` is not set, because the corresponding dylib is missing
from the list (`../../lib/libcorrespondence.a ../../lib/libmultiview.a
../../lib/libnumeric.a /opt/local/lib/libgflags.2.2.2.dylib`, which I
guess is generated from `LIBMV_LIGHT_LIBS`). `libglog.0.4.0.dylib` should
have been in there too, between `libnumeric.a` and
`libgflags.2.2.2.dylib`.
--
Ticket URL: <https://trac.macports.org/ticket/61908#comment:7>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list