Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

cv2.so with python2.7 and 3.4

Hi, I built cv2.so for python2.7 and python3.4 in raspbian. They both work and I can do import cv2.

However, when I wanted to understand where all the binaries are installed by cmake, I noticed something strange and I didn't understand.

Both py2.7 and py3.4 cv2.so files are depending on the same shared objects. The following is the ldd output

$ldd py27cv2.so #python 2.7 linux-vdso.so.1 (0x7ee2d000) /usr/lib/arm-linux-gnueabihf/libarmmem.so (0x76e66000) *libpython2.7.so.1.0 => /usr/lib/arm-linux-gnueabihf/libpython2.7.so.1.0 (0x76b2f000) * libopencv_core.so.3.0 => /lib/libopencv_core.so.3.0 (0x7691c000) libopencv_flann.so.3.0 => /lib/libopencv_flann.so.3.0 (0x768c9000) libopencv_imgproc.so.3.0 => /lib/libopencv_imgproc.so.3.0 (0x765f8000) libopencv_ml.so.3.0 => /lib/libopencv_ml.so.3.0 (0x76561000)

$ldd py34cv2.so #python 3.4
linux-vdso.so.1 (0x7ef97000) /usr/lib/arm-linux-gnueabihf/libarmmem.so (0x76dce000) *libpython3.4m.so.1.0 => /usr/lib/arm-linux-gnueabihf/libpython3.4m.so.1.0 (0x769fe000) * libopencv_core.so.3.0 => /lib/libopencv_core.so.3.0 (0x767eb000) libopencv_flann.so.3.0 => /lib/libopencv_flann.so.3.0 (0x76798000) libopencv_imgproc.so.3.0 => /lib/libopencv_imgproc.so.3.0 (0x764c7000) libopencv_ml.so.3.0 => /lib/libopencv_ml.so.3.0 (0x76430000)

Do note the offsets in brackets seem to differ between the two versions. Otherwise both py2.7 cv2.so and py34 cv2.so are dependent on the shared objects (libopencv_core.so.3.0 etc).

Is this correct or is something wrong and it may cause problems later. If this right, could you please tell me how this works and why mixing so files is ok here?
Thanks T

click to hide/show revision 2
No.2 Revision

cv2.so with python2.7 and 3.4

Hi, I built cv2.so for python2.7 and python3.4 in raspbian. They both work and I can do import cv2.

However, when I wanted to understand where all the binaries are installed by cmake, I noticed something strange and I didn't understand.

Both py2.7 and py3.4 cv2.so files are depending on the same shared objects. The following is the ldd output

 $ldd py27cv2.so #python 2.7
 linux-vdso.so.1 (0x7ee2d000)
 /usr/lib/arm-linux-gnueabihf/libarmmem.so (0x76e66000)
 *libpython2.7.so.1.0 **libpython2.7.so.1.0 => /usr/lib/arm-linux-gnueabihf/libpython2.7.so.1.0 (0x76b2f000) * **
 libopencv_core.so.3.0 => /lib/libopencv_core.so.3.0 (0x7691c000)
 libopencv_flann.so.3.0 => /lib/libopencv_flann.so.3.0 (0x768c9000)
 libopencv_imgproc.so.3.0 => /lib/libopencv_imgproc.so.3.0 (0x765f8000)
 libopencv_ml.so.3.0 => /lib/libopencv_ml.so.3.0 (0x76561000)

(0x76561000) $ldd py34cv2.so #python 3.4
linux-vdso.so.1 (0x7ef97000) /usr/lib/arm-linux-gnueabihf/libarmmem.so (0x76dce000) *libpython3.4m.so.1.0 **libpython3.4m.so.1.0 => /usr/lib/arm-linux-gnueabihf/libpython3.4m.so.1.0 (0x769fe000) * ** libopencv_core.so.3.0 => /lib/libopencv_core.so.3.0 (0x767eb000) libopencv_flann.so.3.0 => /lib/libopencv_flann.so.3.0 (0x76798000) libopencv_imgproc.so.3.0 => /lib/libopencv_imgproc.so.3.0 (0x764c7000) libopencv_ml.so.3.0 => /lib/libopencv_ml.so.3.0 (0x76430000)

(0x76430000)

Do note the offsets in brackets seem to differ between the two versions. Otherwise both py2.7 cv2.so and py34 cv2.so are dependent on the shared objects (libopencv_core.so.3.0 etc).

Is this correct or is something wrong and it may cause problems later. If this right, could you please tell me how this works and why mixing so files is ok here?
Thanks T