Hi @Stennie Thanks for your reply. please find my inline comments
What version of MongoDB Server ( x.y.z
) are you trying to build?
I’m trying to build MongoDB server 4.2.3. The error which I posted is resolved after adding a parameter MONGO_VERSION=4.2.3 as below.
$ python3.8 buildscripts/scons.py install-mongod MONGO_VERSION=4.2.3
But it is refusing to build with compiler that does not meet requirement.
$ python3.8 buildscripts/scons.py install-mongod MONGO_VERSION=4.2.3
scons: Reading SConscript files ...
scons: running with args /usr/local/bin/python3.8 buildscripts/scons.py install-mongod MONGO_VERSION=4.2.3
scons version: 3.0.4
python version: 3 8 3 'final' 0
CC is gcc
gcc found in $PATH at /opt/rh/devtoolset-8/root/usr/bin/gcc
CXX is g++
g++ found in $PATH at /opt/rh/devtoolset-8/root/usr/bin/g++
Checking whether the C compiler works... yes
Checking whether the C++ compiler works... yes
Checking that the C++ compiler can link a C++ program... yes
Checking if C++ compiler "g++" is GCC... yes
Checking if C compiler "gcc" is GCC... yes
Detected a x86_64 processor
Checking if target OS linux is supported by the toolchain... yes
**Checking if C compiler is GCC 8.2 or newer...no**
**Checking if C++ compiler is GCC 8.2 or newer...no**
ERROR: Refusing to build with compiler that does not meet requirements
See /home/mongoadm/mongo-r4.2.3/build/scons/config.log for details
$ tail /home/mongoadm/mongo-r4.2.3/build/scons/config.log
|int main(int argc, char* argv[]) {
| return 0;
|}
|
Compiling build/scons/opt/sconf_temp/conftest_12.o
build/scons/opt/sconf_temp/conftest_12.cpp:7:2: error: #error GCC 8.2 or newer is required to build MongoDB
#error GCC 8.2 or newer is required to build MongoDB
^
scons: Configure: no
It is showing that GCC 8.2 or newer is required to build MongoDB. But I already installed GCC 8.3 version
$/opt/rh/devtoolset-8/root/usr/bin/gcc --version
gcc (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
$/opt/rh/devtoolset-8/root/usr/bin/g++ --version
g++ (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.6 (Maipo)
I tried below command also but no luck
python3.8 buildscripts/scons.py install-mongod MONGO_VERSION=4.2.3 --CC=/opt/rh/devtoolset-8/root/usr/bin/gcc --CXX=/opt/rh/devtoolset-8/root/usr/bin/g++ --disable-warnings-as-errors
What is your motivation for building from source?
This is my client requirement to provide security. Client don’t want to install mongodb with RPM’s
Regards,
Satya