about compiling opencv programs outside ROS (Bug #1475)


Added by Kei Okada over 13 years ago. Updated almost 13 years ago.


Status:Cancelled Start date:
Priority:High Due date:
Assignee:Alexander Shishkov % Done:

0%

Category:build/install
Target version:2.4.0
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

.pc file in opencv2.3 package is not working for non-ros users as discussed in http://answers.ros.org/question/2882/about-compiling-opencv-programs-outside-ros.

We'll be happy if you can modify the opencv-2.3.1.pc file in the deb package to works with gcc -o hoge hoge.cpp pkg-config opencv-2.3.1 --libs


pkg-config.patch - pkg-config patch (1.8 kB) Jonathan Bohren, 2012-01-24 04:49 am


History

Updated by Jonathan Bohren over 13 years ago

Specifically, the pkg-config file is malformed. The linker flags have the pattern "-l/abs/path/to/libX.so.2.3.1" but these should either all be "-lX" (versionless) or just "/abs/path/to/libX.so.2.3.1" (versioned).

Additionally, OpenCV 2.3.1 doesn't install an "opencv.pc" just an "opencv-2.3.1.pc" whereas most projects that use pkg-config pass "opencv" and not "opencv-2.3.1". If the pkg-config versioning is important, the install should at least install "opencv-2.3.1.pc" and then create a symlink called "opencv.pc".

Updated by Jonathan Bohren about 13 years ago

Bump.

Updated by pascalmuller - about 13 years ago

Replying to [comment:2 jbohren]:

Specifically, the pkg-config file is malformed. The linker flags have the pattern "-l/abs/path/to/libX.so.2.3.1" but these should either all be "-lX" (versionless) or just "/abs/path/to/libX.so.2.3.1" (versioned).

Additionally, OpenCV 2.3.1 doesn't install an "opencv.pc" just an "opencv-2.3.1.pc" whereas most projects that use pkg-config pass "opencv" and not "opencv-2.3.1". If the pkg-config versioning is important, the install should at least install "opencv-2.3.1.pc" and then create a symlink called "opencv.pc".

I'm wondering when the patch will be present in the (Ubuntu) packages offered?

Also, for me it's pretty important both 'opencv.pc' and 'opencv-2.3.1.pc' will exist with the new contents. The context in the patch around the things you corrected seems to contain 'opencv.pc' as a filename. I assume the filename has already been changed from 'opencv-2.3.1.pc' to 'opencv.pc'at an earlier time?

Updated by Jonathan Bohren about 13 years ago

Replying to [comment:5 pascalmuller]:

Replying to [comment:2 jbohren]:

Specifically, the pkg-config file is malformed. The linker flags have the pattern "-l/abs/path/to/libX.so.2.3.1" but these should either all be "-lX" (versionless) or just "/abs/path/to/libX.so.2.3.1" (versioned).

Additionally, OpenCV 2.3.1 doesn't install an "opencv.pc" just an "opencv-2.3.1.pc" whereas most projects that use pkg-config pass "opencv" and not "opencv-2.3.1". If the pkg-config versioning is important, the install should at least install "opencv-2.3.1.pc" and then create a symlink called "opencv.pc".

I'm wondering when the patch will be present in the (Ubuntu) packages offered?

Also, for me it's pretty important both 'opencv.pc' and 'opencv-2.3.1.pc' will exist with the new contents. The context in the patch around the things you corrected seems to contain 'opencv.pc' as a filename. I assume the filename has already been changed from 'opencv-2.3.1.pc' to 'opencv.pc'at an earlier time?

So from what I could see in the CMakeLists.txt, opencv can build both "opencv.pc" and "opencv-VERSION.pc" depending on whether or not the CMake variable "OPENCV_MANGLED_INSTALL_PATHS" is set. My patch will at least make the pc file specify the correct linker flags, and unclude opecv_gpu (which even trunk does not).

Updated by Alexander Shishkov almost 13 years ago

  • Target version deleted ()

Updated by Alexander Shishkov almost 13 years ago

  • Assignee deleted (Vadim Pisarevsky)

Updated by Alexander Shishkov almost 13 years ago

  • Assignee set to Alexander Shishkov

Updated by Alexander Shishkov almost 13 years ago

We already updated these scripts in trunk. So this patch is obsolete now.
Current opencv.pc generated with the trunk installation:

# Package Information for pkg-config

prefix=/usr/local
exec_prefix=${prefix}
libdir=
includedir_old=${prefix}/include/opencv
includedir_new=${prefix}/include

Name: OpenCV
Description: Open Source Computer Vision Library
Version: 2.3.3
Libs:  ${exec_prefix}/lib/libopencv_calib3d.so ${exec_prefix}/lib/libopencv_contrib.so ${exec_prefix}/lib/libopencv_core.so ${exec_prefix}/lib/libopencv_features2d.so ${exec_prefix}/lib/libopencv_flann.so ${exec_prefix}/lib/libopencv_gpu.so ${exec_prefix}/lib/libopencv_highgui.so ${exec_prefix}/lib/libopencv_imgproc.so ${exec_prefix}/lib/libopencv_legacy.so ${exec_prefix}/lib/libopencv_ml.so ${exec_prefix}/lib/libopencv_nonfree.so ${exec_prefix}/lib/libopencv_objdetect.so ${exec_prefix}/lib/libopencv_photo.so ${exec_prefix}/lib/libopencv_stitching.so ${exec_prefix}/lib/libopencv_ts.so ${exec_prefix}/lib/libopencv_video.so ${exec_prefix}/lib/libopencv_videostab.so
Cflags: -I${includedir_old} -I${includedir_new}

If you still have problems with pkg-config for OpenCV, please create new issue.

  • Status changed from Open to Cancelled

Updated by Alexander Shishkov almost 13 years ago

  • Target version set to 2.4.0

Also available in: Atom PDF