I'm trying to compile node-5.1.0 in CentOS 6.7 but is asking for g++ 4.8 or above.
[root@ws node-v5.1.0]# ./configure
WARNING: C++ compiler too old, need g++ 4.8 or clang++ 3.4 (CXX=g++)
...
First I've installed "Development Tools":
[root@ws node-v5.1.0]# yum groupinstall 'Development Tools'
After I check g++
version:
[root@ws node-v5.1.0]# g++ -v
...
gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC)
Though that version isn't enough then I perform a little research and found a possible way to install/upgrade g++
. I have found this and I followed every step:
[root@ws node-v5.1.0]# wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
[root@ws node-v5.1.0]# yum install devtoolset-2-gcc devtoolset-2-binutils
[root@ws node-v5.1.0]# /opt/rh/devtoolset-2/root/usr/bin/gcc --version
gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15
...
I tried the same command again for compile NodeJS:
[root@ws node-v5.1.0]# ./configure
WARNING: C++ compiler too old, need g++ 4.8 or clang++ 3.4 (CXX=g++)
But as you can see I got the same error regarding g++ version which make me ask:
- how can I pass new installed
gcc
version to./configure
? - there is any other way to use or set that version as default?
Note: by version I mean the one at /opt/rh/devtoolset-2/root/usr/bin/gcc
if it's complete secure to change to that one
Update
After post the question I've found this and follow the same steps:
[root@ws node-v5.1.0]# export CC=/opt/rh/devtoolset-2/root/usr/bin/gcc
[root@ws node-v5.1.0]# export CPP=/opt/rh/devtoolset-2/root/usr/bin/cpp
[root@ws node-v5.1.0]# export CXX=/opt/rh/devtoolset-2/root/usr/bin/c++
But results is the same:
[root@ws node-v5.1.0]# ./configure
WARNING: C++ compiler too old, need g++ 4.8 or clang++ 3.4 (CXX=g++)