Background:
I wish to use both Caffe and Digits such that I can use Caffe within the Digits framework or external to it.
However, for a particular project, I require that Caffe uses OpenCV 3 and not OpenCV 2.4, which Digits installs by default. This project uses Caffe external to Digits, and does not make any use of the Digits framework.
It appears that by installing Digits, my OpenCV 3 installation was "clobbered" with OpenCV 2.4, which is now causing problems within my original Caffe installation.
To make things clearer, below is a listing of the steps that I have taken.
From a fresh Ubuntu 14.04 installation:
- Installed Caffe dependencies (except OpenCV) as per the Ubuntu install guide
- Installed OpenCV 3 from source to
/usr/local
- Tested OpenCV installation
- Demos worked fine including OpenCV 3-specific code
- Compiled Caffe, setting the
Makefile.config
to use OpenCV 3 - Tested Caffe installation
- All tests passed, demos worked fine
- Installed Digits as per the install guide
- Caffe and OpenCV 2.4 were installed by default by the installer script
- OpenCV 3 clobbered by OpenCV 2.4 (?)
- Carried out the steps from the Digits Getting Started guide
- All steps were successful
- Suspected OpenCV conflict, so tried to compile a Caffe demo
- Error occurred relating to OpenCV 3.0 and 2.4 conflict -- details below.
Compilation command:
g++ classification.cpp -o classification -I/home/josh/software/caffe/include/ -L/home/josh/software/caffe/build/lib/ -lcaffe -I/usr/local/cuda/include -L/usr/local/cuda/lib64 -lcuda -lcudart -lcublas -lcurand -I/home/josh/software/cudnn/include/ -L/home/josh/software/cudnn/lib64/ -lcudnn -L/usr/lib/x86_64-linux-gnu/ -lglog -L/usr/local/lib -lboost_system -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_imgcodecs -DUSE_OPENCV
Error message:
/usr/bin/ld: warning: libopencv_core.so.3.0, needed by /home/josh/software/caffe/build/lib//libcaffe.so, may conflict with libopencv_core.so.2.4 /usr/bin/ld: /tmp/ccHaWcOl.o: undefined reference to symbol '_ZN2cv6String10deallocateEv' //usr/local/lib/libopencv_core.so.3.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status
Questions:
- How do I best resolve the OpenCV version conflict without breaking either Caffe/Digits installations?
- Do I need to remove OpenCV and reinstall Caffe and Digits?
- If so, what do I need to do differently to prevent the OpenCV version conflicts while still allowing Caffe (with OpenCV 3) and Digits to work side-by-side?