Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make caffe error #7

Open
BeSlower opened this issue Jun 16, 2016 · 3 comments
Open

Make caffe error #7

BeSlower opened this issue Jun 16, 2016 · 3 comments

Comments

@BeSlower
Copy link

BeSlower commented Jun 16, 2016

At first time when I make caffe, everything is good. Today when I try to make it again ( I did make clean before make), it shows following error.

AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so
CXX/LD -o .build_release/tools/device_query.bin
CXX/LD -o .build_release/tools/net_speed_benchmark.bin
CXX/LD -o .build_release/tools/convert_imageset.bin
CXX/LD -o .build_release/tools/convert_bboxset.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/compute_image_mean.bin
CXX/LD -o .build_release/tools/extract_features.bin
CXX/LD -o .build_release/tools/caffe.bin
CXX/LD -o .build_release/tools/upgrade_net_proto_binary.bin
CXX/LD -o .build_release/tools/convert_labelset.bin
CXX/LD -o .build_release/tools/upgrade_net_proto_text.bin
.build_release/tools/convert_bboxset.o: In function `void caffe::shuffle<__gnu_cxx::__normal_iterator<LineItem*, std::vector<LineItem, std::allocator<LineItem> > > >(__gnu_cxx::__normal_iterator<LineItem*, std::vector<LineItem, std::allocator<LineItem> > >, __gnu_cxx::__normal_iterator<LineItem*, std::vector<LineItem, std::allocator<LineItem> > >)':
convert_bboxset.cpp:(.text._ZN5caffe7shuffleIN9__gnu_cxx17__normal_iteratorIP8LineItemSt6vectorIS3_SaIS3_EEEEEEvT_S9_[_ZN5caffe7shuffleIN9__gnu_cxx17__normal_iteratorIP8LineItemSt6vectorIS3_SaIS3_EEEEEEvT_S9_]+0x14): undefined reference to `caffe::Caffe::singleton_'
.build_release/tools/convert_bboxset.o: In function `main':
convert_bboxset.cpp:(.text.startup+0xb14): undefined reference to `caffe::ReadImageToDatumResizeShortSide(std::string const&, int, int, int, int, int, int, bool, std::string const&, caffe::Datum*)'
convert_bboxset.cpp:(.text.startup+0xe2e): undefined reference to `caffe::ReadImageToDatum(std::string const&, int, int, int, int, int, int, int, int, int, bool, std::string const&, caffe::Datum*)'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/convert_bboxset.bin] Error 1
make: *** Waiting for unfinished jobs....
.build_release/tools/convert_imageset.o: In function `void caffe::shuffle<__gnu_cxx::__normal_iterator<std::pair<std::string, int>*, std::vector<std::pair<std::string, int>, std::allocator<std::pair<std::string, int> > > > >(__gnu_cxx::__normal_iterator<std::pair<std::string, int>*, std::vector<std::pair<std::string, int>, std::allocator<std::pair<std::string, int> > > >, __gnu_cxx::__normal_iterator<std::pair<std::string, int>*, std::vector<std::pair<std::string, int>, std::allocator<std::pair<std::string, int> > > >)':
convert_imageset.cpp:(.text._ZN5caffe7shuffleIN9__gnu_cxx17__normal_iteratorIPSt4pairISsiESt6vectorIS4_SaIS4_EEEEEEvT_SA_[_ZN5caffe7shuffleIN9__gnu_cxx17__normal_iteratorIPSt4pairISsiESt6vectorIS4_SaIS4_EEEEEEvT_SA_]+0x14): undefined reference to `caffe::Caffe::singleton_'
.build_release/tools/convert_imageset.o: In function `main':
convert_imageset.cpp:(.text.startup+0x7ff): undefined reference to `caffe::ReadImageToDatumResizeShortSide(std::string const&, int, int, int, int, int, int, bool, std::string const&, caffe::Datum*)'
convert_imageset.cpp:(.text.startup+0xc98): undefined reference to `caffe::ReadImageToDatum(std::string const&, int, int, int, int, int, int, int, int, int, bool, std::string const&, caffe::Datum*)'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/convert_imageset.bin] Error 1
.build_release/tools/extract_features.o: In function `caffe::Caffe::Get()':
extract_features.cpp:(.text._ZN5caffe5Caffe3GetEv[_ZN5caffe5Caffe3GetEv]+0x7): undefined reference to `caffe::Caffe::singleton_'
.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]+0xcd): undefined reference to `caffe::Caffe::singleton_'
extract_features.cpp:(.text._Z27feature_extraction_pipelineIfEiiPPc[_Z27feature_extraction_pipelineIfEiiPPc]+0x148): undefined reference to `caffe::Net<float>::Net(std::string const&, caffe::Phase)'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/extract_features.bin] Error 1
.build_release/tools/convert_labelset.o: In function `void caffe::shuffle<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > >(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >)':
convert_labelset.cpp:(.text._ZN5caffe7shuffleIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEEvT_S8_[_ZN5caffe7shuffleIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEEvT_S8_]+0x17): undefined reference to `caffe::Caffe::singleton_'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/convert_labelset.bin] Error 1
.build_release/tools/caffe.o: In function `test()':
caffe.cpp:(.text+0xa6d): undefined reference to `caffe::Net<float>::Net(std::string const&, caffe::Phase)'
.build_release/tools/caffe.o: In function `time()':
caffe.cpp:(.text+0x1b6b): undefined reference to `caffe::Net<float>::Net(std::string const&, caffe::Phase)'
caffe.cpp:(.text+0x1c9e): undefined reference to `caffe::Net<float>::Backward(int)'
.build_release/tools/caffe.o: In function `caffe::Caffe::Get()':
caffe.cpp:(.text._ZN5caffe5Caffe3GetEv[_ZN5caffe5Caffe3GetEv]+0x7): undefined reference to `caffe::Caffe::singleton_'
.build_release/tools/caffe.o: In function `main':
caffe.cpp:(.text.startup+0x80): undefined reference to `caffe::GlobalFinalize()'
caffe.cpp:(.text.startup+0xea): undefined reference to `caffe::GlobalFinalize()'
.build_release/tools/caffe.o: In function `caffe::Solver<float>* caffe::GetSolver<float>(caffe::SolverParameter const&)':
caffe.cpp:(.text._ZN5caffe9GetSolverIfEEPNS_6SolverIT_EERKNS_15SolverParameterE[_ZN5caffe9GetSolverIfEEPNS_6SolverIT_EERKNS_15SolverParameterE]+0x3f): undefined reference to `caffe::Solver<float>::Solver(caffe::SolverParameter const&)'
caffe.cpp:(.text._ZN5caffe9GetSolverIfEEPNS_6SolverIT_EERKNS_15SolverParameterE[_ZN5caffe9GetSolverIfEEPNS_6SolverIT_EERKNS_15SolverParameterE]+0x14f): undefined reference to `caffe::Solver<float>::Solver(caffe::SolverParameter const&)'
caffe.cpp:(.text._ZN5caffe9GetSolverIfEEPNS_6SolverIT_EERKNS_15SolverParameterE[_ZN5caffe9GetSolverIfEEPNS_6SolverIT_EERKNS_15SolverParameterE]+0x1ff): undefined reference to `caffe::Solver<float>::Solver(caffe::SolverParameter const&)'
caffe.cpp:(.text._ZN5caffe9GetSolverIfEEPNS_6SolverIT_EERKNS_15SolverParameterE[_ZN5caffe9GetSolverIfEEPNS_6SolverIT_EERKNS_15SolverParameterE]+0x297): undefined reference to `caffe::Solver<float>::Solver(caffe::SolverParameter const&)'
caffe.cpp:(.text._ZN5caffe9GetSolverIfEEPNS_6SolverIT_EERKNS_15SolverParameterE[_ZN5caffe9GetSolverIfEEPNS_6SolverIT_EERKNS_15SolverParameterE]+0x33f): undefined reference to `caffe::Solver<float>::Solver(caffe::SolverParameter const&)'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/caffe.bin] Error 1

I cannot figure out the reason. Could you give me some suggestions? Thanks.

@Cysu
Copy link
Owner

Cysu commented Jun 19, 2016

It seems that some implementations cannot be found. For example, caffe::GlobalFinalize() should be implemented in src/caffe/common.cpp at here. Could you please check if this file is exactly the same as yours?

@BeSlower
Copy link
Author

I checked src/caffe/common.cpp. It is exactly same as yours. Since I use git clone from yours, it shouldn't be different at all.

@csgcmai
Copy link

csgcmai commented Jun 5, 2017

Hi there, I just came across this issue a few days ago. In my case, it is introduced by the libcaffe.so libcaffe.a linking error. This is because my server has been installed another version of caffe in the library path. And the Makefile finds the package from the system library path first and then the build library path.

You may try whether the change of the Makefile as below to solve the problem.

change the:
LIBRARY_DIRS += $(LIB_BUILD_DIR)
to:
LIBRARY_DIRS := $(LIB_BUILD_DIR) + $(LIBRARY_DIRS)

Hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants