error: when build tools/extract_features.bin
I get following errors while trying to build on Ubuntu 14.04:
g++ tools/extract_features.cpp -pthread -fPIC -DNDEBUG -O2 -I/usr/include/python2.7 -I/usr /lib/python2.7/dist-packages/numpy/core/include -I/usr/local/include -I.build_release/src -I./src -I./include -I/usr/local/cuda/include -Wall -Wno-sign-compare -c -o .build_release/tools/extract_features.o 2> .build_release/tools/extract_features.o.warnings.txt
|| (cat .build_release/tools/extract_features.o.warnings.txt; exit 1)
g++ .build_release/tools/extract_features.o .build_release/lib/libcaffe.a -o .build_release/tools/extract_features.bin -fPIC -DNDEBUG -O2 -I/usr/include/python2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/local/include -I.build_release/src -I./src -I./include -I/usr/local/cuda/include -Wall -Wno-sign-compare -L/home/mender/anaconda/lib -L/usr/local/lib -L/usr/lib -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib -lcudart -lcublas -lcurand -lglog -lgflags -lpthread -lprotobuf -lleveldb -lsnappy -llmdb -lboost_system -lhdf5_hl -lhdf5 -lopencv_core -lopencv_highgui -lopencv_imgproc -lcblas -latlas
//usr/lib/x86_64-linux-gnu/libx264.so.142: undefined reference to __exp_finite@GLIBC_2.15' //usr/lib/x86_64-linux-gnu/libx264.so.142: undefined reference to__log10_finite@GLIBC_2.15'
//usr/lib/x86_64-linux-gnu/libxvidcore.so.4: undefined reference to __logf_finite@GLIBC_2.15' //usr/lib/x86_64-linux-gnu/libvorbis.so.0: undefined reference to__acosf_finite@GLIBC_2.15'
//usr/lib/x86_64-linux-gnu/libx264.so.142: undefined reference to __pow_finite@GLIBC_2.15' //usr/lib/x86_64-linux-gnu/libx264.so.142: undefined reference to__log2_finite@GLIBC_2.15'
//usr/lib/x86_64-linux-gnu/libxvidcore.so.4: undefined reference to __log10f_finite@GLIBC_2.15' //usr/lib/x86_64-linux-gnu/libxvidcore.so.4: undefined reference to__log_finite@GLIBC_2.15'
//usr/lib/x86_64-linux-gnu/libx264.so.142: undefined reference to __powf_finite@GLIBC_2.15' //usr/lib/x86_64-linux-gnu/libx264.so.142: undefined reference to__log2f_finite@GLIBC_2.15'
collect2: ld returned 1 exit status
make: *** [.build_release/tools/extract_features.bin] Error 1
My Makefile.config setting likes this:
CUDA_DIR := /usr/local/cuda
CUDA_ARCH := -gencode arch=compute_20,code=sm_20
-gencode arch=compute_20,code=sm_21
-gencode arch=compute_30,code=sm_30
-gencode arch=compute_35,code=sm_35
-gencode arch=compute_50,code=sm_50
-gencode arch=compute_50,code=compute_50
BLAS := atlas
MATLAB_DIR := /usr/local/MATLAB/R2012b
PYTHON_INCLUDE := $(HOME)/anaconda/include
$(HOME)/anaconda/include/python2.7
$(HOME)/anaconda/lib/python2.7/site-packages/numpy/core/include
PYTHON_LIB := $(HOME)/anaconda/lib
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib
BUILD_DIR := build
DISTRIBUTE_DIR := distribute
TEST_GPUID := 0
g++ --version
g++ (Ubuntu/Linaro 4.6.4-6ubuntu2) 4.6.4
echo $LD_LIBRARY_PATH
/home/anaconda/lib:/usr/local/cuda-6.0/lib64:/usr/local/lib:/usr/lib:
This problem seems like #757, but I don't know how to get ride of the error. Where things go wrong? Thanks.
Ask installation questions on the caffe-users mailing list please!
Some versions of Anaconda seem to come with a bad libm. rm ~/anaconda/lib/libm.* takes care of this by reverting to the system libm.
Also would be good to have on the installation page http://caffe.berkeleyvision.org/installation.html
Thx shelhamer. After removing the libm files of Anaconda, my problem is solved.
Thanks @shelhamer, this is really helpful. I get the same error, after I remove libm.* files, I succesfully compiled it.
Thanks alot
This also fixed my problem. Thanks!
It fixed my problem
Fixed my problem too. (I fixed by commenting the PYTHON_LIB in Makefile.config - I had added path to anaconda libs while building the python wrapper!)
+1 for adding to installation page.
fixed my problem too!
also fixed my problem by commenting the PYTHON_LIB in Makefile.config - thanks
I am facing same sort of error while installing caffe with Anaconda.
-
[ 82%] Linking CXX executable extract_features
-
CMakeFiles/extract_features.dir/extract_features.cpp.o: In function `std::__cxx11::basic_string<char, std::char_traits
, std::allocator >* google::MakeCheckOpString<int, int>(int const&, int const&, char const*)': -
extract_features.cpp:(.text._ZN6google17MakeCheckOpStringIiiEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIiiEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x50): undefined reference to `google::base::CheckOpMessageBuilder::NewStringabi:cxx11'
-
CMakeFiles/extract_features.dir/extract_features.cpp.o: In function `std::__cxx11::basic_string<char, std::char_traits
, std::allocator >* google::MakeCheckOpString<unsigned long, unsigned long>(unsigned long const&, unsigned long const&, char const*)': -
extract_features.cpp:(.text._ZN6google17MakeCheckOpStringImmEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN6google17MakeCheckOpStringImmEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x51): undefined reference to `google::base::CheckOpMessageBuilder::NewStringabi:cxx11'
-
../lib/libcaffe.so.1.0.0: undefined reference to `leveldb::Status::ToStringabi:cxx11 const'
-
../lib/libcaffe.so.1.0.0: undefined reference to `leveldb::DB::Open(leveldb::Options const&, std::__cxx11::basic_string<char, std::char_traits
, std::allocator > const&, leveldb::DB**)' -
collect2: error: ld returned 1 exit status
-
tools/CMakeFiles/extract_features.dir/build.make:129: recipe for target 'tools/extract_features' failed
-
make[2]: *** [tools/extract_features] Error 1
-
CMakeFiles/Makefile2:457: recipe for target 'tools/CMakeFiles/extract_features.dir/all' failed
-
make[1]: *** [tools/CMakeFiles/extract_features.dir/all] Error 2
-
Makefile:127: recipe for target 'all' failed
-
make: *** [all] Error 2
-
Makefile.config which I updated looks like this
CPU_ONLY := 1 ANACONDA_HOME := $(HOME)/anaconda2 PYTHON_INCLUDE := $(ANACONDA_HOME)/include
$(ANACONDA_HOME)/include/python2.7
$(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include PYTHON_LIB := $(ANACONDA_HOME)/lib WITH_PYTHON_LAYER := 1 INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib BUILD_DIR := build DISTRIBUTE_DIR := distribute TEST_GPUID := 0 Q ?= @