Caffe: Unable to make caffe on MacOS 10.9

Created on 12 Apr 2015  ·  9Comments  ·  Source: BVLC/caffe

MacOS 10.9, Cuda 6.5, Opencv 3.0, Anaconda
In Opencv 2.4.11 I was facing similar problem, solution was including library opencv_imgcodecs. But this was available only in opencv 3.0. But even after installing opencv 3.0.. I am getting same error, although in a different part. Any help appreciated.

It might seem there is a problem with leveldb, but all the environment variables in leveldb have -stdlib=libstdc++. So i can't figure out the problem.

PROTOC src/caffe/proto/caffe.proto
CXX src/caffe/blob.cpp
CXX src/caffe/common.cpp
CXX src/caffe/data_transformer.cpp
CXX src/caffe/internal_thread.cpp
CXX src/caffe/layer_factory.cpp
CXX src/caffe/layers/absval_layer.cpp
CXX src/caffe/layers/accuracy_layer.cpp
CXX src/caffe/layers/argmax_layer.cpp
CXX src/caffe/layers/base_conv_layer.cpp
CXX src/caffe/layers/base_data_layer.cpp
CXX src/caffe/layers/bnll_layer.cpp
CXX src/caffe/layers/concat_layer.cpp
CXX src/caffe/layers/contrastive_loss_layer.cpp
CXX src/caffe/layers/conv_layer.cpp
CXX src/caffe/layers/cudnn_conv_layer.cpp
CXX src/caffe/layers/cudnn_pooling_layer.cpp
CXX src/caffe/layers/cudnn_relu_layer.cpp
CXX src/caffe/layers/cudnn_sigmoid_layer.cpp
CXX src/caffe/layers/cudnn_softmax_layer.cpp
CXX src/caffe/layers/cudnn_tanh_layer.cpp
CXX src/caffe/layers/data_layer.cpp
CXX src/caffe/layers/deconv_layer.cpp
CXX src/caffe/layers/dropout_layer.cpp
CXX src/caffe/layers/dummy_data_layer.cpp
CXX src/caffe/layers/eltwise_layer.cpp
CXX src/caffe/layers/euclidean_loss_layer.cpp
CXX src/caffe/layers/exp_layer.cpp
CXX src/caffe/layers/flatten_layer.cpp
CXX src/caffe/layers/hdf5_data_layer.cpp
CXX src/caffe/layers/hdf5_output_layer.cpp
CXX src/caffe/layers/hinge_loss_layer.cpp
CXX src/caffe/layers/im2col_layer.cpp
CXX src/caffe/layers/image_data_layer.cpp
CXX src/caffe/layers/infogain_loss_layer.cpp
CXX src/caffe/layers/inner_product_layer.cpp
CXX src/caffe/layers/loss_layer.cpp
CXX src/caffe/layers/lrn_layer.cpp
CXX src/caffe/layers/memory_data_layer.cpp
CXX src/caffe/layers/multinomial_logistic_loss_layer.cpp
CXX src/caffe/layers/mvn_layer.cpp
CXX src/caffe/layers/neuron_layer.cpp
CXX src/caffe/layers/pooling_layer.cpp
CXX src/caffe/layers/power_layer.cpp
CXX src/caffe/layers/prelu_layer.cpp
CXX src/caffe/layers/relu_layer.cpp
CXX src/caffe/layers/sigmoid_cross_entropy_loss_layer.cpp
CXX src/caffe/layers/sigmoid_layer.cpp
CXX src/caffe/layers/silence_layer.cpp
CXX src/caffe/layers/slice_layer.cpp
CXX src/caffe/layers/softmax_layer.cpp
CXX src/caffe/layers/softmax_loss_layer.cpp
CXX src/caffe/layers/split_layer.cpp
CXX src/caffe/layers/tanh_layer.cpp
CXX src/caffe/layers/threshold_layer.cpp
CXX src/caffe/layers/window_data_layer.cpp
CXX src/caffe/net.cpp
CXX src/caffe/solver.cpp
CXX src/caffe/syncedmem.cpp
CXX src/caffe/util/benchmark.cpp
CXX src/caffe/util/cudnn.cpp
CXX src/caffe/util/db.cpp
CXX src/caffe/util/im2col.cpp
CXX src/caffe/util/insert_splits.cpp
CXX src/caffe/util/io.cpp
CXX src/caffe/util/math_functions.cpp
CXX src/caffe/util/upgrade_proto.cpp
NVCC src/caffe/layers/absval_layer.cu
NVCC src/caffe/layers/base_data_layer.cu
NVCC src/caffe/layers/bnll_layer.cu
NVCC src/caffe/layers/concat_layer.cu
NVCC src/caffe/layers/contrastive_loss_layer.cu
NVCC src/caffe/layers/conv_layer.cu
NVCC src/caffe/layers/cudnn_conv_layer.cu
NVCC src/caffe/layers/cudnn_pooling_layer.cu
NVCC src/caffe/layers/cudnn_relu_layer.cu
NVCC src/caffe/layers/cudnn_sigmoid_layer.cu
NVCC src/caffe/layers/cudnn_softmax_layer.cu
NVCC src/caffe/layers/cudnn_tanh_layer.cu
NVCC src/caffe/layers/deconv_layer.cu
NVCC src/caffe/layers/dropout_layer.cu
NVCC src/caffe/layers/eltwise_layer.cu
NVCC src/caffe/layers/euclidean_loss_layer.cu
NVCC src/caffe/layers/exp_layer.cu
NVCC src/caffe/layers/hdf5_data_layer.cu
NVCC src/caffe/layers/hdf5_output_layer.cu
NVCC src/caffe/layers/im2col_layer.cu
NVCC src/caffe/layers/inner_product_layer.cu
NVCC src/caffe/layers/lrn_layer.cu
NVCC src/caffe/layers/mvn_layer.cu
NVCC src/caffe/layers/pooling_layer.cu
NVCC src/caffe/layers/power_layer.cu
NVCC src/caffe/layers/prelu_layer.cu
NVCC src/caffe/layers/relu_layer.cu
NVCC src/caffe/layers/sigmoid_cross_entropy_loss_layer.cu
NVCC src/caffe/layers/sigmoid_layer.cu
NVCC src/caffe/layers/silence_layer.cu
NVCC src/caffe/layers/slice_layer.cu
NVCC src/caffe/layers/softmax_layer.cu
NVCC src/caffe/layers/softmax_loss_layer.cu
NVCC src/caffe/layers/split_layer.cu
NVCC src/caffe/layers/tanh_layer.cu
NVCC src/caffe/layers/threshold_layer.cu
NVCC src/caffe/util/im2col.cu
NVCC src/caffe/util/math_functions.cu
CXX tools/caffe.cpp
CXX tools/compute_image_mean.cpp
CXX tools/convert_imageset.cpp
CXX tools/device_query.cpp
CXX tools/extract_features.cpp
CXX tools/finetune_net.cpp
CXX tools/net_speed_benchmark.cpp
CXX tools/test_net.cpp
CXX tools/train_net.cpp
CXX tools/upgrade_net_proto_binary.cpp
CXX tools/upgrade_net_proto_text.cpp
CXX examples/cifar10/convert_cifar_data.cpp
CXX examples/mnist/convert_mnist_data.cpp
CXX examples/siamese/convert_mnist_siamese_data.cpp
CXX .build_release/src/caffe/proto/caffe.pb.cc
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so
clang: warning: argument unused during compilation: '-pthread'
ld: warning: directory not found for option '-L/opt/intel/mkl/lib/intel64'
Undefined symbols for architecture x86_64:
"leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB*_)", referenced from:
caffe::db::LevelDB::Open(std::string const&, caffe::db::Mode) in db.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/lib/libcaffe.so] Error 1

