caffe
caffe copied to clipboard
Build error - undefined reference to symbol 'pthread_rwlock_wrlock@@GLIBC_2.2.5'
I'm trying to use this dockerfile to build and getting the following errors:
/usr/bin/g++-4.6 .build_release/examples/mnist/convert_mnist_data.o .build_release/lib/libcaffe.a -o .build_release/examples/mnist/convert_mnist_data.bin -fPIC -DNDEBUG -O2 -DCPU_ONLY -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 -Wall -Wno-sign-compare -L/usr/lib -L/usr/local/lib -L/usr/lib -lpthread -lglog -lgflags -lprotobuf -lleveldb -lsnappy -llmdb -lboost_system -lhdf5_hl -lhdf5 -lopencv_core -lopencv_highgui -lopencv_imgproc -lboost_thread -lcblas -latlas
[91m/[0m
[91musr/bin/ld: /usr/local/lib/libgflags.a(gflags.cc.o): [0m
[91mundefined reference to symbol 'pthread_rwlock_wrlock@@GLIBC_2.2.5'
/lib/x86_64-linux-gnu/libpthread.so.0[0m
[91m: error adding symbols: DSO missing from command line
[0m
[91mcollect2: [0m
[91mld returned 1 exit status[0m
[91m
[0m
[91mmake: *** [.build_release/examples/mnist/convert_mnist_data.bin] Error 1
[0m
The command [/bin/sh -c cd /opt/caffe && make all] returned a non-zero code: 2
On previous versions of caffe (commit 4288b2b5fc1fea600a336fc56fbaacaae5c94877) this same dockerfile was working
Any idea what is causing this build error?
I think you can just move the -lpthread to the end of the list of libraries to fix this.
@mauinz thanks! That fixed my problem. Just sent a PR.
Fixed in master by #1332 and in dev in #1179.