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?