Opened 15 years ago

Closed 14 years ago

#24503 closed update (fixed)

Upgrade opencv from 2.0.0 to 2.1.0

Reported by: dershow Owned by: stante@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch Cc: mail@…, ryandesign (Ryan Carsten Schmidt), stromnov (Andrey Stromnov), njbutko@…, daniel.hornung@…, ryanlei750328@…, phoebebright@…, josharian@…, raphael-st (Raphael Straub)
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 (6)

Portfile (2.0 KB) - added by stromnov (Andrey Stromnov) 15 years ago.
patch-CMakeLists.txt.diff (675 bytes) - added by stromnov (Andrey Stromnov) 15 years ago.
patch-interfaces_python_CMakeLists.txt.diff (1.2 KB) - added by stromnov (Andrey Stromnov) 15 years ago.
opencv.tar.gz (2.1 KB) - added by stromnov (Andrey Stromnov) 14 years ago.
opencv.tar.bz2 (2.2 KB) - added by raphael-st (Raphael Straub) 14 years ago.
Portfile.diff (4.8 KB) - added by raphael-st (Raphael Straub) 14 years ago.

Download all attachments as: .zip

Change History (31)

comment:1 Changed 15 years ago by mf2k (Frank Schima)

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

comment:2 Changed 15 years ago by mail@…

Cc: mail@… added

Cc Me!

comment:3 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added

I fixed the livecheck in r66756.

comment:4 Changed 15 years ago by stromnov (Andrey 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 15 years ago by stromnov (Andrey Stromnov)

Attachment: Portfile added

Changed 15 years ago by stromnov (Andrey Stromnov)

Attachment: patch-CMakeLists.txt.diff added

Changed 15 years ago by stromnov (Andrey Stromnov)

comment:5 Changed 15 years ago by stromnov (Andrey Stromnov)

Cc: stromnov@… added

Cc Me!

comment:6 Changed 15 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 ; Changed 15 years ago by stromnov (Andrey 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 15 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 15 years ago by njbutko@…

Cc: njbutko@… added

Cc Me!

comment:10 Changed 14 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 14 years ago by daniel.hornung@…

Cc: daniel.hornung@… added

Cc Me!

comment:12 Changed 14 years ago by stromnov (Andrey 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 14 years ago by stromnov (Andrey Stromnov)

Attachment: opencv.tar.gz added

comment:13 Changed 14 years ago by ryanlei750328@…

Cc: ryanlei750328@… added

Cc Me!

comment:14 Changed 14 years ago by phoebebright@…

Cc: phoebebright@… added

Cc Me!

comment:15 in reply to:  description Changed 14 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 ; Changed 14 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 14 years ago by josharian@…

Cc: josharian@… added

Cc Me!

comment:18 in reply to:  16 ; Changed 14 years ago by stromnov (Andrey 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 ; Changed 14 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 ; Changed 14 years ago by stromnov (Andrey 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 14 years ago by raphael-st (Raphael Straub)

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 14 years ago by raphael-st (Raphael Straub)

Attachment: opencv.tar.bz2 added

comment:22 Changed 14 years ago by raphael-st (Raphael Straub)

Cc: raphael@… added

Cc Me!

comment:23 in reply to:  20 Changed 14 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 14 years ago by raphael-st (Raphael Straub)

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 14 years ago by raphael-st (Raphael Straub)

Attachment: Portfile.diff added

comment:25 Changed 14 years ago by raphael-st (Raphael Straub)

Resolution: fixed
Status: newclosed

Maintainer timeout: committed in r70430.

Note: See TracTickets for help on using tickets.