gcc-4.6.2 build problem related to xgcc not liking '-V' option on i686-pc-linux-gnu

Sinkler, Wharton Wharton.Sinkler@uop.com
Mon Nov 7 20:28:00 GMT 2011


Jonathan,

It should be simple.  But to be fair, there's no mention of the ./contrib/download_prerequisites on the installation website (gcc.gnu.org/install) which is probably the first thing people wanting to install gcc will find.  

Also, the prerequisites page essentially tells you to download and install the support libraries, and to put them into the library search path using --with-gmp=/ (etc.).  It even gives you links to the tar.gz files.  The default installation the puts them on /usr/local.  

Anyway, doing all that did not work initially, then sort of did work by setting the LD_LIBRARY_PATH.  However, I am having problems with the compilers, possibly since I've gummed things up pretty well at this point.  

So I'd like to redo everything using the ./contrib./download_prerequisites script.  When I do that now, the make fails because I have two versions of gmp on the system, one in /usr/lib (version 3) and the other on /usr/local/lib (version 4).  Here's the error:

/usr/bin/ld: warning: libgmpxx.so.4, needed by /usr/local/lib/libppl_c.so, may conflict with libgmpxx.so.3
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libgmpxx.so: undefined reference to `__gmp_doprnt_mpf'
collect2: ld returned 1 exit status

What is your recommendation concerning how to deal with this?  Should I uninstall then re-install gmp-4.3.2 with --prefix=/usr/lib?  I would assume I need to uninstall gmp-3.3.3 first, but would appreciate any recommendations on how to do that cleanly.  

Thanks again,
Wharton


-----Original Message-----
From: Jonathan Wakely [mailto:jwakely.gcc@gmail.com] 
Sent: Monday, November 07, 2011 11:40 AM
To: Sinkler, Wharton
Cc: gcc-help@gcc.gnu.org
Subject: Re: gcc-4.6.2 build problem related to xgcc not liking '-V' option on i686-pc-linux-gnu

On 7 November 2011 17:29, Andrew Haley wrote:
> On 11/07/2011 05:25 PM, Jonathan Wakely wrote:
>> N.B. having to set LD_LIBRARY_PATH is ***not*** a good solution, and I
>> hope any writeup which suggests doing that will be rejected. The
>> simplest solution is to install GCC from pre-built packages from
>> someone who knows what they're doing, the next best is to link to gmp,
>> mpfr and mpc statically so LD_LIBRARY_PATH is not needed.
>
> Indeed.  Run ./contrib/download_prerequisites in the top-level dir and
> then build gcc.

Which is exactly what my blog post says to do.

I used to give instructions to unpack the prerequisites manually, but
wrote a new version after learning of the download_prerequisites
script from Andrew, and that new version is about as simple as it can
be:

  # the version you will build
  gccver=4.6.2
  # where you put the downloaded source packages
  pkgdir=$HOME
  # where you will build gcc
  rootdir=$HOME/gcc-tmp
  # where you want to install gcc
  prefix=/opt/gcc-${gccver}
  # the languages you want gcc to support
  langs=c,c++

  mkdir ${rootdir}
  cd ${rootdir}
  tar xzf ${pkgdir}/gcc-${gccver}.tar.gz

  cd gcc-${gccver}
  ./contrib/download_prerequisites
  cd ..

  mkdir objdir
  cd objdir

  ${rootdir}/gcc-${gccver}/configure --prefix=${prefix}
--enable-languages=${langs}

  make
  make install

Is it the variables that make it complicated?  Without them you'd need
to keep editing bits of the text if you're trying to build a different
version to the one in the example, but here you go, if you prefer:

  mkdir tmpdir
  cd tmpdir
  UNPACK THE SOURCE ARCHIVE

  cd gcc-4.6.2
  ./contrib/download_prerequisites
  cd ..

  mkdir objdir
  cd objdir

  ../gcc-4.6.2/configure --prefix=/opt/gcc-4.6.2 --enable-languages=c,c++

  make
  make install

How do you intend to write that up to be any simpler?

The version with variables is more flexible, because it makes it
should be clear that all the user-adjustable bits are the variables at
the start, the rest should be done verbatim.



More information about the Gcc-help mailing list