Bug 219981 - graphics/opencv: enabling TBB breaks graphics/kipi-plugins-*
Summary: graphics/opencv: enabling TBB breaks graphics/kipi-plugins-*
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-kde (group)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-14 09:18 UTC by Melvyn Sopacua
Modified: 2017-07-06 15:09 UTC (History)
2 users (show)

See Also:


Attachments
untested patch (1.51 KB, patch)
2017-06-14 10:01 UTC, Tobias C. Berner
no flags Details | Diff
workaround the issue by passing -L/usr/local/lib via USES=localbase:ldflags (454 bytes, patch)
2017-06-14 12:23 UTC, Tobias C. Berner
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Melvyn Sopacua 2017-06-14 09:18:23 UTC
The digikam/kipi-plugins ports contain a very old FindOpenCV.cmake that does not know about TBB. When this option is enabled in OpenCV, linking fails.

A possible solution is to provide FindOpenCV.cmake similar to what is done with FindOpenCVCore.cmake so that local versions get overridden by the one in cmake modules path.
Comment 1 Melvyn Sopacua 2017-06-14 09:24:12 UTC
Details:
/usr/local/libexec/ccache/c++  -O2 -pipe -fstack-protector -fno-strict-aliasing -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -Woverloaded-virtual -fno-common -fvisibility=hidden -Werror=return-type -fvisibility-inlines-hidden -Wno-return-type-c-linkage -O2 -DNDEBUG -DQT_NO_DEBUG   -fstack-protector CMakeFiles/testipp.dir/testipp_automoc.cpp.o CMakeFiles/testipp.dir/testForIPP.cpp.o  -o testipp -Wl,-rpath,/usr/local/lib /usr/local/lib/libopencv_contrib.so.2.4.13 /usr/local/lib/libopencv_legacy.so.2.4.13 /usr/local/lib/libopencv_objdetect.so.2.4.13 /usr/local/lib/libopencv_calib3d.so.2.4.13 /usr/local/lib/libopencv_features2d.so.2.4.13 /usr/local/lib/libopencv_highgui.so.2.4.13 /usr/local/lib/libopencv_flann.so.2.4.13 /usr/local/lib/libopencv_ml.so.2.4.13 /usr/local/lib/libopencv_video.so.2.4.13 /usr/local/lib/libopencv_imgproc.so.2.4.13 /usr/local/lib/libopencv_core.so.2.4.13 -lm -lpthread -ltbb
/usr/bin/ld: cannot find -ltbb
c++: error: linker command failed with exit code 1 (use -v to see invocation)

Note that all opencv libraries are referenced by full path, but tbb is not and no -L/usr/local/lib is present.

/usr/local/bin/pkgconf --libs opencv
-L/usr/local/lib -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_objdetect -lopencv_ocl -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_ts -lopencv_video -lopencv_videostab -ltbb -lGL -lGLU -lpthread -lm
Comment 2 Tobias C. Berner freebsd_committer freebsd_triage 2017-06-14 09:51:27 UTC
It probably just adds opencv instead of the values found via pkg-config.

Which one is the affected port?
Comment 3 Tobias C. Berner freebsd_committer freebsd_triage 2017-06-14 10:01:44 UTC
Created attachment 183477 [details]
untested patch

Could you give the attached patch a try (I have not yet tested it).
Comment 4 Tobias C. Berner freebsd_committer freebsd_triage 2017-06-14 12:23:43 UTC
Created attachment 183478 [details]
workaround the issue by passing -L/usr/local/lib via USES=localbase:ldflags

This one should actually work as a workaround.
Comment 5 Melvyn Sopacua 2017-07-01 13:37:42 UTC
Work around does it's job. Sorry for the late response.
Comment 6 commit-hook freebsd_committer freebsd_triage 2017-07-06 15:09:16 UTC
A commit references this bug:

Author: tcberner
Date: Thu Jul  6 15:08:42 UTC 2017
New revision: 445158
URL: https://svnweb.freebsd.org/changeset/ports/445158

Log:
  Make sure $LOCALBASE/lib is in the linker search paths.

  * Otherwise linking may fail with OpenCV was compiled with TBB.

  PR:		219981
  Reported by:	Melvyn Sopacua <m.r.sopacua@gmail.com>

Changes:
  head/graphics/kipi-plugin-removeredeyes/Makefile