
OPERATIONAL DEFECT DATABASE
...

...
Hello, I'm trying to build mongodb 3.0.6 (plus this patch) on OS X 10.7 Lion. I'm using --c++11, --libc++, and a suitably new clang compiler from MacPorts. The error I get is: src/third_party/s2/s1angle.cc:28:14: error: use of undeclared identifier 'drem' radians_ = drem(radians_, 2.0 * M_PI); ^ 1 error generated. scons: *** [build/darwin/64/c++11_on/cc__Volumes_Data_macports_lion_bin_clang-mp-3.4/cxx__Volumes_Data_macports_lion_bin_clang++-mp-3.4/libc++/osx-version-min_10.7/ssl/third_party/s2/s1angle.o] Error 1 scons: building terminated because of errors. Command failed: cd "/Volumes/Data/macports/lion/var/macports/build/_Volumes_Data_macports_dports_databases_mongodb/mongodb/work/mongodb-src-r3.0.6" && /Volumes/Data/macports/lion/bin/scons all mongobridge mongosniff --cc=/Volumes/Data/macports/lion/bin/clang-mp-3.4 --cxx=/Volumes/Data/macports/lion/bin/clang++-mp-3.4 --c++11 --cpppath=/Volumes/Data/macports/lion/include --disable-warnings-as-errors --libc++ --libpath=/Volumes/Data/macports/lion/lib --osx-version-min=10.7 --ssl --64 Exit code: 2 drem is defined in src/third_party/s2/util/math/exactfloat/exactfloat.h. Maybe a #include is missing?
acm commented on Tue, 26 Jan 2016 23:11:23 +0000: Hi ryandesign - At this time we don't have any further recommendation. We are able to successfully build the MongoDB 3.0 branch with XCode 5.1.1 plus when targeting OS X 10.7 with the system libc++. Please see here for logs: https://evergreen.mongodb.com/task_log_raw/mongodb_mongo_v3.0_osx_108_compile_20d60d3491908f1ae252fe452300de3978a040c7_16_01_20_21_40_20/0?type=T While we suspect a problem with your toolchain, we aren't 100% sure. However, given the old age of the target platform, and the widespread adoption of newer OS X versions, and your success building on OS X 10.8, we don't feel that this ticket warrants further investigation. If you are able to discover a root cause we are happy to re-open and work on a fix, but constructing the necessary clean-room environments to do the root cause analysis is not something we believe to be warranted. ryandesign commented on Mon, 30 Nov 2015 12:13:23 +0000: Now I am the one who must apologize for the delay. I was having trouble finding time to set up some new OS X test machines. But it's done now. The good news is that mongodb 3.0.7 in MacPorts builds fine on OS X 10.8, forcing the use of libc++. The bad news is that it still fails on a newly set up OS X 10.7 machine, with the error originally described: error: use of undeclared identifier 'drem'. It's the same with clang 3.4.2 and clang 3.7.0, both installed by MacPorts. ramon.fernandez commented on Wed, 11 Nov 2015 19:37:57 +0000: Apologies for the radio silence here ryandesign. Is this still an issue for you? Since test.c compiles other programs using the drem() function should too – or are you still having trouble compiling 3.0.6? Thanks, Ramón. ryandesign commented on Tue, 22 Sep 2015 21:48:05 +0000: It all seems to work: $ clang-mp-3.4 -o test test.c $ otool -L test test: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0) $ ./test 1.000000 $ clang++-mp-3.4 -o test-libstdc++ test.cpp $ otool -L test-libstdc++ test-libstdc++: /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0) $ ./test-libstdc++ 1.000000 $ clang++-mp-3.4 -stdlib=libc++ -o test-libc++ test.cpp $ otool -L test-libc++ test-libc++: /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 28.4.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0) $ ./test-libc++ 1.000000 jonathan.reams@10gen.com commented on Tue, 22 Sep 2015 21:13:50 +0000: Ryan, can you try compiling this test program with your macports clang? It shouldn't require any flags, just clang -o test test.c. The drem function is part of the standard C library, so if your compiler can't find it, that would suggest that the compiler has issues. #include #include int main() { double a = 1.0, b = 2.0, r; r = drem(a, b); printf("%f\n", r); return 0; } ryandesign commented on Mon, 21 Sep 2015 20:19:41 +0000: Ah, the different problem with 3.0.4 was SERVER-13829. After specifying a shorter variant-dir, 3.0.4 builds fine. I should correct what I said above: Xcode 4.6.3 includes "Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)" as the default compiler, but your build system says that's too old: Checking if C compiler is clang 3.4 (or Apple XCode 5.1.1) or newer...no Checking if C++ compiler is clang 3.4 (or Apple XCode 5.1.1) or newer...no ERROR: Refusing to build with compiler that does not meet requirements So instead we use "clang version 3.4.2 (tags/RELEASE_34/dot2-final)" installed with MacPorts. That built 3.0.4 successfully (with libstdc++ and no C++11), but trying to build 3.0.6 (with libc++ and C++11) produces the error I reported. We do have even newer versions of clang in MacPorts that we could try. ryandesign commented on Mon, 21 Sep 2015 17:44:29 +0000: Nothing has changed; please re-open (if my adding this comment does not do so automatically; I don't know how your issue tracker works). I don't know how to answer your questions. I'm using Xcode 4.6.3 and its included copy of "Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)". This is the latest Apple toolchain that is or ever will be available for OS X 10.7. I do see a /usr/include/math.h file, which hasn't changed since 2011. I know that mongodb 2.6.6 built fine on this system. I just tried 3.0.4 again, since that's the last version that worked without C++11. I think it got past this problem, but encountered a different one; I'll file a new ticket for that. jonathan.reams@10gen.com commented on Mon, 21 Sep 2015 14:36:26 +0000: ryandesign, I haven't heard back from you on this, so I'm going to close this for now. If you have any more questions or problems, feel free to re-open this. jonathan.reams@10gen.com commented on Thu, 17 Sep 2015 15:02:27 +0000: ryandesign, are you still having issues with this? jonathan.reams@10gen.com commented on Thu, 10 Sep 2015 14:31:17 +0000: Hi Ryan, does your compiler have a valid math.h? What's your standard include path? The undefined identifier is part of the standard C library, and our use of it hasn't changed in 3 years, so I don't think this is a change on our side.
Click on a version to see all relevant bugs
MongoDB Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.