Bug#664800: opencv: Source build fails because cmake selects wrong python include and library paths
Dave Anglin
dave.anglin at bell.net
Tue Mar 20 22:51:32 UTC 2012
Source: opencv
Version: 2.3.1-7
Severity: normal
Source build fails with following error when python3.2 is installed:
cd /home/dave/debian/opencv/opencv-2.3.1/obj-hppa-linux-gnu/modules/python && /usr/bin/g++-4.6 -Dopencv_python_EXPORTS -DHAVE_CVCONFIG_H -Wall -pthread -ffunction-sections -g -O2 -Wformat -Wformat-security -Werror=format-security -fomit-frame-pointer -ffast-math -DNDEBUG -fPIC -I/usr/lib/pymodules/python2.7/numpy/core/include -I/home/dave/debian/opencv/opencv-2.3.1/. -I/home/dave/debian/opencv/opencv-2.3.1/obj-hppa-linux-gnu -I/home/dave/debian/opencv/opencv-2.3.1/include -I/home/dave/debian/opencv/opencv-2.3.1/include/opencv -I/usr/include/python3.2 -I/home/dave/debian/opencv/opencv-2.3.1/modules/python/src2 -I/home/dave/debian/opencv/opencv-2.3.1/modules/core/include -I/home/dave/debian/opencv/opencv-2.3.1/modules/flann/include -I/home/dave/debian/opencv/opencv-2.3.1/modules/imgproc/include -I/home/dave/debian/opencv/opencv-2.3.1/modules/video/include -I/home/dave/debian/opencv/opencv-2.3.1/modules/highgui/include -I/home/dave/debian/opencv/opencv-2.3.1/modules/ml/incl
ude -I/home/dave/debian/opencv/opencv-2.3.1/modules/features2d/include -I/home/dave/debian/opencv/opencv-2.3.1/modules/calib3d/include -I/home/dave/debian/opencv/opencv-2.3.1/modules/objdetect/include -I/home/dave/debian/opencv/opencv-2.3.1/modules/legacy/include -I/home/dave/debian/opencv/opencv-2.3.1/modules/contrib/include -I/home/dave/debian/opencv/opencv-2.3.1/obj-hppa-linux-gnu/modules/python -D PYTHON_USE_NUMPY=1 -o CMakeFiles/opencv_python.dir/src2/cv2.o -c /home/dave/debian/opencv/opencv-2.3.1/modules/python/src2/cv2.cpp
/home/dave/debian/opencv/opencv-2.3.1/modules/python/src2/cv2.cpp: In function ‘bool pyopencv_to(PyObject*, cv::Scalar&, const char*)’:
/home/dave/debian/opencv/opencv-2.3.1/modules/python/src2/cv2.cpp:270:56: error: ‘PyInt_Check’ was not declared in this scope
/home/dave/debian/opencv/opencv-2.3.1/modules/python/src2/cv2.cpp:279:46: error: ‘PyInt_Check’ was not declared in this scope
/home/dave/debian/opencv/opencv-2.3.1/modules/python/src2/cv2.cpp: In function ‘PyObject* pyopencv_from(int)’:
/home/dave/debian/opencv/opencv-2.3.1/modules/python/src2/cv2.cpp:317:32: error: ‘PyInt_FromLong’ was not declared in this scope
/home/dave/debian/opencv/opencv-2.3.1/modules/python/src2/cv2.cpp: In function ‘bool pyopencv_to(PyObject*, int&, const char*)’:
/home/dave/debian/opencv/opencv-2.3.1/modules/python/src2/cv2.cpp:324:34: error: ‘PyInt_AsLong’ was not declared in this scope
...
I noticed in CMakeCache.txt that PYTHON_INCLUDE_DIR and PYTHON_LIBRARY
were set for python3.2, but PYTHON_PACKAGES_PATH was set for python2.7.
Build succeeds with following change to rules:
dave at mx3210:~/debian/opencv/opencv-2.3.1/debian$ diff -u rules.save rules
--- rules.save 2012-02-01 12:59:27.000000000 -0500
+++ rules 2012-03-19 22:26:50.000000000 -0400
@@ -32,6 +32,8 @@
-DINSTALL_C_EXAMPLES=ON \
-DINSTALL_PYTHON_EXAMPLES=ON \
-DBUILD_NEW_PYTHON_SUPPORT=ON \
+ -DPYTHON_INCLUDE_DIR="/usr/include/python2.7" \
+ -DPYTHON_LIBRARY="/usr/lib/python2.7/config/libpython2.7.so" \
-DWITH_FFMPEG=ON \
-DWITH_GSTREAMER=OFF \
-DWITH_GTK=ON \
There's probably a better way to select the right python version.
-- System Information:
Debian Release: wheezy/sid
APT prefers unreleased
APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: hppa (parisc64)
Kernel: Linux 3.2.11+ (SMP w/4 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
More information about the debian-science-maintainers
mailing list