Caffe: Problem when build Caffe on Ubuntu 14.04

Created on 29 Nov 2015  Â·  16Comments  Â·  Source: BVLC/caffe

Hi, all. I met a problem when I was building newest caffe on Ubuntu 14.04. I have successfully build a older version of caffe on the same environment. There is the log output. I don't know how to solve this problem? Can anyone give some suggestions?

LD -o .build_release/lib/libcaffe.so
CXX/LD -o .build_release/tools/convert_imageset.bin
CXX/LD -o .build_release/tools/upgrade_net_proto_binary.bin
CXX/LD -o .build_release/tools/net_speed_benchmark.bin
CXX/LD -o .build_release/tools/caffe.bin
CXX/LD -o .build_release/tools/upgrade_net_proto_text.bin
CXX/LD -o .build_release/tools/test_net.bin
CXX/LD -o .build_release/tools/extract_features.bin
CXX/LD -o .build_release/tools/compute_image_mean.bin
CXX/LD -o .build_release/tools/train_net.bin
CXX/LD -o .build_release/tools/finetune_net.bin
CXX/LD -o .build_release/tools/device_query.bin
CXX/LD -o .build_release/tools/upgrade_solver_proto_text.bin
.build_release/tools/caffe.o: In function `test()':
caffe.cpp:(.text+0xd21): undefined reference to `caffe::Net<float>::Net(std::string const&, caffe::Phase, caffe::Net<float> const*)'
.build_release/tools/caffe.o: In function `train()':
caffe.cpp:(.text+0x1830): undefined reference to `caffe::ReadSolverParamsFromTextFileOrDie(std::string const&, caffe::SolverParameter*)'
caffe.cpp:(.text+0x191f): undefined reference to `caffe::SignalHandler::SignalHandler(caffe::SolverAction::Enum, caffe::SolverAction::Enum)'
caffe.cpp:(.text+0x196b): undefined reference to `caffe::SignalHandler::GetActionFunction()'
caffe.cpp:(.text+0x1976): undefined reference to `caffe::Solver<float>::SetActionFunction(boost::function<caffe::SolverAction::Enum ()>)'
caffe.cpp:(.text+0x1a00): undefined reference to `caffe::P2PSync<float>::P2PSync(boost::shared_ptr<caffe::Solver<float> >, caffe::P2PSync<float>*, caffe::SolverParameter const&)'
caffe.cpp:(.text+0x1a1d): undefined reference to `caffe::P2PSync<float>::run(std::vector<int, std::allocator<int> > const&)'
caffe.cpp:(.text+0x1a25): undefined reference to `caffe::P2PSync<float>::~P2PSync()'
caffe.cpp:(.text+0x1a71): undefined reference to `caffe::SignalHandler::~SignalHandler()'
caffe.cpp:(.text+0x1e53): undefined reference to `caffe::SignalHandler::~SignalHandler()'
caffe.cpp:(.text+0x1ec4): undefined reference to `caffe::P2PSync<float>::~P2PSync()'
caffe.cpp:(.text+0x1f93): undefined reference to `caffe::P2PSync<float>::~P2PSync()'
.build_release/tools/caffe.o: In function `time()':
caffe.cpp:(.text+0x214e): undefined reference to `caffe::Net<float>::Net(std::string const&, caffe::Phase, caffe::Net<float> const*)'
caffe.cpp:(.text+0x245c): undefined reference to `caffe::Layer<float>::Lock()'
caffe.cpp:(.text+0x2561): undefined reference to `caffe::Layer<float>::Unlock()'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/caffe.bin] Error 1
make: *** Waiting for unfinished jobs....
.build_release/tools/extract_features.o: In function `int feature_extraction_pipeline<float>(int, char**)':
extract_features.cpp:(.text._Z27feature_extraction_pipelineIfEiiPPc[_Z27feature_extraction_pipelineIfEiiPPc]+0xf9): undefined reference to `caffe::Net<float>::Net(std::string const&, caffe::Phase, caffe::Net<float> const*)'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/extract_features.bin] Error 1
.build_release/tools/upgrade_solver_proto_text.o: In function `main':
upgrade_solver_proto_text.cpp:(.text.startup+0x191): undefined reference to `caffe::SolverNeedsTypeUpgrade(caffe::SolverParameter const&)'
upgrade_solver_proto_text.cpp:(.text.startup+0x1a0): undefined reference to `caffe::UpgradeSolverAsNeeded(std::string const&, caffe::SolverParameter*)'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/upgrade_solver_proto_text.bin] Error 1

Most helpful comment

@mrasyid , for me, just rm /usr/local/lib/libcaffe.*

All 16 comments

I just did a build with fresh sources yesterday with no problems, but I was
on 15.10. It could be a problem specific to the way you setup your
configuration, or something has changed in your 14.04 environment.

On Sat, Nov 28, 2015 at 11:52 PM, JamesKnowton [email protected]
wrote:

Hi, all. I met a problem when I was building newest caffe on Ubuntu 14.04.
I have successfully build a older version of caffe on the same environment.
There is the log output. I don't know how to solve this problem? Can anyone
give some suggestions?

LD -o .build_release/lib/libcaffe.so
CXX/LD -o .build_release/tools/convert_imageset.bin
CXX/LD -o .build_release/tools/upgrade_net_proto_binary.bin
CXX/LD -o .build_release/tools/net_speed_benchmark.bin
CXX/LD -o .build_release/tools/caffe.bin
CXX/LD -o .build_release/tools/upgrade_net_proto_text.bin
CXX/LD -o .build_release/tools/test_net.bin
CXX/LD -o .build_release/tools/extract_features.bin
CXX/LD -o .build_release/tools/compute_image_mean.bin
CXX/LD -o .build_release/tools/train_net.bin
CXX/LD -o .build_release/tools/finetune_net.bin
CXX/LD -o .build_release/tools/device_query.bin
CXX/LD -o .build_release/tools/upgrade_solver_proto_text.bin
.build_release/tools/caffe.o: In function test()': caffe.cpp:(.text+0xd21): undefined reference tocaffe::Net::Net(std::string const&, caffe::Phase, caffe::Net const_)'
.build_release/tools/caffe.o: In function train()': caffe.cpp:(.text+0x1830): undefined reference tocaffe::ReadSolverParamsFromTextFileOrDie(std::string const&, caffe::SolverParameter_)'
caffe.cpp:(.text+0x191f): undefined reference to caffe::SignalHandler::SignalHandler(caffe::SolverAction::Enum, caffe::SolverAction::Enum)' caffe.cpp:(.text+0x196b): undefined reference tocaffe::SignalHandler::GetActionFunction()'
caffe.cpp:(.text+0x1976): undefined reference to caffe::Solver<float>::SetActionFunction(boost::function<caffe::SolverAction::Enum ()>)' caffe.cpp:(.text+0x1a00): undefined reference tocaffe::P2PSync::P2PSync(boost::shared_ptrcaffe::Solver_, caffe::SolverParameter const&)'
caffe.cpp:(.text+0x1a1d): undefined reference to caffe::P2PSync<float>::run(std::vector<int, std::allocator<int> > const&)' caffe.cpp:(.text+0x1a25): undefined reference tocaffe::P2PSync::~P2PSync()'
caffe.cpp:(.text+0x1a71): undefined reference to caffe::SignalHandler::~SignalHandler()' caffe.cpp:(.text+0x1e53): undefined reference tocaffe::SignalHandler::~SignalHandler()'
caffe.cpp:(.text+0x1ec4): undefined reference to caffe::P2PSync<float>::~P2PSync()' caffe.cpp:(.text+0x1f93): undefined reference tocaffe::P2PSync::~P2PSync()'
.build_release/tools/caffe.o: In function time()': caffe.cpp:(.text+0x214e): undefined reference tocaffe::Net::Net(std::string const&, caffe::Phase, caffe::Net const_)'
caffe.cpp:(.text+0x245c): undefined reference to caffe::Layer<float>::Lock()' caffe.cpp:(.text+0x2561): undefined reference tocaffe::Layer::Unlock()'
collect2: error: ld returned 1 exit status
make: ** [.build_release/tools/caffe.bin] Error 1
make: *
* Waiting for unfinished jobs....
.build_release/tools/extract_features.o: In function int feature_extraction_pipeline<float>(int, char**)': extract_features.cpp:(.text._Z27feature_extraction_pipelineIfEiiPPc[_Z27feature_extraction_pipelineIfEiiPPc]+0xf9): undefined reference tocaffe::Net::Net(std::string const&, caffe::Phase, caffe::Net const_)'
collect2: error: ld returned 1 exit status
make: *_* [.build_release/tools/extract_features.bin] Error 1
.build_release/tools/upgrade_solver_proto_text.o: In function main': upgrade_solver_proto_text.cpp:(.text.startup+0x191): undefined reference tocaffe::SolverNeedsTypeUpgrade(caffe::SolverParameter const&)'
upgrade_solver_proto_text.cpp:(.text.startup+0x1a0): undefined reference to `caffe::UpgradeSolverAsNeeded(std::string const&, caffe::SolverParameter_)'
collect2: error: ld returned 1 exit status
make: *_* [.build_release/tools/upgrade_solver_proto_text.bin] Error 1

