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

Error when compiling caffe for debug purpose #3814

Open
JackieTseng opened this issue Mar 14, 2016 · 5 comments
Open

Error when compiling caffe for debug purpose #3814

JackieTseng opened this issue Mar 14, 2016 · 5 comments

Comments

@JackieTseng
Copy link

I want to debug caffe using gdb. Then I set DEBUG=1 in Makefile.config. However during compiling, I met these problems and don't know how to solve. Some solutions online can't work. If anyone when can help, thanks very much.

CXX src/caffe/syncedmem.cpp
CXX src/caffe/solver.cpp
CXX src/caffe/net.cpp
CXX src/caffe/data_transformer.cpp
AR -o .build_debug/lib/libcaffe.a
LD -o .build_debug/lib/libcaffe.so
CXX tools/upgrade_net_proto_text.cpp
CXX/LD -o .build_debug/tools/upgrade_net_proto_text.bin
//usr/lib/x86_64-linux-gnu/libunwind.so.8: undefined reference to `lzma_index_size@XZ_5.0'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `TIFFIsTiled@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libunwind.so.8: undefined reference to `lzma_stream_footer_decode@XZ_5.0'
//usr/lib/x86_64-linux-gnu/libunwind.so.8: undefined reference to `lzma_index_uncompressed_size@XZ_5.0'
//usr/lib/x86_64-linux-gnu/libunwind.so.8: undefined reference to `lzma_stream_buffer_decode@XZ_5.0'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `TIFFOpen@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `TIFFReadEncodedStrip@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `TIFFSetField@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `TIFFWriteScanline@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libunwind.so.8: undefined reference to `lzma_index_buffer_decode@XZ_5.0'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `TIFFGetField@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `TIFFScanlineSize@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `TIFFSetWarningHandler@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libunwind.so.8: undefined reference to `lzma_index_end@XZ_5.0'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `TIFFSetErrorHandler@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `TIFFReadEncodedTile@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `TIFFReadRGBATile@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `TIFFClose@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `TIFFRGBAImageOK@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `TIFFReadRGBAStrip@LIBTIFF_4.0'
collect2: error: ld returned 1 exit status
make: *** [.build_debug/tools/upgrade_net_proto_text.bin] Error 1

I use ldconfig -p | grep lzma command:

liblzma.so.5 (libc6,x86-64) => /lib/x86_64-linux-gnu/liblzma.so.5
liblzma.so.5 (libc6,x86-64) => /home/jackie/anaconda2/lib/liblzma.so.5
liblzma.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/liblzma.so
liblzma.so (libc6,x86-64) => /home/jackie/anaconda2/lib/liblzma.so

And my bashrc:

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/jackie/anaconda2/lib"
export PATH="/home/jackie/anaconda2/bin:$PATH"
export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7
@leoshine
Copy link

Suggestions:
2 things worth to try:
In ~/.bashrc file :
(1) export LD_LIBRARY_PATH="/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH"
(2) comment out export PATH="/home/jackie/anaconda2/bin:$PATH".
Explain: Sometime cmake will try to find library dependency base on python execute (/home/jackie/anaconda2/bin/). This will cause some ananconda's 3-rd library sneak in while linking.

P.S. It is also good to use "make VERBOSE=1" to make the cmake project, which can show the gcc compiling command line.

@Sampson-Lee
Copy link

@uahsan3
Copy link

uahsan3 commented Aug 30, 2017

Hello,

I have the same linking error as OP and the error is not resolving with the following two steps:
(1) export LD_LIBRARY_PATH="/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH"
(2) comment out export PATH="/home/jackie/anaconda2/bin:$PATH"

My ldconfig -p | grep lzma shows:

liblzma.so.5 (libc6,x86-64) => /lib/x86_64-linux-gnu/liblzma.so.5
liblzma.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/liblzma.so

Any other suggestions for resolving this error?

Thank you

@briantse100
Copy link

hi, @uahsan3, do you solve the issue?

i have the same problem with you. And i also add the path /lib/x86_64-linux-gnu and /usr/lib/x86_64-linux-gnu to /etc/ld.so.conf, run ldconfig. But the issue still occurs.

@uahsan3
Copy link

uahsan3 commented Jan 25, 2018

@briantse100 I think I was not able to resolve this. Ultimately I ended up using Caffe on another machine because I could not afford to waste more time. Sorry about that.

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

5 participants