Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-2420

Compile failure on Ubuntu-21.10

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      Summary

      Compiling the library fails using ubuntu 21.10

      Environment

      MongoCXX Version 3.6.6, 3.6.5, 3.6.4

      Compilers tested: gcc-11, clang-13

       

      In file included from /usr/include/signal.h:328,
                       from /tmp/mongo-cxx-driver-r3.6.6/src/third_party/catch/include/catch.hpp:8034,
                       from /tmp/mongo-cxx-driver-r3.6.6/src/third_party/catch/main.cpp:16:
      /tmp/mongo-cxx-driver-r3.6.6/src/third_party/catch/include/catch.hpp:10822:58: error: call to non-‘constexpr’ function ‘long int sysconf(int)’
      10822  |     static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
             |                                                          ^~~~~~~~~~~
      In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24,
                       from /usr/include/signal.h:328,
                       from /tmp/mongo-cxx-driver-r3.6.6/src/third_party/catch/include/catch.hpp:8034,
                       from /tmp/mongo-cxx-driver-r3.6.6/src/third_party/catch/main.cpp:16:
      /usr/include/unistd.h:640:17: note: ‘long int sysconf(int)’ declared here
        640 | extern long int sysconf (int __name) __THROW;
            |                 ^~~~~~~
      In file included from /tmp/mongo-cxx-driver-r3.6.6/src/third_party/catch/main.cpp:16:
      /tmp/mongo-cxx-driver-r3.6.6/src/third_party/catch/include/catch.hpp:10881:45: error: size of array ‘altStackMem’ is not an integral constant-expression
      10881 |     char FatalConditionHandler::altStackMem[sigStackSize] = {};
            |                                             ^~~~~~~~~~~~
      

      How to Reproduce

      Compile with Ubuntu21.10

      How I built it:

      MONGO_CXX_VERSION="r3.6.6"MONGO_CXX_VERSION="r3.6.6"
      MONGO_CXX_DIR="mongo-cxx-driver-${MONGO_CXX_VERSION}"
      MONGO_CXX_TAR="${MONGO_CXX_DIR}.tar.gz"
      MONGO_CXX_URL="https://github.com/mongodb/mongo-cxx-driver/releases/download/${MONGO_CXX_VERSION}/${MONGO_CXX_TAR}"
      curl -OL ${MONGO_CXX_URL} && tar -xzf ${MONGO_CXX_TAR} && cd ${MONGO_CXX_DIR}/build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_TESTS=off  && cmake --build . && cmake --build . --target install
      

      Additional Background

      Seems to be related to a libc update.

      Also the initial cmake command seems to now be requiring root permissions,  previously only the cmake with --target install

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            alessandro.rosetti@gmail.com Alessandro Rosetti
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: