Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caffe build failure in MacOS #6679

Open
momo1986 opened this issue Jan 24, 2019 · 4 comments
Open

Caffe build failure in MacOS #6679

momo1986 opened this issue Jan 24, 2019 · 4 comments

Comments

@momo1986
Copy link

Important - read before submitting

Please read the guidelines for contributing before submitting this issue!

Please do not post installation, build, usage, 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.

Issue summary

When I try to build "Caffe" in MacOS, the errors are reported for protobuf corresponding issues:
ls: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/: No such file or directory
PROTOC src/caffe/proto/caffe.proto
CXX .build_release/src/caffe/proto/caffe.pb.cc
In file included from .build_release/src/caffe/proto/caffe.pb.cc:4:
In file included from .build_release/src/caffe/proto/caffe.pb.h:23:
In file included from /usr/local/include/google/protobuf/io/coded_stream.h:135:
/usr/local/include/google/protobuf/stubs/common.h:190:17: error: expected expression
OnShutdownRun([](const void* pp) { delete static_cast<const T*>(pp); }, p);
^
In file included from .build_release/src/caffe/proto/caffe.pb.cc:4:
In file included from .build_release/src/caffe/proto/caffe.pb.h:26:
In file included from /usr/local/include/google/protobuf/generated_message_table_driven.h:34:
In file included from /usr/local/include/google/protobuf/map.h:49:
In file included from /usr/local/include/google/protobuf/map_type_handler.h:35:
In file included from /usr/local/include/google/protobuf/wire_format_lite_inl.h:45:
/usr/local/include/google/protobuf/message_lite.h:136:3: error: unknown type name 'constexpr'
constexpr const T& get() const { return reinterpret_cast<const T&>(union_); }
^
/usr/local/include/google/protobuf/message_lite.h:136:13: error: expected member name or ';' after declaration specifiers
constexpr const T& get() const { return reinterpret_cast<const T&>(union_); }

/usr/local/include/google/protobuf/message_lite.h:129:11: error: use of undeclared identifier 'union_'
  new (&union_) T();
        ^
/usr/local/include/google/protobuf/message_lite.h:133:5: error: use of undeclared identifier 'get_mutable'
  get_mutable()->~T();
  ^
/usr/local/include/google/protobuf/message_lite.h:150:45: error: found '<::' after a template name which forms the digraph '<:' (aka '[') and a ':', did you mean '< ::'?
PROTOBUF_EXPORT extern ExplicitlyConstructed<::std::string>
                                          ^
/usr/local/include/google/protobuf/message_lite.h:155:37: error: no member named 'get' in 'google::protobuf::internal::ExplicitlyConstructed<std::__1::basic_string<char> >'
return fixed_address_empty_string.get();
       ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/usr/local/include/google/protobuf/message_lite.h:513:3: error: unknown type name 'constexpr'
constexpr bool alias = flags & kMergeWithAliasing;
^
/usr/local/include/google/protobuf/message_lite.h:513:13: error: expected unqualified-id
constexpr bool alias = flags & kMergeWithAliasing;
          ^
/usr/local/include/google/protobuf/message_lite.h:514:41: error: use of undeclared identifier 'alias'
return internal::MergePartialFromImpl<alias>(input, this) &&
                                      ^
In file included from .build_release/src/caffe/proto/caffe.pb.cc:4:
In file included from .build_release/src/caffe/proto/caffe.pb.h:26:
In file included from /usr/local/include/google/protobuf/generated_message_table_driven.h:34:
In file included from /usr/local/include/google/protobuf/map.h:49:
In file included from /usr/local/include/google/protobuf/map_type_handler.h:35:
In file included from /usr/local/include/google/protobuf/wire_format_lite_inl.h:46:
/usr/local/include/google/protobuf/repeated_field.h:130:39: error: expected ';' at end of declaration list
RepeatedField(RepeatedField&& other) noexcept;
                                    ^
/usr/local/include/google/protobuf/repeated_field.h:131:50: error: expected ';' at end of declaration list
RepeatedField& operator=(RepeatedField&& other) noexcept;
                                               ^
/usr/local/include/google/protobuf/repeated_field.h:787:45: error: expected ';' at end of declaration list
RepeatedPtrField(RepeatedPtrField&& other) noexcept;
                                          ^
/usr/local/include/google/protobuf/repeated_field.h:788:56: error: expected ';' at end of declaration list
RepeatedPtrField& operator=(RepeatedPtrField&& other) noexcept;
                                                     ^
/usr/local/include/google/protobuf/repeated_field.h:1097:68: error: expected ';' at end of declaration
inline RepeatedField<Element>::RepeatedField(RepeatedField&& other) noexcept
                                                                 ^
/usr/local/include/google/protobuf/repeated_field.h:1097:69: error: unknown type name 'noexcept'
inline RepeatedField<Element>::RepeatedField(RepeatedField&& other) noexcept
                                                                  ^
/usr/local/include/google/protobuf/repeated_field.h:1098:5: error: expected unqualified-id
  : RepeatedField() {
  ^
/usr/local/include/google/protobuf/repeated_field.h:1110:27: error: expected ';' at end of declaration
  RepeatedField&& other) noexcept {
                        ^
/usr/local/include/google/protobuf/repeated_field.h:1110:28: error: C++ requires a type specifier for all declarations
  RepeatedField&& other) noexcept {
                         ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [.build_release/src/caffe/proto/caffe.pb.o] Error 1

### Steps to reproduce
git clone https://github.com/BVLC/caffe
cd caffe
make all

### Tried solutions


### System configuration

* Operating system: 
* Compiler: 
* CUDA version (if applicable): 
* CUDNN version (if applicable): 
* BLAS: 
* Python version (if using pycaffe): 
* MATLAB version (if using matcaffe): 

### Issue checklist

- [ ] read the guidelines and removed the first paragraph
- [ ] written a short summary and detailed steps to reproduce
- [ ] explained how solutions to related problems failed (tick if found none)
- [ ] filled system configuration
- [ ] attached relevant logs/config files (tick if not applicable)
@petulla
Copy link

petulla commented Mar 8, 2019

Has anyone found a solution to this issue? @momo1986

@ByuWang
Copy link

ByuWang commented Mar 14, 2019

I meet the same issue, have you solved it ?

@TaoStarlit
Copy link

I have the same issue too, it seems like the version issue of the protobuf

@babaozhouy5
Copy link

If build with cmake, you can change CMakeLists.txt as follows:

if(UNIX OR APPLE)
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -std=c++11")
endif()

or build with make, change Makefile as follows:

- CXXFLAGS += -pthread -fPIC $(COMMON_FLAGS) $(WARNINGS)
+ CXXFLAGS += -pthread -fPIC $(COMMON_FLAGS) $(WARNINGS) -std=c++11

agate-pris referenced this issue in Tencent/rapidjson Jul 6, 2022
`RAPIDJSON_DEFAULT_ALLOCATOR` uses names in the namespace
`RAPIDJSON_NAMESPACE`. Replace this with a name starting in the global
namespace.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants