macos can not install protobuf

125 views
Skip to first unread message

Xianjie Li

unread,
Jul 13, 2017, 9:44:20 AM7/13/17
to Caffe Users
when I use command line:brew edit protobuf ,adding bold code:

def install


    # Don't build in debug mode. See:


    # https://github.com/Homebrew/homebrew/issues/9279


    # https://github.com/google/protobuf/blob/5c24564811c08772d090305be36fae82d8f12bbe/configure.ac#L61


    # ADD THE FOLLOWING:


    ENV.append "CXXFLAGS", "-stdlib=libstdc++"


    ENV.append "CFLAGS", "-stdlib=libstdc++"


    ENV.append "LDFLAGS", "-stdlib=libstdc++ -lstdc++"


    # The following is necessary because libtool likes to strip LDFLAGS:


    ENV["CXX"] = "/usr/bin/clang++ -stdlib=libstdc++"


    ENV.prepend "CXXFLAGS", "-DNDEBUG"


    ENV.cxx11




    (buildpath/"gmock").install resource("gmock")


    system "./autogen.sh"




    system "./configure", "--disable-debug", "--disable-dependency-tracking",


                          "--prefix=#{prefix}", "--with-zlib"


    system "make"


    system "make", "check" if build.with?("test") || build.bottle?


    system "make", "install"




    # Install editor support and examples


    doc.install "editors", "examples"




    Language::Python.each_python(build) do |python, version|


      # google-apputils is a build-time dependency


      ENV.prepend_create_path "PYTHONPATH", buildpath/"homebrew/lib/python#{version}/site-packages"




      res = resources.map(&:name).to_set - ["gmock"]


      res.each do |package|


        resource(package).stage do


          system python, *Language::Python.setup_install_args(buildpath/"homebrew")


        end


      end

then I ran the command line :brew install --build-from-source --with-python -vd protobuf
it shows that:
In file included from google/protobuf/message_lite.cc:46:
In file included from ./google/protobuf/io/zero_copy_stream_impl_lite.h:49:
./google/protobuf/stubs/shared_ptr.h:60:12: error: no member named 'enable_shared_from_this' in namespace 'std'
using std::enable_shared_from_this;
~~~~~^
./google/protobuf/stubs/shared_ptr.h:61:12: error: no member named 'shared_ptr' in namespace 'std'
using std::shared_ptr;
~~~~~^
./google/protobuf/stubs/shared_ptr.h:62:12: error: no member named 'static_pointer_cast' in namespace 'std'
using std::static_pointer_cast;
~~~~~^
fatal error
: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
In file included from google/protobuf/extension_set.cc:41:
In file included from ./google/protobuf/wire_format_lite_inl.h:47:
./google/protobuf/arenastring.h:216:37: error: no member named 'move' in namespace 'std'
ptr_
= new ::std::string(std::move(value));
~~~~~^
make
[2]: *** [google/protobuf/message_lite.lo] Error 1
./google/protobuf/arenastring.h:218:20: error: no member named 'move' in namespace 'std'
*ptr_ = std::move(value);
~~~~~^
18 errors generated.
make
[2]: *** [google/protobuf/extension_set.lo] Error 1
make
[1]: *** [all-recursive] Error 1
make
: *** [all] Error 2
/usr/local/Homebrew/Library/Homebrew/debrew.rb:11:in `raise'
BuildError: Failed executing: make
1. raise
2. ignore
3. backtrace
4. irb
5. shell
Choose an action:

reference: http://caffe.berkeleyvision.org/install_osx.html
Reply all
Reply to author
Forward
0 new messages