New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #24503 (closed update: fixed)

Opened 5 years ago

Last modified 4 years ago

Upgrade opencv from 2.0.0 to 2.1.0

Reported by: dersh@… Owned by: stante@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch Cc: mail@…, ryandesign@…, stromnov@…, njbutko@…, daniel.hornung@…, ryanlei750328@…, phoebebright@…, josharian@…, raphael@…
Port: opencv

Description

I just downloaded and built opencv 2.1.0, and it seems to build just fine with no changes. There are a bunch of bug fixes with this change, so I suggest that the port be updated.

Attachments

Portfile (2.0 KB) - added by stromnov@… 5 years ago.
patch-CMakeLists.txt.diff (675 bytes) - added by stromnov@… 5 years ago.
patch-interfaces_python_CMakeLists.txt.diff (1.2 KB) - added by stromnov@… 5 years ago.
opencv.tar.gz (2.1 KB) - added by stromnov@… 4 years ago.
opencv.tar.bz2 (2.2 KB) - added by raphael@… 4 years ago.
Portfile.diff (4.8 KB) - added by raphael@… 4 years ago.

Change History

comment:1 Changed 5 years ago by macsforever2000@…

  • Owner changed from macports-tickets@… to stante@…
  • Cc stante@… removed
  • Version 1.8.2 deleted

comment:2 Changed 5 years ago by mail@…

  • Cc mail@… added

Cc Me!

comment:3 Changed 5 years ago by ryandesign@…

  • Cc ryandesign@… added

I fixed the livecheck in r66756.

comment:4 Changed 5 years ago by stromnov@…

Current Portfile is very complicated.

Zlib, jpeg, libpng and tiff dependencies are redundant (source files for those packages are incorporated into OpenCV source tree).

OpenCV 2.1 is fully compatible with Cocoa and Quicktime framework, so gtk2 dependency is redundant too.

Python bindings are requires some tweaks (see patches).

My Portfile needs some adjustments for user-selectable python variant.

Changed 5 years ago by stromnov@…

Changed 5 years ago by stromnov@…

Changed 5 years ago by stromnov@…

comment:5 Changed 5 years ago by stromnov@…

  • Cc stromnov@… added

Cc Me!

comment:6 follow-up: ↓ 7 Changed 5 years ago by ajb78@…

I tried the attached portfiles - it works for compiling and installing opencv but there is an error:

in patch-interfaces_python_CMakeLists.txt.diff cv.so should remained as cv.so and NOT cv.dylib (otherwise python will not recognize it as a module).

comment:7 in reply to: ↑ 6 ; follow-up: ↓ 8 Changed 5 years ago by stromnov@…

Replying to ajb78@…:

I tried the attached portfiles - it works for compiling and installing opencv but there is an error:

in patch-interfaces_python_CMakeLists.txt.diff cv.so should remained as cv.so and NOT cv.dylib (otherwise python will not recognize it as a module).

Python supports all dynamic library extensions variants:

  • .dll on win32
  • .so on Linux
  • .so and .dylib on MacOSX

Macport Python 2.6 perfectly works with this python .dylib extension.

comment:8 in reply to: ↑ 7 Changed 5 years ago by ajb78@…

Interesting.... I don't seem to be able to load the dylib version of the library. It just tells me that it can't find it - when I change your portfile to install .so's into the site-package directory it does ok.

Python supports all dynamic library extensions variants:

  • .dll on win32
  • .so on Linux
  • .so and .dylib on MacOSX

Macport Python 2.6 perfectly works with this python .dylib extension.

comment:9 Changed 5 years ago by njbutko@…

  • Cc njbutko@… added

Cc Me!

comment:10 Changed 5 years ago by njbutko@…

Is there any update regarding when this update will be pushed to MacPorts? I have been waiting a long time for it.

comment:11 Changed 4 years ago by daniel.hornung@…

  • Cc daniel.hornung@… added

Cc Me!

comment:12 follow-up: ↓ 16 Changed 4 years ago by stromnov@…