Most helpful comment

I have the same problem, I tried every method but it is no work; my error log as bellow:
MacOS 10.12.6, Opencv 2.7.14.0, Cuda and Anaconda is the latest version, I do not known how to
get the Cuda and Anaconda version

➜  caffe git:(master) make all -j4
PROTOC src/caffe/proto/caffe.proto
CXX src/caffe/blob.cpp
CXX src/caffe/common.cpp
CXX src/caffe/data_transformer.cpp
CXX src/caffe/internal_thread.cpp
CXX src/caffe/layer.cpp
CXX src/caffe/layer_factory.cpp
CXX src/caffe/layers/absval_layer.cpp
CXX src/caffe/layers/accuracy_layer.cpp
CXX src/caffe/layers/argmax_layer.cpp
CXX src/caffe/layers/base_conv_layer.cpp
CXX src/caffe/layers/base_data_layer.cpp
CXX src/caffe/layers/batch_norm_layer.cpp
CXX src/caffe/layers/batch_reindex_layer.cpp
CXX src/caffe/layers/bias_layer.cpp
CXX src/caffe/layers/bnll_layer.cpp
CXX src/caffe/layers/concat_layer.cpp
CXX src/caffe/layers/contrastive_loss_layer.cpp
CXX src/caffe/layers/conv_layer.cpp
CXX src/caffe/layers/crop_layer.cpp
CXX src/caffe/layers/cudnn_conv_layer.cpp
CXX src/caffe/layers/cudnn_lcn_layer.cpp
CXX src/caffe/layers/cudnn_lrn_layer.cpp
CXX src/caffe/layers/cudnn_pooling_layer.cpp
CXX src/caffe/layers/cudnn_relu_layer.cpp
CXX src/caffe/layers/cudnn_sigmoid_layer.cpp
CXX src/caffe/layers/cudnn_softmax_layer.cpp
CXX src/caffe/layers/cudnn_tanh_layer.cpp
CXX src/caffe/layers/data_layer.cpp
CXX src/caffe/layers/deconv_layer.cpp
CXX src/caffe/layers/dropout_layer.cpp
In file included from src/caffe/layers/crop_layer.cpp:10:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/layers/dummy_data_layer.cpp
CXX src/caffe/layers/eltwise_layer.cpp
CXX src/caffe/layers/elu_layer.cpp
CXX src/caffe/layers/embed_layer.cpp
CXX src/caffe/layers/euclidean_loss_layer.cpp
CXX src/caffe/layers/exp_layer.cpp
CXX src/caffe/layers/filter_layer.cpp
CXX src/caffe/layers/flatten_layer.cpp
CXX src/caffe/layers/hdf5_data_layer.cpp
CXX src/caffe/layers/hdf5_output_layer.cpp
CXX src/caffe/layers/hinge_loss_layer.cpp
CXX src/caffe/layers/im2col_layer.cpp
CXX src/caffe/layers/image_data_layer.cpp
CXX src/caffe/layers/infogain_loss_layer.cpp
CXX src/caffe/layers/inner_product_layer.cpp
CXX src/caffe/layers/input_layer.cpp
CXX src/caffe/layers/log_layer.cpp
CXX src/caffe/layers/loss_layer.cpp
CXX src/caffe/layers/lrn_layer.cpp
CXX src/caffe/layers/lstm_layer.cpp
CXX src/caffe/layers/lstm_unit_layer.cpp
CXX src/caffe/layers/memory_data_layer.cpp
CXX src/caffe/layers/multinomial_logistic_loss_layer.cpp
In file included from src/caffe/layers/lstm_layer.cpp:8:
In file included from ./include/caffe/layers/lstm_layer.hpp:11:
In file included from ./include/caffe/layers/recurrent_layer.hpp:11:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/layers/mvn_layer.cpp
In file included from src/caffe/layers/lstm_unit_layer.cpp:6:
In file included from ./include/caffe/layers/lstm_layer.hpp:11:
In file included from ./include/caffe/layers/recurrent_layer.hpp:11:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/layers/neuron_layer.cpp
CXX src/caffe/layers/parameter_layer.cpp
CXX src/caffe/layers/pooling_layer.cpp
CXX src/caffe/layers/power_layer.cpp
CXX src/caffe/layers/prelu_layer.cpp
CXX src/caffe/layers/recurrent_layer.cpp
CXX src/caffe/layers/reduction_layer.cpp
CXX src/caffe/layers/relu_layer.cpp
CXX src/caffe/layers/reshape_layer.cpp
In file included from src/caffe/layers/recurrent_layer.cpp:8:
In file included from ./include/caffe/layers/recurrent_layer.hpp:11:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/layers/rnn_layer.cpp
CXX src/caffe/layers/scale_layer.cpp
CXX src/caffe/layers/sigmoid_cross_entropy_loss_layer.cpp
CXX src/caffe/layers/sigmoid_layer.cpp
In file included from src/caffe/layers/rnn_layer.cpp:8:
In file included from ./include/caffe/layers/rnn_layer.hpp:11:
In file included from ./include/caffe/layers/recurrent_layer.hpp:11:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/layers/silence_layer.cpp
CXX src/caffe/layers/slice_layer.cpp
CXX src/caffe/layers/softmax_layer.cpp
CXX src/caffe/layers/softmax_loss_layer.cpp
CXX src/caffe/layers/split_layer.cpp
CXX src/caffe/layers/spp_layer.cpp
CXX src/caffe/layers/tanh_layer.cpp
CXX src/caffe/layers/threshold_layer.cpp
CXX src/caffe/layers/tile_layer.cpp
CXX src/caffe/layers/window_data_layer.cpp
CXX src/caffe/net.cpp
CXX src/caffe/parallel.cpp
CXX src/caffe/solver.cpp
CXX src/caffe/solvers/adadelta_solver.cpp
In file included from src/caffe/solvers/adadelta_solver.cpp:3:
In file included from ./include/caffe/sgd_solvers.hpp:7:
In file included from ./include/caffe/solver.hpp:7:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/solvers/adagrad_solver.cpp
CXX src/caffe/solvers/adam_solver.cpp
In file included from src/caffe/solver.cpp:6:
In file included from ./include/caffe/solver.hpp:7:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/solvers/nesterov_solver.cpp
In file included from src/caffe/net.cpp:12:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
src/caffe/net.cpp:557:3: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
  LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: Forward(bottom, loss) "
  ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
