public
Last active

  • Download Gist
rhel-chef-gcc-workaround.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12
# Install gcc44 package and update-alternatives (in chkconfig)
yum -y install gcc44 chkconfig
# Check if gcc is already a link
if [ ! -L /usr/bin/gcc ]; then mv /usr/bin/gcc /usr/bin/gcc41; fi
if [ ! -L /usr/bin/g++ ]; then mv /usr/bin/g++ /usr/bin/g++41; fi
# Install update-alteratives links for gcc41 and gcc44
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc41 60 --slave /usr/bin/g++ g++ /usr/bin/g++41
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc44 40 --slave /usr/bin/g++ g++ /usr/bin/g++44
# Select gcc44 to compile gecode-3.5.0 in chef::bootstrap_server
update-alternatives --config gcc
# Repeat and select gcc41 after gecode-3.5.0 in chef::bootstrap_server is complete
# update-alternatives --config gcc
rhel-chef-gecode-3.5-error
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
[root@chef gecode-3.5.0]# ./configure
checking for the host operating system... Linux
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for ranlib... ranlib
checking for diff... ok
checking for tar... ok
checking for make... ok
checking for sed... ok
checking for perl... ok
checking how to run the C++ preprocessor... g++ -E
configure: error: Your version of gcc is too old. You need at least version 4.2.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.