Opencv gem on snow leopard failing to bind to all required symbols

Greetings,
I have been working a solid week and a half at trying to get the
opencv ruby gem on snow leopard to load properly.

I went so far as to do a clean install of snow leopard. I am running
ruby 1.9.2-p290 oh-my-zsh with zsh, rvm and brew.
I installed opencv via brew install opencv --build32.

I am running 2.2 version of opencv.
It should be noted when I did a rake gem, I switched to the OpenCV_2.2
branch first.
I did this because I was getting the error message
/ext/opencv/cverror.cpp:143: error: CV_GpuCufftCallError was not
declared in this scope while installing the ruby binding, checkout the
OpenCV_2.2 branch or just remove the line 143 from
/ext/opencv/cverror.cpp

it is documented that the 2.2 branch fixes this, which it appears to do.

I did a manual rake gem on the opencv ruby gem and then installed the
gem (successfully) that was raked.
when I drop into irb and require opencv the following issue occurs.

require ‘opencv’
dyld: lazy symbol binding failed: Symbol not found: _cvRedirectError
Referenced from:
/Users/sophrinix/.rvm/gems/ruby-1.9.2-p290/gems/opencv-0.0.6pcting/lib/opencv/opencv.bundle
Expected in: flat namespace

dyld: Symbol not found: _cvRedirectError
Referenced from:
/Users/sophrinix/.rvm/gems/ruby-1.9.2-p290/gems/opencv-0.0.6pcting/lib/opencv/opencv.bundle
Expected in: flat namespace

[1] 28337 trace trap irb

The exact behavior occurs with ruby 1.8.7.

Has anyone ever seen this issue before.
If you are using the opencv gem on snow leopard and did install opencv
via brew, HOW?
any input would be appreciated.

Thanks.

Respectfully,
Andrew McElroy

On Sun, Sep 18, 2011 at 10:38 AM, andrew mcelroy [email protected]
wrote:

/Users/sophrinix/.rvm/gems/ruby-1.9.2-p290/gems/opencv-0.0.6pcting/lib/opencv/opencv.bundle

Expected in: flat namespace

[1] 28337 trace trap irb

after doing some googling on the dyld: Symbol not found issue i am
now trying a complete un and reinstall of opencv.
Perlmonks and the MySql dev teams have ran into issues before on snow
leopard where if you
try to mix 32 bit libraries on a 64 bit interpreter/ other libraries,
this issue can occur.

I’ll update this thread if a 64 bit install of opencv doesn’t fix the
issue.

Andrew McElroy

On Sun, Sep 18, 2011 at 10:45 AM, andrew mcelroy [email protected]
wrote:

after doing some googling on the dyld: Symbol not found issue i am
now trying a complete un and reinstall of opencv.
Perlmonks and the MySql dev teams have ran into issues before on snow
leopard where if you
try to mix 32 bit libraries on a 64 bit interpreter/ other libraries,
this issue can occur.

I’ll update this thread if a 64 bit install of opencv doesn’t fix the issue.

This fixes this issue. This probably also fixes the issue for those on
OSX Lion.
I don’t blog often (ever), but I’ll be sure to do an [ann] my blog
post on how to fix this.

OpenCV ruby binding is a righteous pain in the rear end with terrible
installation documentation.

the cliff notes are this:
brew install opencv # there may exist issues here. I’ll detail how to
solve them if this fails
git clone https://github.com/ser1zw/ruby-opencv.git
(cd into that directory)
git checkout origin/remotes/OpenCV_2.2
git branch OpenCV_2.2 #this is a clumsy way of dealing with git. I’ll
write this up better later.
bundle
rake gem
gem install ext/opencv-0.0.6.gem

irb
require ‘opencv’
=>true

There are potential failure points at each step, that’s what the blog
write up will be about.
However, in a non existent dream world this gets you up and running
with opencv and the ruby bindings on a mac os.

NOTICE: if you have gone 64 bit, go all the way. Don’t try to run 64
bit ruby and 32 bit libraries. It will yield the issue I previously
posted about.

I hope this saves someone else the nightmare I dealt with.

Respectfully,
Andrew McElroy

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs