Cannot compile 2.4.8 on OS X 10.8.5

asked 2014-01-26 01:33:18 -0500

thistle gravatar image

updated 2014-01-26 02:11:19 -0500

I have been using OpenCV for several years and I have never had problems in compiling the sources on my macs, but I am not able to compile the latest sources (2.4.8) on my OS X 10.8.5 machine.

I am building OpenCV using CMake with the flag -DBUILD_SHARED_LIBS=OFF (followed by make), as suggested on the page explaining how to generate the binaries for using the Java interface. The compiler is i686-apple-darwin11-llvm-gcc-4.2. When I run CMake I get only this error:

-- Found PythonInterp: /opt/local/bin/python (found suitable version "3.3", minimum required is "2.0") 
-- Could NOT find PythonLibs: Found unsuitable version "2.7.2", but required is exact version "3.3" (found     PYTHON_LIBRARY-NOTFOUND)
 File "<string>", line 1
 from distutils.sysconfig import *; print get_python_lib()
                                                      ^
SyntaxError: invalid syntax
   File "<string>", line 1
import os; os.environ['DISTUTILS_USE_SDK']='1'; import numpy.distutils; print   numpy.distutils.misc_util.get_numpy_include_dirs()[0]
                                                                                  ^
SyntaxError: invalid syntax

I installed the latest python for OS X and used the variable PYTHON_LIBRARIES (pointing to the 3.3 dylib) but the error remains.

First, I had a problem related to libavcodec, but a quick search suggested to remove ffmpeg from my computer. After the removal the error went away.

Now, I have the following message errors,

Scanning dependencies of target opencv_test_contrib
[ 85%] Building CXX object modules/contrib/CMakeFiles/opencv_test_contrib.dir/test/test_main.cpp.o
Linking CXX executable ../../bin/opencv_test_superres
Linking CXX executable ../../bin/opencv_test_contrib
[ 85%] Built target opencv_test_contrib
[ 85%] Generating core+CvException-jdoc.java, [and many others …]
make[2]: *** [modules/java/core+CvException-jdoc.java] Error 1
make[1]: *** [modules/java/CMakeFiles/opencv_java.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 85%] Built target opencv_test_superres
make: *** [all] Error 2

I cannot find any information on this particular problem. Is there anyone who can help me?

edit retag flag offensive close merge delete