Here the new variant of my OpenCV 2.1.0 port:

  • +python26 variant for new python bindings;
  • +tbb variant for Intel TBB (checked against #25208);
  • +universal variant.

Checked on MBP5.5 + MacOSX 10.6.3.

Changed 4 years ago by stromnov@…

comment:13 Changed 4 years ago by ryanlei750328@…

  • Cc ryanlei750328@… added

Cc Me!

comment:14 Changed 4 years ago by phoebebright@…

  • Cc phoebebright@… added

Cc Me!

comment:15 in reply to: ↑ description Changed 4 years ago by matthew.barulic@…

Replying to dersh@…:

Hi, I installed this port on Mac OSX 10.6.3 and everything seems to be working. I hope they update the online port soon. Thanks for posting this!

comment:16 in reply to: ↑ 12 ; follow-up: ↓ 18 Changed 4 years ago by josharian@…

Here the new variant of my OpenCV 2.1.0 port:

  • +python26 variant for new python bindings;
  • +tbb variant for Intel TBB (checked against #25208);
  • +universal variant.

Tried this on my MPB 15" late 2009, 10.6.4, with variants +debug and +python26. The core installation went great and works. The python adapter appears to install cleanly (no complaints during install), but doesn't work:

python

import cv

Fatal Python error: Interpreter not initialized (version mismatch?) Abort trap

This is python 2.6 installed through macports and selected via python_select.

Also, shouldn't it be python 2.7 now? :)

comment:17 Changed 4 years ago by josharian@…

  • Cc josharian@… added

Cc Me!

comment:18 in reply to: ↑ 16 ; follow-up: ↓ 19 Changed 4 years ago by stromnov@…

Replying to josharian@…:

Tried this on my MPB 15" late 2009, 10.6.4, with variants +debug and +python26. The core installation went great and works. The python adapter appears to install cleanly (no complaints during install), but doesn't work:

python

import cv

Fatal Python error: Interpreter not initialized (version mismatch?) Abort trap

This is python 2.6 installed through macports and selected via python_select.

Please, provide output of

otool -L /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/cv.so

Also, shouldn't it be python 2.7 now? :)

I'm waiting for 2.7.1 or 2.7.2. :)

comment:19 in reply to: ↑ 18 ; follow-up: ↓ 20 Changed 4 years ago by josharian@…

Replying to stromnov@…:

Replying to josharian@…:

Tried this on my MPB 15" late 2009, 10.6.4, with variants +debug and +python26. The core installation went great and works. The python adapter appears to install cleanly (no complaints during install), but doesn't work:

python

import cv

Fatal Python error: Interpreter not initialized (version mismatch?) Abort trap

This is python 2.6 installed through macports and selected via python_select.

Please, provide output of

otool -L /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/cv.so
$ otool -L /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/cv.so
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/cv.so:
	/opt/local/lib/cv.so (compatibility version 0.0.0, current version 0.0.0)
	/System/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.1)
	/opt/local/lib/libcxcore.2.1.dylib (compatibility version 2.1.0, current version 2.1.0)
	/opt/local/lib/libcv.2.1.dylib (compatibility version 2.1.0, current version 2.1.0)
	/opt/local/lib/libcvaux.2.1.dylib (compatibility version 2.1.0, current version 2.1.0)
	/opt/local/lib/libhighgui.2.1.dylib (compatibility version 2.1.0, current version 2.1.0)
	/opt/local/lib/libml.2.1.dylib (compatibility version 2.1.0, current version 2.1.0)
	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 123.0.0)

That /System/Library... bit looked suspicious, so I went ahead and confirmed that I am running the MacPorts python...

$ which python
/opt/local/bin/python
$ python_select -s
python26
$ python -V
Python 2.6.5
$ python -vv
[snip]
>>> import cv
[snip]
# trying /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/cv.so
dlopen("/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/cv.so", 2);
Fatal Python error: Interpreter not initialized (version mismatch?)
Abort trap

That's all I could think of offhand. I'd be more than happy to provide any other info that might be helpful.

Also, shouldn't it be python 2.7 now? :)

I'm waiting for 2.7.1 or 2.7.2. :)

Fair enough. :)

comment:20 in reply to: ↑ 19 ; follow-up: ↓ 23 Changed 4 years ago by stromnov@…

Replying to josharian@…: That /System/Library... bit looked suspicious, so I went ahead and confirmed that I am running the MacPorts python...

Yes, your boost installation linked to system python, instead of macports (see #21444).

You can relink it manually via

sudo install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.6/Python /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python /opt/local/lib/libboost_python.dylib

or properly reinstall boost (after selecting proper interpreter via python_select)

comment:21 Changed 4 years ago by raphael@…

  • Keywords haspatch added

I took the latest version of the port in this ticket and added some configuration options for the python26 variant and some missing dependencies. Now, the python bindings work for me.

A unified diff to the current MacPorts version and an archive of the whole port are attached. If there are no objections, I will commit this port in a few days.

Changed 4 years ago by raphael@…

comment:22 Changed 4 years ago by raphael@…

  • Cc raphael@… added

Cc Me!

comment:23 in reply to: ↑ 20 Changed 4 years ago by josharian@…

Replying to stromnov@…:

Yes, your boost installation linked to system python, instead of macports (see #21444).

You can relink it manually via

sudo install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.6/Python /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python /opt/local/lib/libboost_python.dylib

or properly reinstall boost (after selecting proper interpreter via python_select)

For the record, neither of those worked for me. I had no libboost_python.dylib in that location or any other that locate could find; uninstalling and reinstalling boost didn't help.

However, the newest attachment in the comment from raphael@... works out of the box for me, so calling this good. Thanks a bunch for your help (and for maintaining this port!).

comment:24 Changed 4 years ago by raphael@…

I discovered that at least on Leopard (I assume on older systems as well) __STDC_CONSTANT_MACROS has to be defined so that the C++ compiler sees the macros in /usr/include/stdint.h.

The new diff for the portfile is attached.

Changed 4 years ago by raphael@…

comment:25 Changed 4 years ago by raphael@…

  • Status changed from new to closed
  • Resolution set to fixed

Maintainer timeout: committed in r70430.

Note: See TracTickets for help on using tickets.