-
-
Save giwa/b1fb1e44dc0a7d270881 to your computer and use it in GitHub Desktop.
$ wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo | |
$ yum install devtoolset-2-gcc devtoolset-2-binutils | |
$ yum install devtoolset-2-gcc-c++ devtoolset-2-gcc-gfortran | |
$ /opt/rh/devtoolset-2/root/usr/bin/gcc --version | |
gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15) | |
Copyright (C) 2013 Free Software Foundation, Inc. | |
This is free software; see the source for copying conditions. There is NO | |
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
scl enable devtoolset-2 bash |
source /opt/rh/devtoolset-2/enable |
works, thank you.
Works like a charm. Thanks :D
when typed the code
yum install devtoolset-2-gcc devtoolset-2-binutils
and
yum install devtoolset-2-gcc-c++ devtoolset-2-gcc-gfortran
.
the following error came out:
http://people.centos.org/tru/devtools-2/6Server/x86_64/RPMS/repodata/repomd.xml:` [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: testing-devtools-2-centos-6Server. Please verify its path and try again
How can I fix this problem?
oh~
I fix the problem by edit the file /etc/yum.repos.d/devtools-2.repo
:
change the
http://people.centos.org/tru/devtools-2/$releasever/$basearch/RPMS
to
http://people.centos.org/tru/devtools-2/6/x86_64/RPMS
and then follow the code above, it works.
thanks a lot!
and for reference for those like me.
to make native gcc use exports:
export CC=/opt/rh/devtoolset-2/root/usr/bin/gcc
export CPP=/opt/rh/devtoolset-2/root/usr/bin/cpp
export CXX=/opt/rh/devtoolset-2/root/usr/bin/c++
i used this way to compile swoole-4.2.1 on centos 6.9 php 7.1
Saved my life after googling here and there for like 3 hours.... phew.. Thanks mate.
In my case I was not able to install couchbase on CentOS 6.8 with g++ 4.7.
Below was the error (hopefully Google indexes it and people can find solution to this error easily).
/root/.node-gyp/8.14.0/include/node/v8-platform.h:133:11: error: overriding ‘virtual v8::Platform::~Platform() noexcept (true)’ make: *** [Release/obj.target/couchbase_impl/src/couchbase_impl.o] Error 1 make: Leaving directory
/opt/executron/node_modules/couchbase/build'
gyp ERR! build error
gyp ERR! stack Error: make
failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 2.6.32-573.8.1.el6.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /opt/executron/node_modules/couchbase
gyp ERR! node -v v8.14.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! couchbase@2.6.2 install: prebuild-install || node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the couchbase@2.6.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-12-08T15_04_39_398Z-debug.log
`
tank you!!! This really helps to install sassc ruby gem (it needs g++ compiler more than 4.5.0) on old centos systems!
This worked! Thanks!