Docker OpenCV + Contrib Build
I successfully build OpenCV in docker - see here My build command is the following:
# install OpenCV
RUN cd /opt && \
wget https://github.com/daveselinger/opencv/archive/3.1.0-with-cuda8.zip -O opencv-3.1.0.zip -nv && \
unzip opencv-3.1.0.zip && \
mv opencv-3.1.0-with-cuda8 opencv-3.1.0 && \
cd opencv-3.1.0 && \
rm -rf build && \
mkdir build && \
cd build && \
cmake -D CUDA_ARCH_BIN=3.2 \
-D CUDA_ARCH_PTX=3.2 \
-D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D WITH_TBB=ON \
-D BUILD_NEW_PYTHON_SUPPORT=ON \
-D WITH_V4L=ON \
-D BUILD_TIFF=ON \
-D WITH_QT=ON \
-D ENABLE_PRECOMPILED_HEADERS=OFF \
# -D USE_GStreamer=ON \
-D WITH_OPENGL=ON .. \
make -j4 && \
make install && \
echo "/usr/local/lib" | sudo tee -a /etc/ld.so.conf.d/opencv.conf && \
ldconfig
and it works as expected. But when I try to build with contribs adding
-D OPENCV_EXTRA_MODULES_PATH=opencv_contrib/modules .. && \
it does not work: returned a non-zero code: 1
Comments
- try to avoid cached 3rd party opencv repositories, noone can help you with those.
- to use the opencv_contrib repo, you need either latest master branch of both opencv and opencv_contrib, or at least same commit timestamps. those must be tightly synchronized.
- make sure the path to the opencv_contrib modules is correct. (yours looks wrong, try an absolute path there)
- try to skip the make && make install steps for now, and take a close look at the cmake output. (maybe even put it here, so ppl can check.) only go on building, if anything looks entirely correct.