YunjinJang
YunjinJang

Reputation: 165

How do I install gcc 6.x on Oracle Solaris 11.2 x86 and CentOS 6.6 Final?

I tried to install... but failed

  1. $ wget https://ftp.gnu.org/gnu/gcc/gcc-6.2.0/gcc-6.2.0.tar.bz2
  2. $ tar -jxvf gcc-6.2.0.tar.bz2
  3. $ cd /home/logvadmin/gcc-6.2.0/
  4. $ ./contrib/download_prerequisites
  5. $ ./configure --prefix=/usr/gcc-6.2.0 --enable-languages=c,c++ --disable-multilib
  6. $ make

In phase 6 Error

[Solaris] make: Fatal error in reader: Makefile, line 27: Unexpected end of line seen

$ vi Makefile

26: ifeq (,$(.VARIABLES)) # The variable .VARIABLES, new with 3.80, is never empty. 27: $(error GNU make version 3.80 or newer is required.) 28: endif

user@solaris:~/gcc-6.2.0$ gcc --version gcc (GCC) 4.5.2 Copyright (C) 2010 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.

[CentOS] It takes too long to build. 6 hour ??

I dont know what the problem is..

Upvotes: 0

Views: 933

Answers (1)

Paul Floyd
Paul Floyd

Reputation: 6946

As the comments point out, use gmake.

For full details, see https://gcc.gnu.org/install/index.html

I fairly regularly build GCC from SVN head on Solaris 11.3 amd64, Fedora 24 x64 and FreeBSD 11 x64.

Firstly, I built and installed libgmp, lbmpc and libmpfr to ~/tools/lib. You may not need to do this if you are using a recent Linux or FreeBSB. On Solaris, third party freeware is often many years out of data.

My configure script for Solaris is:

#!/bin/ksh93

export LD_RUN_PATH=/export/home/paulf/tools/lib/lib
 ../configure --prefix=/export/home/paulf/tools/gcc --with-gmp=/export/home/paulf/tools/lib --with-gnu-as --with-as=/usr/ccs/bin/gas --without-gnu-ld --with-ld=/usr/ccs/bin/ld 

My update & build script is:

#!/bin/ksh

export LD_RUN_PATH=~/tools/lib/lib

cd ~/scratch/gcc
svn up
cd build
gmake -j 4

if (( $? == 0 )) ; then
    print gmake succeeded
   gmake install
fi

Note that if you don't set the run path then the default GCC build won't set it and you will have an essentially broken compiler that needs LD_LIBRARY_PATH

Upvotes: 2

Related Questions