[Installation] Failure with undefined reference to cv::applyColorMap

907 views
Skip to first unread message

Siddhartha Banerjee

unread,
Oct 1, 2016, 2:19:21 PM10/1/16
to Caffe Users
Hello,

I was just trying to install Caffe for Convolutional Pose Machines (https://github.com/shihenw/caffe) and I ran into the following installation error:

../lib/libcaffe.so: undefined reference to `cv::applyColorMap(cv::_InputArray const&, cv::_OutputArray const&, int)'
collect2: error: ld returned 1 exit status

I had configured my installation using cmake. The command I ran was

cmake .. -DUSE_CUDNN=OFF -DBUILD_matlab=ON -DBLAS=open

and the output was as follows:

-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   system
--   thread
--   filesystem
-- Found gflags  (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libgflags.so)
-- Found glog    (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libglog.so)
-- Found PROTOBUF Compiler: /usr/bin/protoc
-- Found lmdb    (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/liblmdb.so)
-- Found LevelDB (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libleveldb.so)
-- Found Snappy  (include: /usr/include, library: /usr/lib/libsnappy.so)
-- CUDA detected: 7.5
-- Added CUDA NVCC flags for: sm_21
-- OpenCV found (/usr/local/share/OpenCV)
-- Found OpenBLAS libraries: /usr/lib/libopenblas.so
-- Found OpenBLAS include: /usr/include
-- NumPy ver. 1.8.2 found (include: /usr/lib/python2.7/dist-packages/numpy/core/include)
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   python
-- Detected Doxygen OUTPUT_DIRECTORY: ./doxygen/
-- 
-- ******************* Caffe Configuration Summary *******************
-- General:
--   Version           :   <TODO> (Caffe doesn't declare its version in headers)
--   Git               :   rc2-715-g22e4a44
--   System            :   Linux
--   C++ compiler      :   /usr/bin/c++
--   Release CXX flags :   -O3 -DNDEBUG -fPIC -Wall -Wno-sign-compare -Wno-uninitialized
--   Debug CXX flags   :   -g -fPIC -Wall -Wno-sign-compare -Wno-uninitialized
--   Build type        :   Release
-- 
--   BUILD_SHARED_LIBS :   ON
--   BUILD_python      :   ON
--   BUILD_matlab      :   ON
--   BUILD_docs        :   ON
--   CPU_ONLY          :   OFF
--   USE_OPENCV        :   ON
--   USE_LEVELDB       :   ON
--   USE_LMDB          :   ON
--   ALLOW_LMDB_NOLOCK :   OFF
-- 
-- Dependencies:
--   BLAS              :   Yes (open)
--   Boost             :   Yes (ver. 1.54)
--   glog              :   Yes
--   gflags            :   Yes
--   protobuf          :   Yes (ver. 2.5.0)
--   lmdb              :   Yes (ver. 0.9.10)
--   LevelDB           :   Yes (ver. 1.15)
--   Snappy            :   Yes (ver. 1.1.0)
--   OpenCV            :   Yes (ver. 2.4.9)
--   CUDA              :   Yes (ver. 7.5)
-- 
-- NVIDIA CUDA:
--   Target GPU(s)     :   Auto
--   GPU arch(s)       :   sm_21
--   cuDNN             :   Disabled
-- 
-- Python:
--   Interpreter       :   /usr/bin/python2.7 (ver. 2.7.6)
--   Libraries         :   /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.6)
--   NumPy             :   /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.8.2)
-- 
-- Matlab:
--   Matlab            :   Yes (/usr/local/MATLAB/R2015b/bin/mex, /usr/local/MATLAB/R2015b/bin/mexext
--   Octave            :   No
-- 
-- Documentaion:
--   Doxygen           :   /usr/bin/doxygen (1.8.6)
--   config_file       :   /home/banerjs/Libraries/CMU-Perceptual-Computing-Lab/caffe/.Doxyfile
-- 
-- Install:
--   Install path      :   /home/banerjs/Libraries/CMU-Perceptual-Computing-Lab/caffe/build/install
-- 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/banerjs/Libraries/CMU-Perceptual-Computing-Lab/caffe/build

This is on Ubuntu 14.04.

Any ideas on why I'm seeing the error? I've tried to search for other solutions to the issue and people have usually solved opencv related compilation issues with Caffe by using Cmake (which I am doing).

Alternately, do you think it is because I'm using the Convolutional Pose Machines fork?

Thanks,

Sid

Siddhartha Banerjee

unread,
Oct 1, 2016, 3:12:23 PM10/1/16
to Caffe Users
Problem Solved!

I had to edit the following file: https://github.com/shihenw/caffe/blob/master/cmake/Dependencies.cmake to include contrib in line 72.

What puzzles me is why I had to include it in line 72 and not 74: I have OpenCV 2, and line 72 is a workaround for OpenCV 3...

Sid

--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/6kn3aeRjbqE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users+unsubscribe@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/6dd16351-4df9-4261-b102-ff3b3d7d1b59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Siddhartha Banerjee

unread,
Oct 1, 2016, 3:13:43 PM10/1/16
to Caffe Users
Problem Solved!

I had to edit the following file: https://github.com/shihenw/caffe/blob/master/cmake/Dependencies.cmake to include contrib in line 72.

What puzzles me is why I had to include it in line 72 and not 74: I have OpenCV 2, and line 72 is a workaround for OpenCV 3...

Sid

Reply all
Reply to author
Forward
0 new messages