1. Problem
[dashuage caffe-fast-rcnn]$ make
CXX/LD -o .build_release/examples/cifar10/convert_cifar_data.bin
/usr/bin/ld: warning: libhdf5_hl.so.100, needed by /usr/lib/libcaffe.so, may conflict with libhdf5_hl.so.10
/usr/bin/ld: warning: libhdf5.so.100, needed by /usr/lib/libcaffe.so, may conflict with libhdf5.so.10
/usr/bin/ld: .build_release/examples/cifar10/convert_cifar_data.o: undefined reference to symbol '_ZdlPvm'
/usr/lib/libtcmalloc.so.4: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:613: .build_release/examples/cifar10/convert_cifar_data.bin] Error 1
2. Analysis
When make, it does three things:
- make lib
- make tools
- make examples
This error occured when make the latter two objects.
Since there is another caffe installed already, we don’t really need to rebuild tools and examples. Use ln to link.
3. Solution
- Edit Makefile
#all: lib examples tools
all: lib
- make all
- set link
#!/bin/bash
cd build/tools/
ln -s /usr/bin/caffe caffe
ln -s /usr/bin/compute_image_mean compute_image_mean
ln -s /usr/bin/convert_imageset convert_imageset
ln -s /usr/bin/device_query device_query
ln -s /usr/bin/extract_features extract_features
ln -s /usr/bin/finetune_net finetune_net
ln -s /usr/bin/net_speed_benchmark net_speed_benchmark
ln -s /usr/bin/test_net test_net
ln -s /usr/bin/train_net train_net
ln -s /usr/bin/upgrade_net_proto_binary upgrade_net_proto_binary
ln -s /usr/bin/upgrade_net_proto_text upgrade_net_proto_text
ln -s /usr/bin/upgrade_solver_proto_text upgrade_solver_proto_text
cd ../examples
ln -s /usr/bin/convert_cifar_data ./cifar10/convert_cifar_data.bin
ln -s /usr/bin/classification ./cpp_classification/classification.bin
ln -s /usr/bin/convert_mnist_data ./mnist/convert_mnist_data.bin
ln -s /usr/bin/convert_mnist_siamese_data ./siamese/convert_mnist_siamese_data.bin