2 warnings generated.
CXX src/caffe/solvers/rmsprop_solver.cpp
In file included from src/caffe/solvers/adagrad_solver.cpp:3:
In file included from ./include/caffe/sgd_solvers.hpp:7:
In file included from ./include/caffe/solver.hpp:7:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/solvers/sgd_solver.cpp
In file included from src/caffe/solvers/adam_solver.cpp:3:
In file included from ./include/caffe/sgd_solvers.hpp:7:
In file included from ./include/caffe/solver.hpp:7:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/syncedmem.cpp
In file included from src/caffe/solvers/nesterov_solver.cpp:3:
In file included from ./include/caffe/sgd_solvers.hpp:7:
In file included from ./include/caffe/solver.hpp:7:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/util/benchmark.cpp
CXX src/caffe/util/blocking_queue.cpp
In file included from src/caffe/solvers/rmsprop_solver.cpp:3:
In file included from ./include/caffe/sgd_solvers.hpp:7:
In file included from ./include/caffe/solver.hpp:7:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/util/cudnn.cpp
CXX src/caffe/util/db.cpp
CXX src/caffe/util/db_leveldb.cpp
CXX src/caffe/util/db_lmdb.cpp
In file included from src/caffe/solvers/sgd_solver.cpp:4:
In file included from ./include/caffe/sgd_solvers.hpp:7:
In file included from ./include/caffe/solver.hpp:7:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/util/hdf5.cpp
CXX src/caffe/util/im2col.cpp
CXX src/caffe/util/insert_splits.cpp
src/caffe/util/blocking_queue.cpp:49:7: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
      LOG_EVERY_N(INFO, 1000)<< log_on_wait;
      ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/util/io.cpp
CXX src/caffe/util/math_functions.cpp
CXX src/caffe/util/signal_handler.cpp
CXX src/caffe/util/upgrade_proto.cpp
CXX tools/caffe.cpp
CXX tools/compute_image_mean.cpp
In file included from src/caffe/util/signal_handler.cpp:7:
In file included from ./include/caffe/util/signal_handler.h:5:
In file included from ./include/caffe/solver.hpp:7:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX tools/convert_imageset.cpp
CXX tools/device_query.cpp
CXX tools/extract_features.cpp
CXX tools/finetune_net.cpp
CXX tools/net_speed_benchmark.cpp
In file included from tools/caffe.cpp:15:
In file included from ./include/caffe/caffe.hpp:12:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX tools/test_net.cpp
In file included from tools/finetune_net.cpp:1:
In file included from ./include/caffe/caffe.hpp:12:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX tools/train_net.cpp
In file included from tools/extract_features.cpp:9:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX tools/upgrade_net_proto_binary.cpp
In file included from tools/net_speed_benchmark.cpp:1:
In file included from ./include/caffe/caffe.hpp:12:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX tools/upgrade_net_proto_text.cpp
In file included from tools/test_net.cpp:1:
In file included from ./include/caffe/caffe.hpp:12:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX tools/upgrade_solver_proto_text.cpp
In file included from tools/train_net.cpp:1:
In file included from ./include/caffe/caffe.hpp:12:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX examples/cifar10/convert_cifar_data.cpp
In file included from tools/upgrade_net_proto_binary.cpp:10:
In file included from ./include/caffe/caffe.hpp:12:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX examples/cpp_classification/classification.cpp
In file included from tools/upgrade_net_proto_text.cpp:10:
In file included from ./include/caffe/caffe.hpp:12:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX examples/mnist/convert_mnist_data.cpp
CXX examples/siamese/convert_mnist_siamese_data.cpp
In file included from tools/upgrade_solver_proto_text.cpp:10:
In file included from ./include/caffe/caffe.hpp:12:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX .build_release/src/caffe/proto/caffe.pb.cc
In file included from examples/cpp_classification/classification.cpp:1:
In file included from ./include/caffe/caffe.hpp:12:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so.1.0.0
clang: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument]
/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(parallel.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
Undefined symbols for architecture x86_64:
  "cv::imread(cv::String const&, int)", referenced from:
      caffe::WindowDataLayer<float>::load_batch(caffe::Batch<float>*) in window_data_layer.o
      caffe::WindowDataLayer<double>::load_batch(caffe::Batch<double>*) in window_data_layer.o
      caffe::ReadImageToCVMat(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, int, bool) in io.o
  "cv::imdecode(cv::_InputArray const&, int)", referenced from:
      caffe::DecodeDatumToCVMatNative(caffe::Datum const&) in io.o
      caffe::DecodeDatumToCVMat(caffe::Datum const&, bool) in io.o
  "cv::imencode(cv::String const&, cv::_InputArray const&, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> >&, std::__1::vector<int, std::__1::allocator<int> > const&)", referenced from:
      caffe::ReadImageToDatum(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, int, int, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, caffe::Datum*) in io.o
  "leveldb::DB::Open(leveldb::Options const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, leveldb::DB**)", referenced from:
      caffe::db::LevelDB::Open(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, caffe::db::Mode) in db_leveldb.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/lib/libcaffe.so.1.0.0] Error 1
make: *** Waiting for unfinished jobs....

Any one can help me ?

All 9 comments

# enable pretty build (comment to see full commands)
Q ?= @

Please comment/remove the above line in Makefile.config and compile again. It will show you the arguments and options you use in clang command.

@tnarihi Thanks for the advice.
As I wasn't able to compile caffe with opencv 3. I reverted back to Opencv 2.4.11. And Cuda 7.0. Also all env flags have been reverted back to stdc++. Even now I am having similar problem. This is the command causing it-