—
Reply to this email directly or view it on GitHub
https://github.com/BVLC/caffe/issues/3396.

Hi, James
How do you solve this problem? I have just meet the same problem

Hi,
I am getting the same problem. How did you resolve it?

I had the same problem too.

hi, i am getting the same problem on ubuntu 15.10. How did you resolve it?

getting the same error ? any solution to this issue

:( same problem. Why no solution?

Check if you already have caffe installed somewhere. It seems like it's trying to linking something else.

thanks, @minghuam . It works.

More information please

@mittlin, how do you solve it based on @minghuam clue? thanks.

@mrasyid , for me, just rm /usr/local/lib/libcaffe.*

@mittlin, thanks! I'll try it!

@mittlin, it works! thanks a lot!

For those without root authority, it is convenient to add _./build/lib_ ahead of default libcaffe.* locations(usually _/usr/local/lib_), when setting _LIBRARY_DIRS_

Hello everyone,
it is also work for this error

.build_release/tools/compute_image_mean.o: In function main': compute_image_mean.cpp:(.text.startup+0x32d): undefined reference tocaffe::DecodeDatumNative(caffe::Datum)'
compute_image_mean.cpp:(.text.startup+0x509): undefined reference to caffe::DecodeDatumNative(caffe::Datum*)' .collect2: error: ld returned 1 exit status build_release/tools/convert_imageset.o: In functionmain':
convert_imageset.cpp:(.text.startup+0xaaa): undefined reference to caffe::ReadImageToDatum(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int, int, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, caffe::Datum*)' Makefile:616: recipe for target '.build_release/tools/compute_image_mean.bin' failed make: *** [.build_release/tools/compute_image_mean.bin] Error 1 make: *** Waiting for unfinished jobs.... CXX/LD -o .build_release/examples/mnist/convert_mnist_data.bin collect2: error: ld returned 1 exit status .build_release/tools/extract_features.o: In functionint feature_extraction_pipeline(int, char)':
extract_features.cpp:(.text._Z27feature_extraction_pipelineIfEiiPPc[_Z27feature_extraction_pipelineIfEiiPPc]+0x165): undefined reference to caffe::Net<float>::Net(std::__cxx11::basic_string<Makefile:616: recipe for target '.build_release/tools/convert_imageset.bin' failed char, stdmake: *** [.build_release/tools/convert_imageset.bin] Error 1 ::char_traits<char>, std::allocator<char> > const&, caffe::Phase, int, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const*, caffe::Net<float> const*)' collect2: error: ld returned 1 exit status Makefile:616: recipe for target '.build_release/tools/extract_features.bin' failed make: *** [.build_release/tools/extract_features.bin] Error 1 .build_release/tools/caffe.o: In functiontest()':
caffe.cpp:(.text+0x15e3): undefined reference to caffe::Net<float>::Net(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, caffe::Phase, int, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const*, caffe::Net<float> const*)' .build_release/tools/caffe.o: In functiontrain()':
caffe.cpp:(.text+0x2edf): undefined reference to caffe::P2PSync<float>::P2PSync(boost::shared_ptr<caffe::Solver<float> >, caffe::P2PSync<float>*, caffe::SolverParameter const&)' caffe.cpp:(.text+0x2f0c): undefined reference tocaffe::P2PSync::Run(std::vector > const&)'
caffe.cpp:(.text+0x2f14): undefined reference to caffe::P2PSync<float>::~P2PSync()' caffe.cpp:(.text+0x434a): undefined reference tocaffe::P2PSync::~P2PSync()'
caffe.cpp:(.text+0x4479): undefined reference to caffe::P2PSync<float>::~P2PSync()' .build_release/tools/caffe.o: In functiontime()':
caffe.cpp:(.text+0x45f3): undefined reference to caffe::Net<float>::Net(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, caffe::Phase, int, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const*, caffe::Net<float> const*)' caffe.cpp:(.text+0x496c): undefined reference tocaffe::Layer::Lock()'
caffe.cpp:(.text+0x4a6d): undefined reference to caffe::Layer<float>::Unlock()' collect2: error: ld returned 1 exit status Makefile:616: recipe for target '.build_release/tools/caffe.bin' failed make: *** [.build_release/tools/caffe.bin] Error 1 .build_release/examples/cpp_classification/classification.o: In functionClassifier::Classifier(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)':
classification.cpp:(.text+0x3d4a): undefined reference to `caffe::Net::Net(std::__cxx11::basic_string, std::allocator > const&, caffe::Phase, int, std::vector, std::allocator >, std::allocator, std::allocator > > > const
, caffe::Net const*)'
collect2: error: ld returned 1 exit status
Makefile:621: recipe for target '.build_release/examples/cpp_classification/classification.bin' failed
make: *
[.build_release/examples/cpp_classification/classification.bin] Error 1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

prathmeshrmadhu picture prathmeshrmadhu  Â·  3Comments

inferrna picture inferrna  Â·  3Comments

erogol picture erogol  Â·  3Comments

lixin7895123 picture lixin7895123  Â·  3Comments

LarsHH picture LarsHH  Â·  3Comments