Hi.I am having a hard time trying to build MongoDB from it's sources:I checked out the git repository and switched to the r3.4.9 tag.1. using Arch Linux, the build failed because warnings were treated as errors and GCC is version 7.2.0... (compiler too new)
2. after having disabled `-Werror` (fair enough), the build failed because of a linking error. (I don't have the message anymore)
3. I switched to Debian Jessie (because that's the base image of the mongo Docker image), but the build failed (compiler too old)
Despite `docs/building.md` stating that "GCC 4.8.2 or newer" is required and Debian Jessie's GCC is version 4.9.x, it bails out saying that version 5.3.0 or newer is required.
5. after `apt-get install git`, the build succeeded (yay!)
6. trying to build the unitttests fails```$ scons --disable-warnings-as-errors=true unittests...Compiling build/opt/mongo/base/parse_number_test.oIn file included from src/mongo/base/parse_number_test.cpp:37:0:src/mongo/base/parse_number_test.cpp:295:49: error: exponent has no digitsASSERT_PARSES(double, "0xabcab.defdefP-10", 0xabcab.defdefP-10);^src/mongo/unittest/unittest.h:106:93: note: in definition of macro '_ASSERT_COMPARISON'::mongo::unittest::ComparisonAssertion_##COMPARISON(__FILE__, __LINE__, #a, #b, a, b)) \^src/mongo/unittest/unittest.h:85:29: note: in expansion of macro 'ASSERT_EQ'#define ASSERT_EQUALS(a, b) ASSERT_EQ(a, b)^~~~~~~~~src/mongo/base/parse_number_test.cpp:44:9: note: in expansion of macro 'ASSERT_EQUALS'ASSERT_EQUALS(static_cast<TYPE>(EXPECTED_VALUE), v); \^~~~~~~~~~~~~src/mongo/base/parse_number_test.cpp:295:5: note: in expansion of macro 'ASSERT_PARSES'ASSERT_PARSES(double, "0xabcab.defdefP-10", 0xabcab.defdefP-10);^~~~~~~~~~~~~scons: *** [build/opt/mongo/base/parse_number_test.o] Error 1```
How can I build mongodb from sources (I want to make changes)?What is the build environment that I should use to not run into troubles constantly? I already lost 2 days trying in vain to at least build the server, let alone the unit tests.
On Wed, Sep 20, 2017 at 7:58 AM, <cb...@exa-online.de> wrote:1. using Arch Linux, the build failed because warnings were treated as errors and GCC is version 7.2.0... (compiler too new)2. after having disabled `-Werror` (fair enough), the build failed because of a linking error. (I don't have the message anymore)As you found, --disable-warnings-as-errors is the correct approach. We require warning free builds for our developers when using our official toolchains, so it is important that the default be that warnings as errors.
3. I switched to Debian Jessie (because that's the base image of the mongo Docker image), but the build failed (compiler too old)Despite `docs/building.md` stating that "GCC 4.8.2 or newer" is required and Debian Jessie's GCC is version 4.9.x, it bails out saying that version 5.3.0 or newer is required.Yes, this looks like a bug.The building.md file is correct on master but appears to not accurately reflect that GCC 5.4 is required on the 3.4 branch. However, for the 3.4 branch, only clang 3.4 is required.Would you please file an issue here: https://jira.mongodb.org/projects/SERVER and we will get this corrected.
6. trying to build the unitttests fails```$ scons --disable-warnings-as-errors=true unittests...Compiling build/opt/mongo/base/parse_number_test.oIn file included from src/mongo/base/parse_number_test.cpp:37:0:src/mongo/base/parse_number_test.cpp:295:49: error: exponent has no digitsASSERT_PARSES(double, "0xabcab.defdefP-10", 0xabcab.defdefP-10);^src/mongo/unittest/unittest.h:106:93: note: in definition of macro '_ASSERT_COMPARISON'::mongo::unittest::ComparisonAssertion_##COMPARISON(__FILE__, __LINE__, #a, #b, a, b)) \^src/mongo/unittest/unittest.h:85:29: note: in expansion of macro 'ASSERT_EQ'#define ASSERT_EQUALS(a, b) ASSERT_EQ(a, b)^~~~~~~~~src/mongo/base/parse_number_test.cpp:44:9: note: in expansion of macro 'ASSERT_EQUALS'ASSERT_EQUALS(static_cast<TYPE>(EXPECTED_VALUE), v); \^~~~~~~~~~~~~src/mongo/base/parse_number_test.cpp:295:5: note: in expansion of macro 'ASSERT_PARSES'ASSERT_PARSES(double, "0xabcab.defdefP-10", 0xabcab.defdefP-10);^~~~~~~~~~~~~scons: *** [build/opt/mongo/base/parse_number_test.o] Error 1```This has been fixed on master as part of https://jira.mongodb.org/browse/SERVER-23420, I've gone ahead and requested backport to 3.4.
How can I build mongodb from sources (I want to make changes)?What is the build environment that I should use to not run into troubles constantly? I already lost 2 days trying in vain to at least build the server, let alone the unit tests.If you are hoping to make changes to mongodb, I recommend actually working against the master branch, not a stable branch. Our workflow is that we make fixes on master and backport them to the older branches. Feature development only happens on master and is never backported.
Note that if you do upgrade to the master branch you will find that you need at least GCC 5.4 or clang 3.8, which will make your system requirements that much stricter.
Personally, I develop on Ubuntu 16.04 which has both GCC 5.4 and clang 3.{8,9} and it works well for me.
Hi Andrew,thanks for your reply, I appreciate it!
Am Mittwoch, 20. September 2017 14:25:25 UTC+2 schrieb acm:On Wed, Sep 20, 2017 at 7:58 AM, <cb...@exa-online.de> wrote:1. using Arch Linux, the build failed because warnings were treated as errors and GCC is version 7.2.0... (compiler too new)2. after having disabled `-Werror` (fair enough), the build failed because of a linking error. (I don't have the message anymore)As you found, --disable-warnings-as-errors is the correct approach. We require warning free builds for our developers when using our official toolchains, so it is important that the default be that warnings as errors.It would be good if the "official toolchain" was documented, e.g. like "we recommend GCC 5.3.x - if you use anything else you're on your own".
I'll see whether I can reproduce the linking error, when I have the time. Or, is anybody else using GC 7.2 and ran into a linking error already?
3. I switched to Debian Jessie (because that's the base image of the mongo Docker image), but the build failed (compiler too old)Despite `docs/building.md` stating that "GCC 4.8.2 or newer" is required and Debian Jessie's GCC is version 4.9.x, it bails out saying that version 5.3.0 or newer is required.Yes, this looks like a bug.The building.md file is correct on master but appears to not accurately reflect that GCC 5.4 is required on the 3.4 branch. However, for the 3.4 branch, only clang 3.4 is required.Would you please file an issue here: https://jira.mongodb.org/projects/SERVER and we will get this corrected.Done: SERVER-31197
On Thu, Sep 21, 2017 at 4:01 AM, <cb...@exa-online.de> wrote:
Am Mittwoch, 20. September 2017 14:25:25 UTC+2 schrieb acm:The building.md file is correct on master but appears to not accurately reflect that GCC 5.4 is required on the 3.4 branch. However, for the 3.4 branch, only clang 3.4 is required.Would you please file an issue here: https://jira.mongodb.org/projects/SERVER and we will get this corrected.
Note that it looks like Jesse does have a new enough clang, so you might just be able to use that.
Hi.Am Donnerstag, 21. September 2017 13:41:23 UTC+2 schrieb acm:On Thu, Sep 21, 2017 at 4:01 AM, <cb...@exa-online.de> wrote:
Am Mittwoch, 20. September 2017 14:25:25 UTC+2 schrieb acm:The building.md file is correct on master but appears to not accurately reflect that GCC 5.4 is required on the 3.4 branch. However, for the 3.4 branch, only clang 3.4 is required.Would you please file an issue here: https://jira.mongodb.org/projects/SERVER and we will get this corrected.Note that it looks like Jesse does have a new enough clang, so you might just be able to use that.FTR, building with clang on Debian Jessie did not work out, as the libstdc++ files from GCC 5.3.0 are required here too and these are not available...
I want to build executables targeting Debian Jessie. Building on Debian stable does not work, because the libc6 is too new:```mongod: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.23' not found (required by mongod)```
Do you know how the official deb packages are build? On which platform and how?
On Wed, Oct 4, 2017 at 5:30 AM, <cb...@exa-online.de> wrote:Hi.Am Donnerstag, 21. September 2017 13:41:23 UTC+2 schrieb acm:On Thu, Sep 21, 2017 at 4:01 AM, <cb...@exa-online.de> wrote:
Am Mittwoch, 20. September 2017 14:25:25 UTC+2 schrieb acm:The building.md file is correct on master but appears to not accurately reflect that GCC 5.4 is required on the 3.4 branch. However, for the 3.4 branch, only clang 3.4 is required.Would you please file an issue here: https://jira.mongodb.org/projects/SERVER and we will get this corrected.Note that it looks like Jesse does have a new enough clang, so you might just be able to use that.FTR, building with clang on Debian Jessie did not work out, as the libstdc++ files from GCC 5.3.0 are required here too and these are not available...You should be able to select a libc++ build by adding --libc++ to your SCons invocation. Assuming that Jesse has a working libc++ that may work fine.
Do you know how the official deb packages are build? On which platform and how?What do you mean by "official"? Do you mean the ones that we, MongoDB provide, or the ones built-in to debian?
--
You received this message because you are subscribed to the Google Groups "mongodb-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-dev+unsubscribe@googlegroups.com.
To post to this group, send email to mongo...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-dev/44a3d95a-44a1-4a1c-895d-95b1071f2892%40googlegroups.com.