/usr/bin/clang++ -shared -o .build_release/lib/libcaffe.so .build_release/src/caffe/proto/caffe.pb.o .build_release/src/caffe/blob.o .build_release/src/caffe/common.o .build_release/src/caffe/data_transformer.o .build_release/src/caffe/internal_thread.o .build_release/src/caffe/layer_factory.o .build_release/src/caffe/layers/absval_layer.o .build_release/src/caffe/layers/accuracy_layer.o .build_release/src/caffe/layers/argmax_layer.o .build_release/src/caffe/layers/base_conv_layer.o .build_release/src/caffe/layers/base_data_layer.o .build_release/src/caffe/layers/bnll_layer.o .build_release/src/caffe/layers/concat_layer.o .build_release/src/caffe/layers/contrastive_loss_layer.o .build_release/src/caffe/layers/conv_layer.o .build_release/src/caffe/layers/cudnn_conv_layer.o .build_release/src/caffe/layers/cudnn_pooling_layer.o .build_release/src/caffe/layers/cudnn_relu_layer.o .build_release/src/caffe/layers/cudnn_sigmoid_layer.o .build_release/src/caffe/layers/cudnn_softmax_layer.o .build_release/src/caffe/layers/cudnn_tanh_layer.o .build_release/src/caffe/layers/data_layer.o .build_release/src/caffe/layers/deconv_layer.o .build_release/src/caffe/layers/dropout_layer.o .build_release/src/caffe/layers/dummy_data_layer.o .build_release/src/caffe/layers/eltwise_layer.o .build_release/src/caffe/layers/euclidean_loss_layer.o .build_release/src/caffe/layers/exp_layer.o .build_release/src/caffe/layers/flatten_layer.o .build_release/src/caffe/layers/hdf5_data_layer.o .build_release/src/caffe/layers/hdf5_output_layer.o .build_release/src/caffe/layers/hinge_loss_layer.o .build_release/src/caffe/layers/im2col_layer.o .build_release/src/caffe/layers/image_data_layer.o .build_release/src/caffe/layers/infogain_loss_layer.o .build_release/src/caffe/layers/inner_product_layer.o .build_release/src/caffe/layers/loss_layer.o .build_release/src/caffe/layers/lrn_layer.o .build_release/src/caffe/layers/memory_data_layer.o .build_release/src/caffe/layers/multinomial_logistic_loss_layer.o .build_release/src/caffe/layers/mvn_layer.o .build_release/src/caffe/layers/neuron_layer.o .build_release/src/caffe/layers/pooling_layer.o .build_release/src/caffe/layers/power_layer.o .build_release/src/caffe/layers/prelu_layer.o .build_release/src/caffe/layers/relu_layer.o .build_release/src/caffe/layers/sigmoid_cross_entropy_loss_layer.o .build_release/src/caffe/layers/sigmoid_layer.o .build_release/src/caffe/layers/silence_layer.o .build_release/src/caffe/layers/slice_layer.o .build_release/src/caffe/layers/softmax_layer.o .build_release/src/caffe/layers/softmax_loss_layer.o .build_release/src/caffe/layers/split_layer.o .build_release/src/caffe/layers/tanh_layer.o .build_release/src/caffe/layers/threshold_layer.o .build_release/src/caffe/layers/window_data_layer.o .build_release/src/caffe/net.o .build_release/src/caffe/solver.o .build_release/src/caffe/syncedmem.o .build_release/src/caffe/util/benchmark.o .build_release/src/caffe/util/cudnn.o .build_release/src/caffe/util/db.o .build_release/src/caffe/util/im2col.o .build_release/src/caffe/util/insert_splits.o .build_release/src/caffe/util/io.o .build_release/src/caffe/util/math_functions.o .build_release/src/caffe/util/upgrade_proto.o .build_release/cuda/src/caffe/layers/absval_layer.o .build_release/cuda/src/caffe/layers/base_data_layer.o .build_release/cuda/src/caffe/layers/bnll_layer.o .build_release/cuda/src/caffe/layers/concat_layer.o .build_release/cuda/src/caffe/layers/contrastive_loss_layer.o .build_release/cuda/src/caffe/layers/conv_layer.o .build_release/cuda/src/caffe/layers/cudnn_conv_layer.o .build_release/cuda/src/caffe/layers/cudnn_pooling_layer.o .build_release/cuda/src/caffe/layers/cudnn_relu_layer.o .build_release/cuda/src/caffe/layers/cudnn_sigmoid_layer.o .build_release/cuda/src/caffe/layers/cudnn_softmax_layer.o .build_release/cuda/src/caffe/layers/cudnn_tanh_layer.o .build_release/cuda/src/caffe/layers/deconv_layer.o .build_release/cuda/src/caffe/layers/dropout_layer.o .build_release/cuda/src/caffe/layers/eltwise_layer.o .build_release/cuda/src/caffe/layers/euclidean_loss_layer.o .build_release/cuda/src/caffe/layers/exp_layer.o .build_release/cuda/src/caffe/layers/hdf5_data_layer.o .build_release/cuda/src/caffe/layers/hdf5_output_layer.o .build_release/cuda/src/caffe/layers/im2col_layer.o .build_release/cuda/src/caffe/layers/inner_product_layer.o .build_release/cuda/src/caffe/layers/lrn_layer.o .build_release/cuda/src/caffe/layers/mvn_layer.o .build_release/cuda/src/caffe/layers/pooling_layer.o .build_release/cuda/src/caffe/layers/power_layer.o .build_release/cuda/src/caffe/layers/prelu_layer.o .build_release/cuda/src/caffe/layers/relu_layer.o .build_release/cuda/src/caffe/layers/sigmoid_cross_entropy_loss_layer.o .build_release/cuda/src/caffe/layers/sigmoid_layer.o .build_release/cuda/src/caffe/layers/silence_layer.o .build_release/cuda/src/caffe/layers/slice_layer.o .build_release/cuda/src/caffe/layers/softmax_layer.o .build_release/cuda/src/caffe/layers/softmax_loss_layer.o .build_release/cuda/src/caffe/layers/split_layer.o .build_release/cuda/src/caffe/layers/tanh_layer.o .build_release/cuda/src/caffe/layers/threshold_layer.o .build_release/cuda/src/caffe/util/im2col.o .build_release/cuda/src/caffe/util/math_functions.o -pthread -fPIC -DGTEST_USE_OWN_TR1_TUPLE=1 -DNDEBUG -O2 -DUSE_CUDNN -DWITH_PYTHON_LAYER -DUSE_MKL -I/Users/deepsamal/anaconda/include -I/Users/deepsamal/anaconda/include/python2.7 -I/Users/deepsamal/anaconda/lib/python2.7/site-packages/numpy/core/include -I/usr/local/include -I/Users/deepsamal/Desktop/Research/cudnn-6.5-osx-v2 -I.build_release/src -I./src -I./include -I/usr/local/cuda/include -I/opt/intel/mkl/include -Wall -Wno-sign-compare -Wno-unneeded-internal-declaration -L/Users/deepsamal/anaconda/lib -L/usr/local/lib -L/usr/lib -L/Users/deepsamal/Desktop/Research/cudnn-6.5-osx-v2 -L/usr/local/cuda/lib -L/opt/intel/mkl/lib -L.build_release/lib -lcudart -lcublas -lcurand -lglog -lgflags -lprotobuf -lleveldb -lsnappy -llmdb -lboost_system -lhdf5_hl -lhdf5 -lm -lopencv_core -lopencv_highgui -lopencv_imgproc -lpthread -lboost_thread-mt -lcudnn -lboost_python -lpython2.7 -lmkl_rt -install_name @rpath/libcaffe.so

