caffe
caffe copied to clipboard
Caffe doest not build with opencv 4.0.1
Issue summary
Caffe doest not build with opencv 4.0.1 (which is the latest opencv at the time of writing). This was identified as part of Homebrew testing: https://github.com/Homebrew/homebrew-core/pull/35521/files
Steps to reproduce
- Doc for caffe 1.0 says:
Optional dependencies:
- OpenCV >= 2.4 including 3.0
-
Compile with:
cmake . -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/caffe/1.0_8 -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev -DALLOW_LMDB_NOLOCK=OFF -DBUILD_SHARED_LIBS=ON -DBUILD_docs=OFF -DBUILD_matlab=OFF -DBUILD_python=OFF -DBUILD_python_layer=OFF -DCPU_ONLY=ON -DUSE_LEVELDB=ON -DUSE_LMDB=ON -DUSE_NCCL=OFF -DUSE_OPENCV=ON -DUSE_OPENMP=OFF && make install
-
OpenCV is correctly identified:
18:16:47 -- ******************* Caffe Configuration Summary *******************
18:16:47 -- General:
18:16:47 -- Version : 1.0.0
18:16:47 -- Git : unknown
18:16:47 -- System : Darwin
18:16:47 -- C++ compiler : /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++
18:16:47 -- Release CXX flags : -DNDEBUG -fPIC -Wall -Wno-sign-compare -Wno-uninitialized
18:16:47 -- Debug CXX flags : -g -fPIC -Wall -Wno-sign-compare -Wno-uninitialized
18:16:47 -- Build type : Release
18:16:47 --
18:16:47 -- BUILD_SHARED_LIBS : ON
18:16:47 -- BUILD_python : OFF
18:16:47 -- BUILD_matlab : OFF
18:16:47 -- BUILD_docs : OFF
18:16:47 -- CPU_ONLY : ON
18:16:47 -- USE_OPENCV : ON
18:16:47 -- USE_LEVELDB : ON
18:16:47 -- USE_LMDB : ON
18:16:47 -- USE_NCCL : OFF
18:16:47 -- ALLOW_LMDB_NOLOCK : OFF
18:16:47 --
18:16:47 -- Dependencies:
18:16:47 -- BLAS : Yes (vecLib)
18:16:47 -- Boost : Yes (ver. 1.68)
18:16:47 -- glog : Yes
18:16:47 -- gflags : Yes
18:16:47 -- protobuf : Yes (ver. 3.6.1)
18:16:47 -- lmdb : Yes (ver. 0.9.23)
18:16:47 -- LevelDB : Yes (ver. 1.20)
18:16:47 -- Snappy : Yes (ver. 1.1.7)
18:16:47 -- OpenCV : Yes (ver. 4.0.1)
18:16:47 -- CUDA : No
- But the build fails nonetheless:
18:16:47 /tmp/caffe-20181228-53962-vg617x/caffe-1.0/src/caffe/layers/window_data_layer.cpp:293:42: error: use of undeclared identifier 'CV_LOAD_IMAGE_COLOR'
18:16:47 cv_img = cv::imread(image.first, CV_LOAD_IMAGE_COLOR);
18:16:47 ^
18:16:47 1 error generated.
Tried solutions
- We are considering shipping caffe without opencv support.
- Two possible pull requests are open in your tracker https://github.com/BVLC/caffe/pull/6625 and https://github.com/BVLC/caffe/pull/6638 but they are inactive.
System configuration
- Operating system: macOS 10.12 to 10.14
- Compiler: clang from Apple Xcode
- BLAS: Apple's system blas library
Issue checklist
- [X] read the guidelines and removed the first paragraph
- [X] written a short summary and detailed steps to reproduce
- [X] explained how solutions to related problems failed (tick if found none)
- [X] filled system configuration
- [X] attached relevant logs/config files (tick if not applicable)
I opened #6638, and I built it passed all the tests. Tell me if it doesn't work in any cases. I'll try to fix it.
Is the project alive?
I personally forked it with my #6638 patch added. Feel free to try it out. my fork
let me know if there is any issues.
what if I don't build with opencv?
Try this: https://github.com/AlexandrParkhomenko/aur/blob/master/caffe/readmeFix!!!.patch That is all.