Ld error while make test on OS X
I'm trying to compile PR https://github.com/BVLC/caffe/pull/3575/. During make all were some odd warnings but no errors occurred.
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .build_release/lib/libcaffe.a(cudnn_conv_layer.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .build_release/lib/libcaffe.a(cudnn_lcn_layer.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .build_release/lib/libcaffe.a(cudnn_lrn_layer.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .build_release/lib/libcaffe.a(cudnn_pooling_layer.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .build_release/lib/libcaffe.a(cudnn_relu_layer.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .build_release/lib/libcaffe.a(cudnn_sigmoid_layer.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .build_release/lib/libcaffe.a(cudnn_softmax_layer.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .build_release/lib/libcaffe.a(cudnn_tanh_layer.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .build_release/lib/libcaffe.a(cudnn.o) has no symbols
During make test errors occurred:
LD .build_release/src/caffe/test/test_batch_norm_layer.o
Undefined symbols for architecture x86_64:
"non-virtual thunk to caffe::ImageDataLayer<double>::~ImageDataLayer()", referenced from:
vtable for caffe::ImageDataLayer<double> in test_image_data_layer.o
"non-virtual thunk to caffe::ImageDataLayer<double>::~ImageDataLayer()", referenced from:
vtable for caffe::ImageDataLayer<double> in test_image_data_layer.o
"non-virtual thunk to caffe::ImageDataLayer<float>::~ImageDataLayer()", referenced from:
vtable for caffe::ImageDataLayer<float> in test_image_data_layer.o
"non-virtual thunk to caffe::ImageDataLayer<float>::~ImageDataLayer()", referenced from:
vtable for caffe::ImageDataLayer<float> in test_image_data_layer.o
"non-virtual thunk to caffe::BasePrefetchingDataLayer<double>::InternalThreadEntry()", referenced from:
vtable for caffe::ImageDataLayer<double> in test_image_data_layer.o
"non-virtual thunk to caffe::BasePrefetchingDataLayer<float>::InternalThreadEntry()", referenced from:
vtable for caffe::ImageDataLayer<float> in test_image_data_layer.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [.build_release/test/test_all.testbin] Error 1
make: *** Waiting for unfinished jobs....
LD .build_release/src/caffe/test/test_batch_reindex_layer.o
Does someone has any idea?
+1 I have the exact same issue. Attempted to build this old commit, as discussed here. Make all completes, but make test produces the above errors.
Can you do ldd xyz.so and post that?
@yutkin on OS X the equivalent tool is otool -L
@ldmtwo @shelhamer
otool -L xyz.so
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool: can't open file: xyz.so (No such file or directory)
Me too, May I ask have you fixed this issue? I also got this warning.. It seems we should change the Makefile. /usr/local/include/glog/logging.h:917:30: note: expanded from macro 'LOG_EVERY_N' INVALID_REQUESTED_LOG_SEVERITY);
Does anyone know how to prevent these warnings on OSX ?
Me too, May I ask have you fixed this issue?
From https://github.com/BVLC/caffe/blob/master/CONTRIBUTING.md:
Please do not post usage, installation, or modeling questions, or other requests for help to Issues. Use the caffe-users list instead. This helps developers maintain a clear, uncluttered, and efficient view of the state of Caffe.