clang: warning: argument unused during compilation: '-pthread'
Undefined symbols for architecture x86_64:
"google::protobuf::MessageLite::ParseFromString(std::__1::basic_string, std::__1::allocator > const&)", referenced from:
caffe::DataLayer::DataLayerSetUp(std::__1::vectorcaffe::Blob > const&, std::__1::vectorcaffe::Blob > const&) in data_layer.o
caffe::DataLayer::InternalThreadEntry() in data_layer.o
caffe::DataLayer::DataLayerSetUp(std::__1::vectorcaffe::Blob > const&, std::__1::vectorcaffe::Blob > const&) in data_layer.o
caffe::DataLayer::InternalThreadEntry() in data_layer.o
caffe::Net::Forward(std::__1::basic_string, std::__1::allocator > const&, float_) in net.o
caffe::Net::Forward(std::__1::basic_string, std::__1::allocator > const&, double_) in net.o
"google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const_, void (_)(std::__1::basic_string, std::__1::allocator > const&))", referenced from:
caffe::protobuf_AddDesc_caffe_2eproto() in caffe.pb.o
"google::protobuf::internal::WireFormatLite::ReadString(google::protobuf::io::CodedInputStream_, std::__1::basic_string, std::__1::allocator >_)", referenced from:
caffe::FillerParameter::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream_) in caffe.pb.o
caffe::NetParameter::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream_) in caffe.pb.o
caffe::SolverParameter::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream_) in caffe.pb.o
caffe::SolverState::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream_) in caffe.pb.o
caffe::NetState::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream_) in caffe.pb.o
caffe::NetStateRule::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream_) in caffe.pb.o
caffe::ParamSpec::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream_) in caffe.pb.o
...
"google::protobuf::internal::WireFormatLite::WriteBytes(int, std::__1::basic_string, std::__1::allocator > const&, google::protobuf::io::CodedOutputStream_)", referenced from:
caffe::Datum::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream_) const in caffe.pb.o
"google::protobuf::internal::WireFormatLite::WriteString(int, std::__1::basic_string, std::__1::allocator > const&, google::protobuf::io::CodedOutputStream_)", referenced from:
caffe::FillerParameter::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream_) const in caffe.pb.o
caffe::NetParameter::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream_) const in caffe.pb.o
caffe::SolverParameter::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream_) const in caffe.pb.o
caffe::SolverState::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream_) const in caffe.pb.o
caffe::NetState::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream_) const in caffe.pb.o
caffe::NetStateRule::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream_) const in caffe.pb.o
caffe::ParamSpec::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream_) const in caffe.pb.o
...
"google::protobuf::internal::WireFormatLite::ReadBytes(google::protobuf::io::CodedInputStream_, std::__1::basic_string, std::__1::allocator >_)", referenced from:
caffe::Datum::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream_) in caffe.pb.o
"google::protobuf::internal::StringTypeHandlerBase::Delete(std::__1::basic_string, std::__1::allocator >_)", referenced from:
caffe::NetParameter::NetParameter(caffe::NetParameter const&) in caffe.pb.o
caffe::NetParameter::~NetParameter() in caffe.pb.o
caffe::SolverParameter::SolverParameter(caffe::SolverParameter const&) in caffe.pb.o
caffe::SolverParameter::~SolverParameter() in caffe.pb.o
caffe::NetState::NetState(caffe::NetState const&) in caffe.pb.o
caffe::NetState::~NetState() in caffe.pb.o
caffe::NetStateRule::NetStateRule(caffe::NetStateRule const&) in caffe.pb.o
...
"google::protobuf::MessageLite::SerializeToString(std::__1::basic_string, std::__1::allocator >_) const", referenced from:
caffe::Net::Forward(std::__1::basic_string, std::__1::allocator > const&, float_) in net.o
caffe::Net::Forward(std::__1::basic_string, std::__1::allocator > const&, double_) in net.o
"google::protobuf::DescriptorPool::FindFileByName(std::__1::basic_string, std::__1::allocator > const&) const", referenced from:
caffe::protobuf_AssignDesc_caffe_2eproto() in caffe.pb.o
"google::protobuf::Message::SerializeToOstream(std::__1::basic_ostream >_) const", referenced from:
caffe::WriteProtoToBinaryFile(google::protobuf::Message const&, char const_) in io.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/lib/libcaffe.so] Error 1
.....................................................................................................................................................

Also I installed protobuf 2.5.0 instead of 2.6 in lieu with https://github.com/BVLC/caffe/issues/19
But same error occurs.
I also checked my /usr/local/lib/ for protobuf libraries, and these are the ones I could find-
libprotobuf-lite.8.dylib libprotobuf-lite.dylib libprotobuf.a libprotoc.8.dylib libprotoc.dylib
libprotobuf-lite.a libprotobuf.8.dylib libprotobuf.dylib libprotoc.a

Any ideas if I am missing something?

@deepsamal
You revert back to libstdc++? Clang default option is libc++ in OS X 10.9+, and CUDA 7.0 now supports libc++, so I think you are recommended to compile with libc++ for all dependencies.
The last command you run doesn't include -stdlib= option (i.e. equivalent to with -stdlib=libc++) , so the problem seems that your protobuf library is compiled with libstdc++ rather than libc++.

According to your log, your search paths of linked libraries are in order as below.

-L/Users/deepsamal/anaconda/lib -L/usr/local/lib -L/usr/lib -L/Users/deepsamal/Desktop/Research/cudnn-6.5-osx-v2 -L/usr/local/cuda/lib -L/opt/intel/mkl/lib -L.build_release/lib

