0

I am installing Caffe on Mac OS X 10.11 El Capitan, which somehow requires that I install OpenCV with libstdc++. To do so, I did "brew update opencv" and adding the following lines below "def install" as mentioned on the Caffe website (http://caffe.berkeleyvision.org/install_osx.html):

def install
      # ADD THE FOLLOWING:
      ENV.append "CXXFLAGS", "-stdlib=libstdc++"
      ENV.append "CFLAGS", "-stdlib=libstdc++"
      ENV.append "LDFLAGS", "-stdlib=libstdc++ -lstdc++"
      # The following is necessary because libtool likes to strip LDFLAGS:
      ENV["CXX"] = "/usr/bin/clang++ -stdlib=libstdc++"
      ...

However, when I go install it using "brew install --build-from-source -vd opencv", I get the following error:

cd /tmp/opencv-20170909-8122-1xa5qpl/opencv-3.3.0/build/modules/dnn && /usr/local/Cellar/cmake/3.9.2/bin/cmake -E cmake_symlink_library ../../lib/libopencv_dnn.3.3.0.dylib ../../lib/libopencv_dnn.3.3.dylib ../../lib/libopencv_dnn.dylib [ 59%] Built target opencv_dnn make: *** [all] Error 2 /usr/local/Homebrew/Library/Homebrew/debrew.rb:11:in `raise' BuildError: Failed executing: make 1. raise 2. ignore 3. backtrace 4. irb 5. shell Choose an action:

Anyone know how to solve this? Thank you in advance!

EDIT: Actually, I realized that my original opencv.rb file is producing the exact same problem. How do I fix/find an opencv.rb file that works?

Amelia
  • 33
  • 5

1 Answers1

1

It looks like he build you are going for in not compatible with the OS. If installing on Mac would suggest trying this method of implementation. It also uses homebrew but allows for a quick and simple implementation.

C.Radford
  • 882
  • 4
  • 13
  • 31
  • Unfortunately things have changed since that tutorial. If you run `brew options opencv3` or `brew options opencv` you will see they have all gone. – Mark Setchell Sep 11 '17 at 15:57
  • @MarkSetchell Such a bummer if thats true. I installed it just last week tho. I noticed 'brew options' didn't give anything but if you use the commands and tags listed it still worked for me minus '--head' which I just removed from my build as it wasn't need for me. – C.Radford Sep 11 '17 at 16:10
  • 1
    I'm no expert, and if anyone else knows better, I am happy to be corrected - and delighted to find someone who actually knows what is going on and can answer some questions. Maybe try running `opencv_version -v` to see what you actually got. – Mark Setchell Sep 11 '17 at 16:16