[SERVER-9881] Error while Compiling C++ Client Driver with clang++ -std=c++11 or possible process_id.h issue Created: 08/Jun/13  Updated: 10/Dec/14  Resolved: 10/Jun/13

Status: Closed
Project: Core Server
Component/s: Internal Client
Affects Version/s: 2.5.0
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Felipe Albrecht Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: c++, c++11, driver
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

clang++ --version
Apple clang version 4.1 (tags/Apple/clang-421.11.65) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin12.3.0
Thread model: posix

Mac os X 10.8.3

Boost 1.53 compiled with clang/clang++


Backwards Compatibility: Fully Compatible
Operating System: OS X
Steps To Reproduce:

git clone git://github.com/mongodb/mongo.git #tested with the lastest commit 9c4382ecb90f1044e3ba0e38991cf5c45281b7ea

scons --full install --64=FORCE64 -j 16 --prefix /opt/mongo --use-system-boost --extrapath=/opt/boost/ --cc=clang --cxx=clang++ --c++11 --allocator=system

Participants:

 Description   

I am using the mongodb from the git main trunk for some compatibility and integration tests. I use the clang with -std=c++11 flags for compiling my source.
Yesterday I updated my local repository (It was not updated for 3 weeks).
Since I did it, I am having troubles when I try to compile my code.

~/development/mongo/src/mongo/client]$ clang++ -std=c++11 -I/opt/mongo/include -I/opt/boost/include -L/opt/boost-clang/lib/ -L/opt/mongo/lib/ -lmongoclient -lboost_thread -lboost_filesystem -lboost_program_options -lboost_system simple_client_demo.cpp -o test