Accordingly, locate protobuf libraries which you are linking to Caffe by using the following command.

locate libprotobuf

Then,

otool -L <path to libprotobuf which is found first in your search path>

I think this will show you which stdlib library you linked to libprotobuf (which you are trying to link to Caffe).

2286 #2258 #2018 I believe these are the same problem. The problem seems to be inconsistency related to libstdc++.

@tnarihi Thanks a lot for the pointer. The issue was with protobuf. As I had installed a fresh copy of protobuf, one which didn't have ENV flags, I had assumed it will take the default flags i.e. clang and stdc++. But I had to add those lines mentioned in installation steps and change them to libc++.
Also there was one place in cuda.cmake where a variable use_stdcpp was set. So had to comment that.
Now my make all, and make test are running fine. But getting segmentation fault in make runtest.
By running sudo make runtest... i get following output-
.build_release/tools/caffe
dyld: Library not loaded: @rpath/libcudart.7.0.dylib
Referenced from: /Users/deepsamal/Desktop/Research/caffe/.build_release/tools/caffe
Reason: image not found
make: *** [runtest] Trace/BPT trap: 5

I know it might be unrelated, and therefore am closing this thread, but please inform me if you have any ideas on my problem. Thanks.

I have the same problem. Here is the error message

Undefined symbols for architecture x86_64:
  "cv::imread(std::string const&, int)", referenced from:
      caffe::WindowDataLayer<float>::InternalThreadEntry() in window_data_layer.o
      caffe::WindowDataLayer<double>::InternalThreadEntry() in window_data_layer.o
      caffe::ReadImageToCVMat(std::string const&, int, int, bool) in io.o
  "cv::imencode(std::string const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<int, std::allocator<int> > const&)", referenced from:
      caffe::ReadImageToDatum(std::string const&, int, int, int, bool, std::string const&, caffe::Datum*) in io.o
  "google::protobuf::MessageLite::ParseFromString(std::string const&)", referenced from:
      caffe::DataLayer<float>::DataLayerSetUp(std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> > const&, std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> > const&) in data_layer.o
      caffe::DataLayer<float>::InternalThreadEntry() in data_layer.o
      caffe::DataLayer<double>::DataLayerSetUp(std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> > const&, std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> > const&) in data_layer.o
      caffe::DataLayer<double>::InternalThreadEntry() in data_layer.o
      caffe::Net<float>::Forward(std::string const&, float*) in net.o
      caffe::Net<double>::Forward(std::string const&, double*) in net.o
  "google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const*, void (*)(std::string const&))", referenced from:
      caffe::protobuf_AddDesc_caffe_2eproto() in caffe.pb.o
  "google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(std::string const&, unsigned char*)", referenced from:
      caffe::Datum::SerializeWithCachedSizesToArray(unsigned char*) const in caffe.pb.o
      caffe::FillerParameter::SerializeWithCachedSizesToArray(unsigned char*) const in caffe.pb.o
      caffe::NetParameter::SerializeWithCachedSizesToArray(unsigned char*) const in caffe.pb.o
      caffe::SolverParameter::SerializeWithCachedSizesToArray(unsigned char*) const in caffe.pb.o
      caffe::SolverState::SerializeWithCachedSizesToArray(unsigned char*) const in caffe.pb.o
      caffe::NetState::SerializeWithCachedSizesToArray(unsigned char*) const in caffe.pb.o
      caffe::NetStateRule::SerializeWithCachedSizesToArray(unsigned char*) const in caffe.pb.o
      ...
  "google::protobuf::internal::WireFormatLite::ReadString(google::protobuf::io::CodedInputStream*, std::string*)", referenced from:
      caffe::FillerParameter::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*) in caffe.pb.o
      caffe::NetParameter::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*) in caffe.pb.o
      caffe::SolverParameter::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*) in caffe.pb.o
      caffe::SolverState::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*) in caffe.pb.o
      caffe::NetState::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*) in caffe.pb.o
      caffe::NetStateRule::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*) in caffe.pb.o
      caffe::ParamSpec::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*) in caffe.pb.o
      ...
  "google::protobuf::internal::WireFormatLite::WriteString(int, std::string const&, google::protobuf::io::CodedOutputStream*)", referenced from:
      caffe::NetParameter::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const in caffe.pb.o
      caffe::SolverParameter::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const in caffe.pb.o
      caffe::NetState::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const in caffe.pb.o
      caffe::NetStateRule::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const in caffe.pb.o
      caffe::LayerParameter::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const in caffe.pb.o
      caffe::V1LayerParameter::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const in caffe.pb.o
  "google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(int, std::string const&, google::protobuf::io::CodedOutputStream*)", referenced from:
      caffe::Datum::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const in caffe.pb.o
  "google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(int, std::string const&, google::protobuf::io::CodedOutputStream*)", referenced from:
      caffe::FillerParameter::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const in caffe.pb.o
      caffe::NetParameter::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const in caffe.pb.o
      caffe::SolverParameter::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const in caffe.pb.o
      caffe::SolverState::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const in caffe.pb.o
      caffe::ParamSpec::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const in caffe.pb.o
      caffe::LayerParameter::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const in caffe.pb.o
      caffe::TransformationParameter::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const in caffe.pb.o
      ...
  "google::protobuf::internal::WireFormatLite::ReadBytes(google::protobuf::io::CodedInputStream*, std::string*)", referenced from:
      caffe::Datum::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*) in caffe.pb.o
  "google::protobuf::internal::StringTypeHandlerBase::Delete(std::string*)", referenced from:
      caffe::NetParameter::NetParameter() in caffe.pb.o
      caffe::NetParameter::NetParameter(caffe::NetParameter const&) in caffe.pb.o
      caffe::NetParameter::~NetParameter() in caffe.pb.o
      caffe::SolverParameter::SolverParameter() in caffe.pb.o
      caffe::SolverParameter::SolverParameter(caffe::SolverParameter const&) in caffe.pb.o
      caffe::SolverParameter::~SolverParameter() in caffe.pb.o
      caffe::NetState::NetState() in caffe.pb.o
      ...
  "leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)", referenced from:
      caffe::db::LevelDB::Open(std::string const&, caffe::db::Mode) in db.o
  "google::protobuf::MessageLite::SerializeToString(std::string*) const", referenced from:
      caffe::Net<float>::Forward(std::string const&, float*) in net.o
      caffe::Net<double>::Forward(std::string const&, double*) in net.o
  "google::protobuf::DescriptorPool::FindFileByName(std::string const&) const", referenced from:
      caffe::protobuf_AssignDesc_caffe_2eproto() in caffe.pb.o
  "google::protobuf::Message::SerializeToOstream(std::ostream*) const", referenced from:
      caffe::WriteProtoToBinaryFile(google::protobuf::Message const&, char const*) in io.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/lib/libcaffe.so] Error 1
