Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#47884 closed defect (fixed)

opencv: malformed opencv.pc causes gstreamer1-gst-plugins-bad compilation to fail

Reported by: jwhowse4 Owned by: stromnov (Andrey Stromnov)
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: Cc: dbevans (David B. Evans), mkae (Marko Käning)
Port: opencv gstreamer1-gst-plugins-bad

Description

On an Intel Mac running OS X 10.8.5 and XCode 5.1.1 building gstreamer1-gst-plugins-bad fails as shown in the attached log file. It appears to me that the problem is linking the OpenGL library while building the opencv plugin.

Attachments (1)

main_gst_plug_bad.log (1.8 MB) - added by jwhowse4 9 years ago.
build log

Download all attachments as: .zip

Change History (6)

Changed 9 years ago by jwhowse4

Attachment: main_gst_plug_bad.log added

build log

comment:1 Changed 9 years ago by dbevans (David B. Evans)

Owner: changed from macports-tickets@… to devans@…
Status: newassigned

Comparing my successful build log on 10.9 with yours, it looks like opencv is bringing in the following additional libraries

-lOpenGL -lAGL -ltbb -ltbbmalloc

that aren't on my build line.

I'm guessing that you have installed opencv with some additional variants (+tbb ?), rather than just the default build (no variants).

If this is the case, which opencv variants have you enabled? If you install opencv without any variants does gstreamer1-gst-plugins-bad build correctly?

Last edited 9 years ago by dbevans (David B. Evans) (previous) (diff)

comment:2 Changed 9 years ago by jwhowse4

When I reported this ticket I had opencv installed with the variants +eigen +opencl +python27 +qt4 +tbb which leads to failure when building gstreamer1-gst-plugins-bad. I tried reinstalling opencv with the variants +eigen +python27 +qt4 which still leads to gstreamer1-gst-plugins-bad failing to build. When I install opencv without any variants gstreamer1-gst-plugins-bad builds successfully.

comment:3 Changed 9 years ago by dbevans (David B. Evans)

Cc: devans@… added
Owner: changed from devans@… to stromnov@…
Port: opencv added
Status: assignednew
Summary: Compiling gstreamer1-gst-plugins-bad failsopencv: malformed opencv.pc causes gstreamer1-gst-plugins-bad compilation to fail

I did some fiddling with opencv variants this morning and was able to recreate your issue when opencv is built with Qt support either +qt4 or +qt5. In this case, opencv provides Qt OpenGL support using the Apple OpenGL framework and builds internally using using the appropriate framework arguments

-framework AGL -framework OpenGL

however, when inquiring of opencv using pkgconfig (such as is done by gstreamer1-gst-plugins-bad) one receives the following (incorrect) result.

$ pkg-config --libs opencv
-L/opt/local/lib -L//System/Library/Frameworks -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_nonfree -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_ts -lopencv_video -lopencv_videostab -lOpenGL -lAGL -ltbb -ltbbmalloc 

The entries

-lOpenGL -lAGL

should, in fact, be

-framework AGL -framework OpenGL

So the problem is not with gstreamer1-gst-plugins-bad, per se, but with formation of the opencv.pc file by opencv.

I am reassigning this ticket to the opencv maintainer for further action.

comment:4 Changed 9 years ago by mkae (Marko Käning)

Cc: mk@… added

Cc Me!

comment:5 Changed 9 years ago by dbevans (David B. Evans)

Resolution: fixed
Status: newclosed

As of opencv 3.0.0 (r137653), opencv +qt4 no longer exports -lOpenGL -lAGL via pkg-config

$ pkg-config --libs opencv
-L/opt/local/lib -lopencv_shape -lopencv_stitching -lopencv_objdetect -lopencv_superres -lopencv_videostab -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_video -lopencv_photo -lopencv_ml -lopencv_imgproc -lopencv_flann -lopencv_core -lopencv_hal 

However, the opencv plugin provided by gstreamer1-gst-plugins-bad 1.4.5 only supports opencv < 2.5. Plugin disabled and dependency on opencv removed in r137657.

Closing as fixed since the issues of this ticket have been resolved although with reduced functionality.

Last edited 9 years ago by dbevans (David B. Evans) (previous) (diff)
Note: See TracTickets for help on using tickets.