opencv2 build failing on osx [closed]
Following the homebrew instructions for the desktop variant on OSX 10.8.3, opencv2 is failing to build at the following point:
[ 22%] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmImf/ImfZipCompressor.cpp.o
Linking CXX static library ../lib/libIlmImf.a
/usr/bin/ranlib: file: ../lib/libIlmImf.a(IlmThread.cpp.o) has no symbols
/usr/bin/ranlib: file: ../lib/libIlmImf.a(IlmThreadMutex.cpp.o) has no symbols
/usr/bin/ranlib: file: ../lib/libIlmImf.a(IlmThreadSemaphore.cpp.o) has no symbols
/usr/bin/ranlib: file: ../lib/libIlmImf.a(IlmThreadSemaphorePosixCompat.cpp.o) has no symbols
/usr/bin/ranlib: file: ../lib/libIlmImf.a(IlmThread.cpp.o) has no symbols
/usr/bin/ranlib: file: ../lib/libIlmImf.a(IlmThreadMutex.cpp.o) has no symbols
/usr/bin/ranlib: file: ../lib/libIlmImf.a(IlmThreadSemaphore.cpp.o) has no symbols
/usr/bin/ranlib: file: ../lib/libIlmImf.a(IlmThreadSemaphorePosixCompat.cpp.o) has no symbols
[ 22%] Built target IlmImf
Linking CXX shared library ../../lib/libopencv_core.dylib
[ 22%] Built target opencv_core
make: *** [all] Error 2
Based on this link, installing ilmbase 1.0.2 and openexr 1.7.0 should fix the problem. ilmbase was already at 1.0.2 from homebrew, and openexr doesn't seem to be installed at all (at least not through homebrew). After installing openexr 1.7.0 through homebrew, the build now fails much earlier with the following:
[ 9%] Building C object 3rdparty/libjasper/CMakeFiles/libjasper.dir/jpc_util.c.o
Linking C static library ../lib/liblibjasper.a
Linking C static library ../lib/liblibjpeg.a
[ 9%] Built target libjasper
[ 9%] Built target libjpeg
make: *** [all] Error 2
Traceback (most recent call last):
File "./src/catkin/bin/../python/catkin/builder.py", line 658, in build_workspace_isolated
number=index + 1, of=len(ordered_packages)
File "./src/catkin/bin/../python/catkin/builder.py", line 456, in build_package
install, jobs, force_cmake, quiet, last_env, cmake_args, make_args
File "./src/catkin/bin/../python/catkin/builder.py", line 359, in build_cmake_package
run_command(make_cmd, build_dir, quiet)
File "./src/catkin/bin/../python/catkin/builder.py", line 186, in run_command
raise subprocess.CalledProcessError(proc.returncode, ' '.join(cmd))
CalledProcessError: Command '/Users/lazewatd/ros_catkin_ws/install_isolated/env.sh make -j8 -l8' returned non-zero exit status 2
<== Failed to process package 'opencv2':
Command '/Users/lazewatd/ros_catkin_ws/install_isolated/env.sh make -j8 -l8' returned non-zero exit status 2
Ideas?
UPDATE: Turning off openexr support in CMakeLists.txt (and also disabling doc generation for some reason) enabled the build to complete successfully. Not really a solution, but at least it built.