make: *** Waiting for unfinished jobs....

I checked my libprotobuf @tnarihi

/usr/local/lib/libprotobuf.9.dylib:
    /usr/local/lib/libprotobuf.9.dylib (compatibility version 10.0.0, current version 10.1.0)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)

It seems already linked to libc++, not libstdc++.
Any suggestions?

Seems I found the problem. Because my cuda7 was upgrade from cuda6.5 through system panel.
nvcc -V still tell me 6.5

I have the same problem, I tried every method but it is no work; my error log as bellow:
MacOS 10.12.6, Opencv 2.7.14.0, Cuda and Anaconda is the latest version, I do not known how to
get the Cuda and Anaconda version

➜  caffe git:(master) make all -j4
PROTOC src/caffe/proto/caffe.proto
CXX src/caffe/blob.cpp
CXX src/caffe/common.cpp
CXX src/caffe/data_transformer.cpp
CXX src/caffe/internal_thread.cpp
CXX src/caffe/layer.cpp
CXX src/caffe/layer_factory.cpp
CXX src/caffe/layers/absval_layer.cpp
CXX src/caffe/layers/accuracy_layer.cpp
CXX src/caffe/layers/argmax_layer.cpp
CXX src/caffe/layers/base_conv_layer.cpp
CXX src/caffe/layers/base_data_layer.cpp
CXX src/caffe/layers/batch_norm_layer.cpp
CXX src/caffe/layers/batch_reindex_layer.cpp
CXX src/caffe/layers/bias_layer.cpp
CXX src/caffe/layers/bnll_layer.cpp
CXX src/caffe/layers/concat_layer.cpp
CXX src/caffe/layers/contrastive_loss_layer.cpp
CXX src/caffe/layers/conv_layer.cpp
CXX src/caffe/layers/crop_layer.cpp
CXX src/caffe/layers/cudnn_conv_layer.cpp
CXX src/caffe/layers/cudnn_lcn_layer.cpp
CXX src/caffe/layers/cudnn_lrn_layer.cpp
CXX src/caffe/layers/cudnn_pooling_layer.cpp
CXX src/caffe/layers/cudnn_relu_layer.cpp
CXX src/caffe/layers/cudnn_sigmoid_layer.cpp
CXX src/caffe/layers/cudnn_softmax_layer.cpp
CXX src/caffe/layers/cudnn_tanh_layer.cpp
CXX src/caffe/layers/data_layer.cpp
CXX src/caffe/layers/deconv_layer.cpp
CXX src/caffe/layers/dropout_layer.cpp
In file included from src/caffe/layers/crop_layer.cpp:10:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/layers/dummy_data_layer.cpp
CXX src/caffe/layers/eltwise_layer.cpp
CXX src/caffe/layers/elu_layer.cpp
CXX src/caffe/layers/embed_layer.cpp
CXX src/caffe/layers/euclidean_loss_layer.cpp
CXX src/caffe/layers/exp_layer.cpp
CXX src/caffe/layers/filter_layer.cpp
CXX src/caffe/layers/flatten_layer.cpp
CXX src/caffe/layers/hdf5_data_layer.cpp
CXX src/caffe/layers/hdf5_output_layer.cpp
CXX src/caffe/layers/hinge_loss_layer.cpp
CXX src/caffe/layers/im2col_layer.cpp
CXX src/caffe/layers/image_data_layer.cpp
CXX src/caffe/layers/infogain_loss_layer.cpp
CXX src/caffe/layers/inner_product_layer.cpp
CXX src/caffe/layers/input_layer.cpp
CXX src/caffe/layers/log_layer.cpp
CXX src/caffe/layers/loss_layer.cpp
CXX src/caffe/layers/lrn_layer.cpp
CXX src/caffe/layers/lstm_layer.cpp
CXX src/caffe/layers/lstm_unit_layer.cpp
CXX src/caffe/layers/memory_data_layer.cpp
CXX src/caffe/layers/multinomial_logistic_loss_layer.cpp
In file included from src/caffe/layers/lstm_layer.cpp:8:
In file included from ./include/caffe/layers/lstm_layer.hpp:11:
In file included from ./include/caffe/layers/recurrent_layer.hpp:11:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/layers/mvn_layer.cpp
In file included from src/caffe/layers/lstm_unit_layer.cpp:6:
In file included from ./include/caffe/layers/lstm_layer.hpp:11:
In file included from ./include/caffe/layers/recurrent_layer.hpp:11:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/layers/neuron_layer.cpp
CXX src/caffe/layers/parameter_layer.cpp
CXX src/caffe/layers/pooling_layer.cpp
CXX src/caffe/layers/power_layer.cpp
CXX src/caffe/layers/prelu_layer.cpp
CXX src/caffe/layers/recurrent_layer.cpp
CXX src/caffe/layers/reduction_layer.cpp
CXX src/caffe/layers/relu_layer.cpp
CXX src/caffe/layers/reshape_layer.cpp
In file included from src/caffe/layers/recurrent_layer.cpp:8:
In file included from ./include/caffe/layers/recurrent_layer.hpp:11:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/layers/rnn_layer.cpp
CXX src/caffe/layers/scale_layer.cpp
CXX src/caffe/layers/sigmoid_cross_entropy_loss_layer.cpp
CXX src/caffe/layers/sigmoid_layer.cpp
In file included from src/caffe/layers/rnn_layer.cpp:8:
In file included from ./include/caffe/layers/rnn_layer.hpp:11:
In file included from ./include/caffe/layers/recurrent_layer.hpp:11:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/layers/silence_layer.cpp
CXX src/caffe/layers/slice_layer.cpp
CXX src/caffe/layers/softmax_layer.cpp
CXX src/caffe/layers/softmax_loss_layer.cpp
CXX src/caffe/layers/split_layer.cpp
CXX src/caffe/layers/spp_layer.cpp
CXX src/caffe/layers/tanh_layer.cpp
CXX src/caffe/layers/threshold_layer.cpp
CXX src/caffe/layers/tile_layer.cpp
CXX src/caffe/layers/window_data_layer.cpp
CXX src/caffe/net.cpp
CXX src/caffe/parallel.cpp
CXX src/caffe/solver.cpp
CXX src/caffe/solvers/adadelta_solver.cpp
In file included from src/caffe/solvers/adadelta_solver.cpp:3:
In file included from ./include/caffe/sgd_solvers.hpp:7:
In file included from ./include/caffe/solver.hpp:7:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/solvers/adagrad_solver.cpp
CXX src/caffe/solvers/adam_solver.cpp
In file included from src/caffe/solver.cpp:6:
In file included from ./include/caffe/solver.hpp:7:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/solvers/nesterov_solver.cpp
In file included from src/caffe/net.cpp:12:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
src/caffe/net.cpp:557:3: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
  LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: Forward(bottom, loss) "
  ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
