0

バックグラウンド

昨日、私はCaffeをビルドしましたが、依存関係に問題はありませんでした。

今日、protobuf の依存関係が見つからないため、Caffe Matlab ラッパーのビルドに問題がありました。そこで、問題が解決することを期待して、Caffe:make cleanの後に aを再構築しました。make all

現在、Caffe ビルドは protobuf 依存関係について不平を言っています。

エラー出力は、この質問の下部に記載されています。

元の (成功した) ビルドと失敗したビルドの間にpip install protobuf、Caffe python ラッパーが protobuf をインポートできるようにする必要がありました。python が protobuf パッケージを見つけることができないと不平を言ったからです。これは、Caffe の再構築が失敗する前の protobuf に関する唯一の「変更」でした。

brew を使用して protobuf を再インストールしようとしましたが、これは役に立ちませんでした。

基本的に、protobuf に関連するイベントの年表は次のとおりです。

1. protobuf installed from source using brew:
     brew install --build-from-source --with-python --fresh -vd protobuf
2. caffe built successfully  
3. caffe python wrappers failed to build -- protobuf not found
4. pip install protobuf
5. caffe python wrappers built successfully
6. caffe matlab wrappers failed to build -- protobuf not found
7. tried to rebuild caffe -- failed -- protobuf not found
8. reinstalled protobuf from source using brew
9. tried again to rebuild caffe -- failed -- protobuf not found

protobuf が見つからない場合は常にbrew list --versions、protobuf (2.6.1) がインストールされていることを示しました。

質問

明らかにインストールされているのにprotobufが見つからない理由を誰か説明してもらえますか?

特に紛らわしいのは、最初に (元の成功したビルド中に) 発見され、同じアプローチに従っているにもかかわらず、現在は発見されていないという事実です。

エラー出力は次のとおりです。

$ make clean
$ make all -j8
[... truncated ...]
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'
/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_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
Undefined symbols for architecture x86_64:
  "google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > 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::empty_string_", referenced from:
      caffe::Datum::SharedCtor() in caffe.pb.o
      caffe::Datum::MergeFrom(caffe::Datum const&) in caffe.pb.o
      caffe::Datum::~Datum() in caffe.pb.o
      caffe::Datum::SharedDtor() in caffe.pb.o
      caffe::Datum::Clear() in caffe.pb.o
      caffe::Datum::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*) in caffe.pb.o
      caffe::NetParameter::SharedCtor() in caffe.pb.o
      ...
  "google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > 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::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > 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::InitEmptyString()", referenced from:
      caffe::Datum::SharedCtor() in caffe.pb.o
      caffe::FillerParameter::SharedCtor() in caffe.pb.o
      caffe::NetParameter::SharedCtor() in caffe.pb.o
      caffe::SolverParameter::SharedCtor() in caffe.pb.o
      caffe::SolverState::SharedCtor() in caffe.pb.o
      caffe::NetState::SharedCtor() in caffe.pb.o
      caffe::NetStateRule::SharedCtor() in caffe.pb.o
      ...
  "google::protobuf::internal::empty_string_once_init_", referenced from:
      caffe::Datum::SharedCtor() in caffe.pb.o
      caffe::FillerParameter::SharedCtor() in caffe.pb.o
      caffe::NetParameter::SharedCtor() in caffe.pb.o
      caffe::SolverParameter::SharedCtor() in caffe.pb.o
      caffe::SolverState::SharedCtor() in caffe.pb.o
      caffe::NetState::SharedCtor() in caffe.pb.o
      caffe::NetStateRule::SharedCtor() in caffe.pb.o
      ...
  "google::protobuf::io::CodedInputStream::BytesUntilTotalBytesLimit() const", referenced from:
      bool google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<float, (google::protobuf::internal::WireFormatLite::FieldType)2>(google::protobuf::io::CodedInputStream*, google::protobuf::RepeatedField<float>*) in caffe.pb.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
4

1 に答える 1