1

This is my first question in stackoverflow. I am trying to be specific.

I was trying to install opencv on my mac and I found Installing openCV 2.4.2 on Mac OS X 10.9 (Mavericks). According to the answer, I tried "sudo port install opencv" after installing macports.

But I got the following message: Error: Unable to open port: can't set "compiler.blacklist": couldn't determine build number of compiler "llvm-gcc-4.2"

I think it has something to do with gcc and clang, but I'm not sure how it works. I installed Xcode5 as well as the command line tool.

simicah:~$ gcc --version

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) Target: x86_64-apple-darwin13.0.0 Thread model: posix

Could you help me fix this and explain why I encountered that error? Thanks.

Community
  • 1
  • 1
simicah
  • 13
  • 1
  • 3

2 Answers2

0

I always try to install OpenCV compiling the source code, you get the last version of OpenCV and be sure that the install is done using the parameters given by OpenCV creators.

I think OpenCV uses Cmake to be installed, in that case install cake, create a build folder in your openCV directory and into the build folder type cmake ..

After that and if everything goes right your would have a makefile file, execute it and then sudo make install.

UPDATE: I just tested my answer in my Retina laptop with OS x 10.9.1 and OpenCV 2.4.8.

Scanning dependencies of target opencv_traincascade
[ 99%] Building CXX object apps/traincascade/CMakeFiles/opencv_traincascade.dir/traincascade.cpp.o
[ 99%] Building CXX object apps/traincascade/CMakeFiles/opencv_traincascade.dir/cascadeclassifier.cpp.o
[100%] Building CXX object apps/traincascade/CMakeFiles/opencv_traincascade.dir/boost.cpp.o
[100%] Building CXX object apps/traincascade/CMakeFiles/opencv_traincascade.dir/features.cpp.o
[100%] Building CXX object apps/traincascade/CMakeFiles/opencv_traincascade.dir/haarfeatures.cpp.o
[100%] Building CXX object apps/traincascade/CMakeFiles/opencv_traincascade.dir/lbpfeatures.cpp.o
[100%] Building CXX object apps/traincascade/CMakeFiles/opencv_traincascade.dir/HOGfeatures.cpp.o
[100%] Building CXX object apps/traincascade/CMakeFiles/opencv_traincascade.dir/imagestorage.cpp.o
Linking CXX executable ../../bin/opencv_traincascade
[100%] Built target opencv_traincascade

██ memmaker6501 @ ~/Downloads/opencv-2.4.8/build
██ 11:34:46 $ cmake --version
cmake version 2.8.12.1

Take care that if you want to create a xcodeproject you must compile the library with different parameters.

Jorge Vega Sánchez
  • 7,430
  • 14
  • 55
  • 77
0

Finally, I decided to install opencv using cmake. Here is the steps that I followed: hope this can be helpful to others

  1. INSTALLING CMAKE

  2. INSTALLING OPENCV

    • mkdir build
    • cd build
    • cmake -G "Unix Makefiles" -D CMAKE_INSTALL_PREFIX=/Users/Developer/opencv/ -D CMAKE_OSX_ARCHITECTURES=x86_64 -D BUILD_PERF_TESTS=OFF ..
    • make -j8
    • sudo make install

Note: I am using new Mac Air with Maverick and I installed opencv 2.4.8

simicah
  • 13
  • 1
  • 3