GCC Issue: Compiling Mongodb 3.0 from source

788 views
Skip to first unread message

Astro

unread,
May 9, 2016, 6:34:10 AM5/9/16
to mongodb-user

I am compiling mongodb from source using this doc.
Cloned source v3.0 from this repo https://github.com/mongodb/mongo.git

The doc states that :

       To build MongoDB, you will need:
  • C++11 to build 3.0.x branches or later 
  • A modern C++ compiler. One of the followings is required.
    • GCC 4.8.2 or newer 
    • Clang 3.4 (or Apple XCode 5.1.1 Clang) or newer
    • Visual Studio 2013 Update 4 or newer
  • Python 2.7
  • SCons 2.3
Despite all of the available dependencies met I got following error message and process exists:

Checking if C++ compiler is GCC 5.3.0 or newer...no
Checking if C compiler is GCC 5.3.0 or newer...no

Any help?

Andrew Morrow

unread,
May 9, 2016, 11:24:11 AM5/9/16
to mongod...@googlegroups.com

Hi -

We did recently update the required compilers on the master branch, and the GitHub wiki for the project has unfortunately not yet been updated to reflect those changes. We will make sure to update it. 

However, those changes only affect the master branch, which holds our current development version, currently 3.3.5. The v3.0 branch that you intend to build has not had the required compilers upgraded, and should still match the information on the wiki.

Can you double check that you succesfully checked out the v3.0 branch after you cloned? What does running 'git describe' print for you in your clone?

Thanks,
Andrew



--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: https://docs.mongodb.org/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/79ba758c-48ec-470f-8f34-ee5cb02bb40e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Astro

unread,
May 9, 2016, 1:19:32 PM5/9/16
to mongodb-user
Thanks for reaching back.

I faced the issue when I downloaded repo 3.0 and 3.0.11 using zip download.

But when the repo was cloned using git clone, that looks like working.

Not sure what goes wrong when zip is downloaded.

A

 

Andrew Morrow

unread,
May 9, 2016, 4:14:16 PM5/9/16
to mongod...@googlegroups.com

Hi -

Can you please provide the link to the zip archive that you downloaded? I'd like to verify the contents.

Happy to hear that you were able to get building after cloning.

Thanks,
Andrew


--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: https://docs.mongodb.org/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.

Astro

unread,
May 10, 2016, 12:37:33 AM5/10/16
to mongodb-user
Hi acm,


I selected branch 3.0 from UI, then Download Zip using:   https://github.com/mongodb/mongo/archive/v3.0.zip

Thanks,

Andrew Morrow

unread,
May 10, 2016, 8:45:52 AM5/10/16
to mongod...@googlegroups.com
I just pulled down those zip files for both the v3.0 branch and the r3.0.11 tag, and the top level SConstruct file in both of those definitely only enforces GCC 4.8.2, not GCC 5.3. So, I'm really not sure why you were getting that error message. That should only be possible if you had downloaded the zip file for the master branch.

Astro

unread,
May 11, 2016, 12:31:24 AM5/11/16
to mongodb-user
Thanks for looking into it.

Following are the steps to reproduce the issue:

unzip v3.0.zip
scons mongod mongos mongo 

I ran into another issue, below is the stacktrace:

scons: Reading SConscript files ...
scons version: 2.3.0
python version: 2 7 6 'final' 0
Checking whether the C++ compiler worksyes
Checking whether the C compiler worksyes
Checking if C++ compiler "g++" is GCC... yes
Checking if C compiler "gcc" is GCC... yes
Checking if C compiler is GCC 4.8.2 or newer...yes
Checking if C++ compiler is GCC 4.8.2 or newer...yes
Checking if target architecture is 32-bit x86...no
Checking if C compiler supports -Wno-unused-local-typedefs... yes
Checking if C compiler supports -Wno-unused-function... yes
Checking if C compiler supports -Wno-unused-private-field... no
Checking if C compiler supports -Wno-deprecated-declarations... yes
Checking if C compiler supports -Wno-tautological-constant-out-of-range-compare... no
Checking if C compiler supports -Wno-unused-const-variable... no
Checking if C compiler supports -Wno-unused-but-set-variable... yes
Checking if C compiler supports -Wno-missing-braces... yes
Checking if C compiler supports -Wno-inconsistent-missing-override... no
Checking if C compiler supports -Wno-potentially-evaluated-expression... no
Checking if we are using libstdc++... yes
Checking for libstdc++ 4.6.0 or better... yes
Checking if C++ compiler supports -std=c++11... yes
Checking if C compiler supports -std=c99... yes
Checking if we are on a POSIX system... yes
Checking if the POSIX monotonic clock is supported... yes
Checking if C compiler supports -fno-builtin-memcmp... yes
Checking for __thread... yes
Checking for C++11 <atomic> support... yes
Checking for C++11 is_trivially_copyable support... no
Checking for C library rt... yes
Checking for C library dl... yes
Checking for C++ header file execinfo.h... yes
Checking whether backtrace is declared... yes
Checking whether backtrace_symbols is declared... yes
Checking whether backtrace_symbols_fd is declared... yes
Checking for C library pcap... no
Checking for C library wpcap... no
Checking if __malloc_hook is declared volatile... yes
IndexError: list index out of range:
  File "/xvdh/git-debug/mongo-3.0/SConstruct", line 2576:
    env.SConscript('src/SConscript', variant_dir='$BUILD_DIR', duplicate=False)
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 546:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 260:
    exec _file_ in call_stack[-1].globals
  File "/xvdh/git-debug/mongo-3.0/src/SConscript", line 14:
    ] + module_sconscripts
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 546:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 260:
    exec _file_ in call_stack[-1].globals
  File "/xvdh/git-debug/mongo-3.0/src/mongo/SConscript", line 57:
    'util/mongoutils/SConscript'])
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 546:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 260:
    exec _file_ in call_stack[-1].globals
  File "/xvdh/git-debug/mongo-3.0/src/mongo/installer/msi/SConscript", line 90:
    major_version = "%s.%s" % (mv[0], mv[1])

Andrew Morrow

unread,
May 11, 2016, 8:45:27 AM5/11/16
to mongod...@googlegroups.com

Hi -

When you download the zip file from github that way, it doesn't give you the repository metadata, which is what the build system uses to derive a version number.

If you want to build from source, I recommend either:

- Making a complete git clone of the repository and checking out the version you are interested in building, or
- Downloading a source archive, which will contain a pre-interpolated version number.

Finally, if neither of the above is an option for you, you can explicitly pass the version and git hash that you want to set for the build by passing the SCons Variables MONGO_VERSION and MONGO_GITHASH to your SCons invocation:

scons MONGO_VERSION=x.y.z MONGO_GITHASH=none ...

Thanks,
Andrew




--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: https://docs.mongodb.org/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
Reply all
Reply to author
Forward
0 new messages