caffe icon indicating copy to clipboard operation
caffe copied to clipboard

Ld error while make test on OS X

Open yutkin opened this issue 10 years ago • 7 comments

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?

yutkin avatar Mar 06 '16 09:03 yutkin

+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.

jt86 avatar Mar 09 '16 10:03 jt86

Can you do ldd xyz.so and post that?

ldmtwo avatar Mar 10 '16 20:03 ldmtwo

@yutkin on OS X the equivalent tool is otool -L

shelhamer avatar Mar 10 '16 21:03 shelhamer

@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)

yutkin avatar Mar 10 '16 21:03 yutkin

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 ?

D-X-Y avatar Apr 02 '16 12:04 D-X-Y

Me too, May I ask have you fixed this issue?

westtalkzzz avatar Aug 25 '16 13:08 westtalkzzz

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.

shelhamer avatar Apr 13 '17 02:04 shelhamer