2 warnings generated.
CXX src/caffe/solvers/rmsprop_solver.cpp
In file included from src/caffe/solvers/adagrad_solver.cpp:3:
In file included from ./include/caffe/sgd_solvers.hpp:7:
In file included from ./include/caffe/solver.hpp:7:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/solvers/sgd_solver.cpp
In file included from src/caffe/solvers/adam_solver.cpp:3:
In file included from ./include/caffe/sgd_solvers.hpp:7:
In file included from ./include/caffe/solver.hpp:7:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/syncedmem.cpp
In file included from src/caffe/solvers/nesterov_solver.cpp:3:
In file included from ./include/caffe/sgd_solvers.hpp:7:
In file included from ./include/caffe/solver.hpp:7:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/util/benchmark.cpp
CXX src/caffe/util/blocking_queue.cpp
In file included from src/caffe/solvers/rmsprop_solver.cpp:3:
In file included from ./include/caffe/sgd_solvers.hpp:7:
In file included from ./include/caffe/solver.hpp:7:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/util/cudnn.cpp
CXX src/caffe/util/db.cpp
CXX src/caffe/util/db_leveldb.cpp
CXX src/caffe/util/db_lmdb.cpp
In file included from src/caffe/solvers/sgd_solver.cpp:4:
In file included from ./include/caffe/sgd_solvers.hpp:7:
In file included from ./include/caffe/solver.hpp:7:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/util/hdf5.cpp
CXX src/caffe/util/im2col.cpp
CXX src/caffe/util/insert_splits.cpp
src/caffe/util/blocking_queue.cpp:49:7: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
      LOG_EVERY_N(INFO, 1000)<< log_on_wait;
      ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX src/caffe/util/io.cpp
CXX src/caffe/util/math_functions.cpp
CXX src/caffe/util/signal_handler.cpp
CXX src/caffe/util/upgrade_proto.cpp
CXX tools/caffe.cpp
CXX tools/compute_image_mean.cpp
In file included from src/caffe/util/signal_handler.cpp:7:
In file included from ./include/caffe/util/signal_handler.h:5:
In file included from ./include/caffe/solver.hpp:7:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX tools/convert_imageset.cpp
CXX tools/device_query.cpp
CXX tools/extract_features.cpp
CXX tools/finetune_net.cpp
CXX tools/net_speed_benchmark.cpp
In file included from tools/caffe.cpp:15:
In file included from ./include/caffe/caffe.hpp:12:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX tools/test_net.cpp
In file included from tools/finetune_net.cpp:1:
In file included from ./include/caffe/caffe.hpp:12:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX tools/train_net.cpp
In file included from tools/extract_features.cpp:9:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX tools/upgrade_net_proto_binary.cpp
In file included from tools/net_speed_benchmark.cpp:1:
In file included from ./include/caffe/caffe.hpp:12:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX tools/upgrade_net_proto_text.cpp
In file included from tools/test_net.cpp:1:
In file included from ./include/caffe/caffe.hpp:12:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX tools/upgrade_solver_proto_text.cpp
In file included from tools/train_net.cpp:1:
In file included from ./include/caffe/caffe.hpp:12:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX examples/cifar10/convert_cifar_data.cpp
In file included from tools/upgrade_net_proto_binary.cpp:10:
In file included from ./include/caffe/caffe.hpp:12:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX examples/cpp_classification/classification.cpp
In file included from tools/upgrade_net_proto_text.cpp:10:
In file included from ./include/caffe/caffe.hpp:12:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX examples/mnist/convert_mnist_data.cpp
CXX examples/siamese/convert_mnist_siamese_data.cpp
In file included from tools/upgrade_solver_proto_text.cpp:10:
In file included from ./include/caffe/caffe.hpp:12:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
CXX .build_release/src/caffe/proto/caffe.pb.cc
In file included from examples/cpp_classification/classification.cpp:1:
In file included from ./include/caffe/caffe.hpp:12:
./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
    LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
    ^
/Users/chenxingyi/anaconda2/include/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                             INVALID_REQUESTED_LOG_SEVERITY);           \
                             ^
1 warning generated.
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so.1.0.0
clang: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument]
/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(parallel.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
Undefined symbols for architecture x86_64:
  "cv::imread(cv::String const&, int)", referenced from:
      caffe::WindowDataLayer<float>::load_batch(caffe::Batch<float>*) in window_data_layer.o
      caffe::WindowDataLayer<double>::load_batch(caffe::Batch<double>*) in window_data_layer.o
      caffe::ReadImageToCVMat(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, int, bool) in io.o
  "cv::imdecode(cv::_InputArray const&, int)", referenced from:
      caffe::DecodeDatumToCVMatNative(caffe::Datum const&) in io.o
      caffe::DecodeDatumToCVMat(caffe::Datum const&, bool) in io.o
  "cv::imencode(cv::String const&, cv::_InputArray const&, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> >&, std::__1::vector<int, std::__1::allocator<int> > const&)", referenced from:
      caffe::ReadImageToDatum(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, int, int, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, caffe::Datum*) in io.o
  "leveldb::DB::Open(leveldb::Options const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, leveldb::DB**)", referenced from:
      caffe::db::LevelDB::Open(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, caffe::db::Mode) in db_leveldb.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/lib/libcaffe.so.1.0.0] Error 1
make: *** Waiting for unfinished jobs....

Any one can help me ?

@cxy200927099 I am having exactly the same issue. 10.11.5, Homebrew dependencies including opencv-3.4.0_1.el_capitan.bottle.tar.gz

A hint to the solution is given here: https://stackoverflow.com/a/27904334/173515

Add OPENCV_VERSION to your Makefile.config, e.g.:

...
# uncomment to disable IO dependencies and corresponding data layers
# USE_OPENCV := 0
OPENCV_VERSION := 3
...

That fixed the link problem vs opencv for me.

@toby5box thanks for reply, I use the docker on my macOS, And it works

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ruhjkg picture Ruhjkg  ·  3Comments

inferrna picture inferrna  ·  3Comments

hawklucky picture hawklucky  ·  3Comments

dfotland picture dfotland  ·  3Comments

vladislavdonchev picture vladislavdonchev  ·  3Comments