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

cmake: build in c++11 mode for newer protobufs #20

Merged
merged 1 commit into from
Nov 14, 2019
Merged

cmake: build in c++11 mode for newer protobufs #20

merged 1 commit into from
Nov 14, 2019

Conversation

jonchang
Copy link
Contributor

Builds fail with many errors on newer protobuf versions > 3.1, which is no longer packaged in e.g., Homebrew.

c.f. brewsci/homebrew-bio#832

In file included from /tmp/express-20191114-21111-xza7wy/eXpress-1.5.2/src/main.cpp:34:
In file included from /tmp/express-20191114-21111-xza7wy/eXpress-1.5.2/src/alignments.pb.h:23:
In file included from /usr/local/include/google/protobuf/io/coded_stream.h:140:
/usr/local/include/google/protobuf/stubs/common.h:186:17: error: expected expression
  OnShutdownRun([](const void* pp) { delete static_cast<const T*>(pp); }, p);
                ^
In file included from /tmp/express-20191114-21111-xza7wy/eXpress-1.5.2/src/main.cpp:34:
In file included from /tmp/express-20191114-21111-xza7wy/eXpress-1.5.2/src/alignments.pb.h:23:
/usr/local/include/google/protobuf/io/coded_stream.h:847:10: error: unknown type name 'constexpr'
  static constexpr int TagSize(uint32 tag) {
         ^
/usr/local/include/google/protobuf/io/coded_stream.h:847:20: error: expected member name or ';' after declaration specifiers
  static constexpr int TagSize(uint32 tag) {
  ~~~~~~~~~~~~~~~~ ^
/usr/local/include/google/protobuf/io/coded_stream.h:695:14: error: use of undeclared identifier 'WriteRawFallback'
      return WriteRawFallback(data, size, ptr);
             ^
/usr/local/include/google/protobuf/io/coded_stream.h:716:46: error: use of undeclared identifier 'TagSize'
            size >= 128 || end_ - ptr + 16 - TagSize(num << 3) - 1 < size)) {
                                             ^
/usr/local/include/google/protobuf/io/coded_stream.h:733:46: error: use of undeclared identifier 'TagSize'
            size >= 128 || end_ - ptr + 16 - TagSize(num << 3) - 1 < size)) {
                                             ^
/usr/local/include/google/protobuf/io/coded_stream.h:786:5: error: unknown type name 'constexpr'
    constexpr auto element_size = sizeof(typename T::value_type);
    ^
/usr/local/include/google/protobuf/io/coded_stream.h:786:15: error: expected unqualified-id
    constexpr auto element_size = sizeof(typename T::value_type);
              ^
/usr/local/include/google/protobuf/io/coded_stream.h:787:28: error: use of undeclared identifier 'element_size'
    auto size = r.size() * element_size;
                           ^
/usr/local/include/google/protobuf/io/coded_stream.h:789:33: error: use of undeclared identifier 'element_size'
    return WriteRawLittleEndian<element_size>(r.data(), static_cast<int>(size),
                                ^
/usr/local/include/google/protobuf/io/coded_stream.h:878:11: error: use of undeclared identifier 'WriteLengthDelim'
    ptr = WriteLengthDelim(num, size, ptr);
          ^
/usr/local/include/google/protobuf/io/coded_stream.h:1048:9: error: delegating constructors are permitted only in C++11
      : CodedOutputStream(stream, true) {}
        ^~~~~~~~~~~~~~~~~
In file included from /tmp/express-20191114-21111-xza7wy/eXpress-1.5.2/src/main.cpp:34:
In file included from /tmp/express-20191114-21111-xza7wy/eXpress-1.5.2/src/alignments.pb.h:24:
/usr/local/include/google/protobuf/arena.h:250:31: error: expected unqualified-id
class PROTOBUF_EXPORT alignas(8) Arena final {
                              ^
/usr/local/include/google/protobuf/arena.h:250:31: error: expected ')'
/usr/local/include/google/protobuf/arena.h:250:30: note: to match this '('
class PROTOBUF_EXPORT alignas(8) Arena final {
                             ^
In file included from /tmp/express-20191114-21111-xza7wy/eXpress-1.5.2/src/main.cpp:34:
In file included from /tmp/express-20191114-21111-xza7wy/eXpress-1.5.2/src/alignments.pb.h:25:
/usr/local/include/google/protobuf/arenastring.h:154:14: error: member access into incomplete type 'google::protobuf::Arena'
        arena->Own(value);
             ^
/usr/local/include/google/protobuf/arena.h:75:7: note: forward declaration of 'google::protobuf::Arena'
class Arena;    // defined below
      ^
In file included from /tmp/express-20191114-21111-xza7wy/eXpress-1.5.2/src/main.cpp:34:
In file included from /tmp/express-20191114-21111-xza7wy/eXpress-1.5.2/src/alignments.pb.h:25:
/usr/local/include/google/protobuf/arenastring.h:372:12: error: incomplete type 'google::protobuf::Arena' named in nested name specifier
    ptr_ = Arena::Create< ::std::string>(arena, *initial_value);
           ^~~~~~~
/usr/local/include/google/protobuf/arena.h:75:7: note: forward declaration of 'google::protobuf::Arena'
class Arena;    // defined below
      ^
In file included from /tmp/express-20191114-21111-xza7wy/eXpress-1.5.2/src/main.cpp:34:
In file included from /tmp/express-20191114-21111-xza7wy/eXpress-1.5.2/src/alignments.pb.h:25:
/usr/local/include/google/protobuf/arenastring.h:372:40: error: expected '(' for function-style cast or type construction
    ptr_ = Arena::Create< ::std::string>(arena, *initial_value);
                          ~~~~~~~~~~~~~^
In file included from /tmp/express-20191114-21111-xza7wy/eXpress-1.5.2/src/main.cpp:34:
In file included from /tmp/express-20191114-21111-xza7wy/eXpress-1.5.2/src/alignments.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:48:
In file included from /usr/local/include/google/protobuf/generated_enum_util.h:36:
/usr/local/include/google/protobuf/message_lite.h:135: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:135:13: error: expected member name or ';' after declaration specifiers
  constexpr const T& get() const { return reinterpret_cast<const T&>(union_); }
  ~~~~~~~~~ ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [src/CMakeFiles/express.dir/main.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [src/CMakeFiles/express.dir/all] Error 2
make: *** [all] Error 2

@jonchang jonchang mentioned this pull request Nov 14, 2019
@adarob adarob merged commit 2b50154 into adarob:master Nov 14, 2019
@jonchang jonchang deleted the patch-3 branch November 14, 2019 21:28
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

Successfully merging this pull request may close these issues.

None yet

2 participants