lboost_filesystem -lboost_program_options -lboost_system simple_client_demo.cpp -o test
In file included from simple_client_demo.cpp:32:
In file included from ./dbclient.h:32:
In file included from /opt/mongo/include/mongo/client/connpool.h:23:
In file included from /opt/mongo/include/mongo/client/dbclientinterface.h:27:
In file included from /opt/mongo/include/mongo/util/net/message.h:21:
In file included from /opt/mongo/include/mongo/util/net/hostandport.h:21:
In file included from /opt/mongo/include/mongo/db/cmdline.h:23:
/opt/mongo/include/mongo/platform/process_id.h:107:19: error: no template named 'hash'; did you mean 'boost::hash'?
template<> struct hash< ::mongo::ProcessId > {
^~~~
boost::hash
/opt/boost/include/boost/functional/hash/hash_fwd.hpp:23:31: note: 'boost::hash' declared here
template <class T> struct hash;
^
In file included from simple_client_demo.cpp:32:
In file included from ./dbclient.h:32:
In file included from /opt/mongo/include/mongo/client/connpool.h:23:
In file included from /opt/mongo/include/mongo/client/dbclientinterface.h:27:
In file included from /opt/mongo/include/mongo/util/net/message.h:21:
In file included from /opt/mongo/include/mongo/util/net/hostandport.h:21:
In file included from /opt/mongo/include/mongo/db/cmdline.h:23:
/opt/mongo/include/mongo/platform/process_id.h:107:19: error: class template specialization of 'hash' must originally be declared in namespace 'boost'
template<> struct hash< ::mongo::ProcessId > {
^
/opt/boost/include/boost/functional/hash/hash_fwd.hpp:23:31: note: explicitly specialized declaration is here
template <class T> struct hash;
^
In file included from simple_client_demo.cpp:32:
In file included from ./dbclient.h:32:
In file included from /opt/mongo/include/mongo/client/connpool.h:23:
In file included from /opt/mongo/include/mongo/client/dbclientinterface.h:27:
In file included from /opt/mongo/include/mongo/util/net/message.h:21:
In file included from /opt/mongo/include/mongo/util/net/hostandport.h:21:
In file included from /opt/mongo/include/mongo/db/cmdline.h:23:
/opt/mongo/include/mongo/platform/process_id.h:109:16: error: implicit instantiation of undefined template 'boost::hash<unsigned int>'
return hash< ::mongo::uint32_t >()(pid.asUInt32());
^
/opt/boost/include/boost/functional/hash/hash_fwd.hpp:23:31: note: template is declared here
template <class T> struct hash;
^
3 errors generated.

I realized that the file , platform/process_id.h that gives me the erros ir quite new (just 16 dayss old):
https://github.com/mongodb/mongo/commits/master/src/mongo/platform/process_id.h

And if I delete the lines

106 MONGO_HASH_NAMESPACE_START
107 template<> struct hash< ::mongo::ProcessId > {
108 size_t operator()(const ::mongo::ProcessId pid) const

{ 109 return hash< ::mongo::uint32_t >()(pid.asUInt32()); 110 }

111 };
112 MONGO_HASH_NAMESPACE_END

The code compiles and it is executed without any issue. (My actual work arround)

By the way, if I compile without the -std=c++11 flag, it is compiled without any error.

I also tried to compiled mongodb with clang:
scons --full install --64=FORCE64 -j 16 --prefix /opt/mongo --use-system-boost --extrapath=/opt/boost/ --cc=clang --cxx=clang++ --c++11 --allocator=system

but I got the same erros:
In file included from src/mongo/platform/process_id.cpp:18:
src/mongo/platform/process_id.h:107:19: error: explicit specialization of non-template struct 'hash'
template<> struct hash< ::mongo::ProcessId > {
^ ~~~~~~~~~~~~~~~~~~~~~~
src/mongo/platform/process_id.h:109:20: error: expected '(' for function-style cast or type construction
return hash< ::mongo::uint32_t >()(pid.asUInt32());
~~~~^
src/mongo/platform/process_id.h:109:40: error: expected '(' for function-style cast or type construction
return hash< ::mongo::uint32_t >()(pid.asUInt32());
~~~~~~~~~~~~~~~~~ ^
src/mongo/platform/process_id.h:109:42: error: expected expression



 Comments   
Comment by auto [ 02/Jul/13 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@10gen.com'}

Message: SERVER-9881 Use presence of a certain type_trait to detect libstdc++ 4.6.0 or better
Branch: master
https://github.com/mongodb/mongo/commit/2eceeb6202c17313fbcfe0cc101ec645b28bb350

Comment by Andrew Morrow (Inactive) [ 10/Jun/13 ]

Closing as works as designed since we never intended to support building in C++11 mode on darwin against Apple's libstc++. We did add some code to reject attempts to do this.

Comment by auto [ 10/Jun/13 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@10gen.com'}

Message: SERVER-9881 Reject attempts to build in C+11 mode with ancient libstdc+
Branch: master
https://github.com/mongodb/mongo/commit/713734e41357a96592ace944ad71f5982211f31b

Comment by Felipe Albrecht [ 08/Jun/13 ]

FYI: the problem with boost is in the chrono library and it is an already know issue:
https://github.com/Valloric/YouCompleteMe/issues/124 (as an example)

Comment by Felipe Albrecht [ 08/Jun/13 ]
  • Yes, sorry, I did not expressed well. But, anyway, it will not work because the boost issue.
  • Thank you for pointing it out. In a "few weeks" they will have a new version supporting C++11.
  • I pass it. I will try to check if it is a local problem or googling around. Meanwhile I will use mongodb with clang/gnu+98/libstd+.

Thank you for the help!

Comment by Andrew Morrow (Inactive) [ 08/Jun/13 ]
  • I don't think that what you wrote is exactly what you meant. Perhaps something like: if you are using clang in C++11 mode on OS X, it should default to libc++ and if you are using C++11 on any platform, automatically disable tcmalloc? That seems reasonable and easy enough to do.
  • You will need to work with the boost and/or libc++ developers to figure out the boost issue.
Comment by Felipe Albrecht [ 08/Jun/13 ]
  • If mongodb is being built with clang, it should be set "--cxx=clang++ --c++11 --allocator=system" automatically.
  • Another issue is that TCmalloc is not supported when using c++11.
  • Should I must to create another issue for the Boost?
    The boost problem is:

clang++ -std=c+11 -stdlib=libc+ -I/opt/mongo/include -I/opt/boost/include -L/opt/boost-clang/lib/ -L/opt/mongo/lib/ -lmongoclient -lboost_thread -lboost_filesystem -lboost_program_options -lboost_system simple_client_demo.cpp -o test
In file included from simple_client_demo.cpp:32:
In file included from ./dbclient.h:30:
In file included from /opt/mongo/include/mongo/pch.h:78:
In file included from /opt/mongo/include/mongo/util/goodies.h:22:
In file included from /opt/boost/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost/include/boost/chrono/duration.hpp:353:49: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR float lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost/include/boost/chrono/duration.hpp:355:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<float>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from simple_client_demo.cpp:32:
In file included from ./dbclient.h:30:
In file included from /opt/mongo/include/mongo/pch.h:78:
In file included from /opt/mongo/include/mongo/util/goodies.h:22:
In file included from /opt/boost/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost/include/boost/chrono/duration.hpp:361:50: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost/include/boost/chrono/duration.hpp:363:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<double>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from simple_client_demo.cpp:32:
In file included from ./dbclient.h:30:
In file included from /opt/mongo/include/mongo/pch.h:78:
In file included from /opt/mongo/include/mongo/util/goodies.h:22:
In file included from /opt/boost/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost/include/boost/chrono/duration.hpp:369:55: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR long double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost/include/boost/chrono/duration.hpp:371:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<long double>::max)();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
3 errors generated.

Comment by Andrew Morrow (Inactive) [ 08/Jun/13 ]
  • It is possible to use modern versions of libstdc++ in C++11 mode with both clang and GCC. However, the version of libstdc++ that Apple ships on OS X is ancient (4.2.1) and not C++11 aware (it doesn't even honor _GXX_EXPERIMENTAL_CXX0X_). Apple will not be updating it. There is basically no point trying to use the XCode provided libstdc++ in C++11 mode.
  • The error you are getting is new because the code is new. But the code is not wrong: we simply don't support building in C+
    +11 mode with such an old version of the libstdc++ runtime right now, and it is very doubtful that we will do so in the future. The principle issue is that libstdc++ 4.2.1, not being C++11 aware, doesn't know that in C++11 mode that struct hash belongs in namespace std, rather than in std::tr1. Our headers detect that you are using C++11 mode and so expect to find hash in namespace std, and this will fail with libstdc++ 4.2.1 because it places it in std::tr1. If you want to build in C++11 mode with libstdc++ on OS X, you need to use something like MacPorts GCC, which installs a newer libstdc++ to go with its GCC revision.
  • I think your boost errors are a separate issue.
Comment by Felipe Albrecht [ 08/Jun/13 ]

Hello,
I disagree that libstd++ is the problem, as the error is an error during the compilation and only in a very new code. For old 2.5 code, it works fine. Also it works if I delete/comment the affected lines. And it is possible to use clang C+11 with libstd+.

Anyway, I am trying to compile mongo using this command:
scons --full install --64=FORCE64 -j 16 --prefix /opt/mongo-new/ --use-system-boost --extrapath=/opt/boost-clang-libc+/ --cc=clang --cxx=clang+ --c+11 --allocator=system --libc+ --osx-version-min=10.7

and I am getting a lot of errors with boost:
(Apropos, the boost was compiled with clang and libc++)

/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:353:49: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR float lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:355:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<float>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/index/btree_based_builder.cpp:17:
In file included from src/mongo/db/index/btree_based_builder.h:21:
In file included from src/mongo/db/jsobj.h:31:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:361:50: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:363:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<double>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/index/btree_based_builder.cpp:17:
In file included from src/mongo/db/index/btree_based_builder.h:21:
In file included from src/mongo/db/jsobj.h:31:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:369:55: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR long double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:371:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<long double>::max)();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/repl/oplogreader.cpp:17:
In file included from src/mongo/db/repl/oplogreader.h:23:
In file included from src/mongo/client/dbclientcursor.h:20:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:353:49: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR float lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:355:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<float>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/repl/oplogreader.cpp:17:
In file included from src/mongo/db/repl/oplogreader.h:23:
In file included from src/mongo/client/dbclientcursor.h:20:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:361:50: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:363:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<double>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/repl/oplogreader.cpp:17:
In file included from src/mongo/db/repl/oplogreader.h:23:
In file included from src/mongo/client/dbclientcursor.h:20:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:369:55: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR long double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:371:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<long double>::max)();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/introspect.cpp:19:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:353:49: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR float lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:355:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<float>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/introspect.cpp:19:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:361:50: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:363:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<double>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/introspect.cpp:19:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:369:55: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR long double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:371:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<long double>::max)();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/compact.cpp:21:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:353:49: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR float lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:355:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<float>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/compact.cpp:21:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:361:50: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:363:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<double>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/compact.cpp:21:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:369:55: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR long double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:371:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<long double>::max)();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/stats/top.cpp:19:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:353:49: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR float lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:355:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<float>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/stats/top.cpp:19:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:361:50: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:363:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<double>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/stats/top.cpp:19:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:369:55: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR long double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:371:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<long double>::max)();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/repl/replset_commands.cpp:17:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:353:49: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR float lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:355:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<float>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/repl/replset_commands.cpp:17:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:361:50: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:363:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<double>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/repl/replset_commands.cpp:17:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:369:55: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR long double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:371:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<long double>::max)();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/commands/find_and_modify.cpp:19:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:353:49: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR float lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:355:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<float>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/commands/find_and_modify.cpp:19:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:361:50: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:363:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<double>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/commands/find_and_modify.cpp:19:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:369:55: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR long double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:371:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<long double>::max)();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/commands.cpp:20:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:353:49: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR float lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:355:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<float>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/commands.cpp:20:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:361:50: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:363:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<double>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/commands.cpp:20:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:369:55: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR long double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:371:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<long double>::max)();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/commands/server_status.cpp:19:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:353:49: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR float lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:355:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<float>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/commands/server_status.cpp:19:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:361:50: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:363:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<double>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/commands/server_status.cpp:19:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:369:55: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR long double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:371:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<long double>::max)();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/auth/action_set.cpp:16:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:353:49: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR float lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:355:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<float>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/auth/action_set.cpp:16:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:361:50: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:363:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<double>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/auth/action_set.cpp:16:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:369:55: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR long double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:371:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<long double>::max)();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/d_concurrency.cpp:19:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:353:49: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR float lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:355:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<float>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/d_concurrency.cpp:19:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:361:50: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:363:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<double>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/d_concurrency.cpp:19:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:369:55: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR long double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:371:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<long double>::max)();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
3 errors generated.
scons: *** [build/darwin/64/allocator_system/c++11/cc_clang/cxx_clang++/extrapath__opt_boost-clang-libc++_/libc++/use-system-boost/mongo/db/auth/authz_session_external_state.o] Error 1
In file included from src/mongo/db/commands/fail_point_cmd.cpp:23:
In file included from src/mongo/db/commands.h:24:
In file included from src/mongo/db/auth/authorization_manager.h:25:
In file included from src/mongo/db/auth/authz_manager_external_state.h:24:
In file included from src/mongo/db/jsobj.h:31:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:353:49: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR float lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:355:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<float>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/commands/fail_point_cmd.cpp:23:
In file included from src/mongo/db/commands.h:24:
In file included from src/mongo/db/auth/authorization_manager.h:25:
In file included from src/mongo/db/auth/authz_manager_external_state.h:24:
In file included from src/mongo/db/jsobj.h:31:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:361:50: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:363:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<double>::max) ();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
In file included from src/mongo/db/commands/fail_point_cmd.cpp:23:
In file included from src/mongo/db/commands.h:24:
In file included from src/mongo/db/auth/authorization_manager.h:25:
In file included from src/mongo/db/auth/authz_manager_external_state.h:24:
In file included from src/mongo/db/jsobj.h:31:
In file included from src/mongo/pch.h:78:
In file included from src/mongo/util/goodies.h:22:
In file included from /opt/boost-clang-libc++/include/boost/thread/condition_variable.hpp:16:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/condition_variable.hpp:9:
In file included from /opt/boost-clang-libc++/include/boost/thread/pthread/timespec.hpp:20:
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:369:55: error: constexpr function never produces a constant expression
static BOOST_CHRONO_LIB_CONSTEXPR long double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
^
/opt/boost-clang-libc++/include/boost/chrono/duration.hpp:371:21: note: non-constexpr function 'max' cannot be used in a constant expression
return -(std::numeric_limits<long double>::max)();
^
/usr/bin/../lib/c++/v1/limits:443:43: note: declared here
_LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT

{return __base::max();}

^
3 errors generated.
scons: *** [build/darwin/64/allocator_system/c++11/cc_clang/cxx_clang++/extrapath__opt_boost-clang-libc++_/libc++/use-system-boost/mongo/db/auth/action_set.o] Error 1
3 errors generated.
scons: *** [build/darwin/64/allocator_system/c++11/cc_clang/cxx_clang++/extrapath__opt_boost-clang-libc++_/libc++/use-system-boost/mongo/db/stats/top.o] Error 1
3 errors generated.
scons: *** [build/darwin/64/allocator_system/c++11/cc_clang/cxx_clang++/extrapath__opt_boost-clang-libc++_/libc++/use-system-boost/mongo/db/commands.o] Error 1
3 errors generated.
scons: *** [build/darwin/64/allocator_system/c++11/cc_clang/cxx_clang++/extrapath__opt_boost-clang-libc++_/libc++/use-system-boost/mongo/db/commands/fail_point_cmd.o] Error 1
3 errors generated.
scons: *** [build/darwin/64/allocator_system/c++11/cc_clang/cxx_clang++/extrapath__opt_boost-clang-libc++_/libc++/use-system-boost/mongo/db/compact.o] Error 1
3 errors generated.
scons: *** [build/darwin/64/allocator_system/c++11/cc_clang/cxx_clang++/extrapath__opt_boost-clang-libc++_/libc++/use-system-boost/mongo/db/introspect.o] Error 1
3 errors generated.
scons: *** [build/darwin/64/allocator_system/c++11/cc_clang/cxx_clang++/extrapath__opt_boost-clang-libc++_/libc++/use-system-boost/mongo/db/d_concurrency.o] Error 1
3 errors generated.
scons: *** [build/darwin/64/allocator_system/c++11/cc_clang/cxx_clang++/extrapath__opt_boost-clang-libc++_/libc++/use-system-boost/mongo/db/commands/server_status.o] Error 1
3 errors generated.
scons: *** [build/darwin/64/allocator_system/c++11/cc_clang/cxx_clang++/extrapath__opt_boost-clang-libc++_/libc++/use-system-boost/mongo/db/repl/oplogreader.o] Error 1
3 errors generated.
scons: *** [build/darwin/64/allocator_system/c++11/cc_clang/cxx_clang++/extrapath__opt_boost-clang-libc++_/libc++/use-system-boost/mongo/db/repl/oplog.o] Error 1
3 errors generated.
scons: *** [build/darwin/64/allocator_system/c++11/cc_clang/cxx_clang++/extrapath__opt_boost-clang-libc++_/libc++/use-system-boost/mongo/db/commands/find_and_modify.o] Error 1
3 errors generated.
scons: *** [build/darwin/64/allocator_system/c++11/cc_clang/cxx_clang++/extrapath__opt_boost-clang-libc++_/libc++/use-system-boost/mongo/db/index/btree_based_builder.o] Error 1
3 errors generated.
scons: *** [build/darwin/64/allocator_system/c++11/cc_clang/cxx_clang++/extrapath__opt_boost-clang-libc++_/libc++/use-system-boost/mongo/db/repl/replset_commands.o] Error 1
3 errors generated.
scons: *** [build/darwin/64/allocator_system/c++11/cc_clang/cxx_clang++/extrapath__opt_boost-clang-libc++_/libc++/use-system-boost/mongo/db/commands/mr.o] Error 1
scons: building terminated because of errors.

Comment by Andrew Morrow (Inactive) [ 08/Jun/13 ]

I believe the root problem here is that Apple's libstdc++ is too old. Probably, when C++11 mode is enabled, we should verify that we are not using an ancient libstdc++ by checking __GLIBCXX__ against the list of released versions: http://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html#abi.versioning

On Apple, when using the Apple supplied toolchain, using libc++ is the way to go for C++11 support, by passing --libc++ to the mongodb build. When doing so, you will also need to specify --osx-version-min=10.7 or better, since libc++ is not enabled for builds targeting older releases.

Generated at Thu Feb 08 03:21:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.