-1

I am trying to install opencv2 on my Mac Air (with Lion) via these instructions.

http://www.guidefreitas.com/installing-opencv-2-4-2-on-mac-osx-mountain-lion-with-python-support

I have successfully made opencv2 with

make j8

However, running sudo make install produces an odd error noting how numextisn't defined.

[ 63%] Building CXX object modules/contrib/CMakeFiles/opencv_contrib.dir/src/rgbdodometry.cpp.o
In file included from /Users/davidfaux/Downloads/opencv-2.4.7/modules/contrib/src/rgbdodometry.cpp:65:
In file included from /usr/local/include/unsupported/Eigen/MatrixFunctions:61:
/usr/local/include/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h:119:41: error: 
      use of undeclared identifier 'numext'
    result(0,1) = A(0,1) * (Scalar(2) * numext::atanh2(y,x) + ...
                                        ^
In file included from /Users/davidfaux/Downloads/opencv-2.4.7/modules/contrib/src/rgbdodometry.cpp:65:
In file included from /usr/local/include/unsupported/Eigen/MatrixFunctions:62:
/usr/local/include/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h:242:36: error: 
      use of undeclared identifier 'numext'
  int unwindingNumber = std::ceil((numext::imag(logCurr - logPrev) - M_PI) ...
                               ^

What does this error mean? I feel that it has to do with the Eigen library. I tried remaking the Eigen library. In turn, this produced another error involving glew, glut, and OpenGL. It feels like going down a rabbit hole.

Does anyone know where the error in the Eigen library comes from?

dangerChihuahua007
  • 20,299
  • 35
  • 117
  • 206

3 Answers3

2

It seems you are mixing two different versions of Eigen. Moreover, let me recall again that Eigen does not has to be compiled.

ggael
  • 28,425
  • 2
  • 65
  • 71
  • Thanks! I think you're right. I had upgraded Eigen recently and found two versions of it in my path. I removed both and reinstalled Eigen. That solved the problem. – dangerChihuahua007 Dec 09 '13 at 03:17
2

My actual solution was to create symbolic links to eigen3, such as:

$ ln -s /usr/local/include/eigen3/unsupported /usr/local/include/
user819893
  • 129
  • 1
  • 4
  • Nice! This error can also happen when using vcglib (that ships a version of Eigen internally, which may be different from the system version). – thiagowfx Mar 18 '14 at 03:31
2

This was driving me crazy... but in the end it was just a:

brew install eigen

And opencv built correctly!

alcoholiday
  • 719
  • 5
  • 10