LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   gcc 4.6.3 installation gmp 5.0.5 mpfr 3.1.1 errors (https://www.linuxquestions.org/questions/linux-newbie-8/gcc-4-6-3-installation-gmp-5-0-5-mpfr-3-1-1-errors-4175439508/)

Azrael84 11-30-2012 05:31 PM

gcc 4.6.3 installation gmp 5.0.5 mpfr 3.1.1 errors
 
Hi,

I am trying to install a new gcc version (g++ version) in my home directory on a server I have access too. This server already has gcc elsewhere (and gmp etc) but older versions, and I want to locally install new ones.

I followed this guide http://advogato.org/person/redi/diary/240.html to the letter, working in my home directory. In summary I downloaded the new tars (gcc,gmp,mpfr,mpc) extracted them and moved into the sources directory of gcc (ensuring they were then named 'gmp', 'mpfr', 'mpc'). I cd out and then into the build directory (objdir) and from there ran configure. Configure goes through fine but then 'make' eventually returns:

checking for MPFR... yes
checking for recent GMP... yes
checking for recent MPFR... no
configure: error: MPFR version >= 2.4.2 required
make[2]: *** [configure-stage1-mpc] Error 1
make[2]: Leaving directory `/home/myusername/gcc-temp/objdir'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/myusername/gcc-temp/objdir'
make: *** [all] Error 2

Does it really have to be version 2.4.2? Is this the problem?

Is the fact gcc etc are already installed elsewhere messing things up?

knudfl 12-01-2012 01:32 AM

GCC 4.6.x
The configure line should include two "--with-mpfr-* " entries :

$ ../gcc-4.6.3/configure --prefix=/home/<???> --program-suffix=46 --enable-languages=c,c++ --enable-threads=posix --enable-shared --enable-__cxa_atexit --enable-clocale=gnu --disable-multilib --with-mpfr-include=$(pwd)/../gcc-4.6.3/mpfr/src --with-mpfr-lib=$(pwd)/mpfr/src/.libs

#2 http://www.linuxquestions.org/questi...-4175427303/#2

... And please do not replace '$(pwd)' with an absolute path.
(( pwd is actually the object / build directory.))

.

knudfl 12-01-2012 01:55 AM

.. And : Welcome to LQ.


Be aware that the "configure suggestion" in the advogato.org link won't make any gcc
http://advogato.org/person/redi/diary/240.html
( ${rootdir}/gcc-${gccver}/configure --prefix=${prefix} --enable-languages=${langs} )

The options shown in post #2 are the proof "minimum options".

.

Azrael84 12-01-2012 03:08 AM

thanks for the reply.
I didn't know I needed the with-mpfr options when it was already in the source directory.

Quote:

--with-mpfr-include=$(pwd)/../gcc-4.6.3/mpfr/src --with-mpfr-lib=$(pwd)/mpfr/src/.libs
Quote:

... And please do not replace '$(pwd)' with an absolute path.
(( pwd is actually the object / build directory.))
I just want to be clear on this. Here is my directory setup on the server:

/home/myusername/gcc-temp (temporary directory which will include the src and build dir for gcc)
/home/myusername/opt/gcc-4.6.3 (where I plan to install gcc)

then there is
/home/myusername/gcc-temp/gcc-4.6.3 (the source directory)
/home/myusername/gcc-temp/objdir (the build dir)

I have tar GMP,MPFR,MPC into /home/myusername/gcc-temp/gcc-4.6.3 and called them gmp,mpfr,mpc. I then cd in to 'objdir' and with your options I would run

/home/myusername/gcc-temp/gcc-4.6.3/configure --prefix=/home/myusername/opt/gcc-4.6.3 --program-suffix=46 --enable-languages=c,c++ --enable-threads=posix --enable-shared --enable-__cxa_atexit --enable-clocale=gnu --disable-multilib --with-mpfr-include=$(pwd)/../gcc-4.6.3/mpfr/src --with-mpfr-lib=$(pwd)/mpfr/src/.libs

i.e. you want me to leave $pwd shell variable verbatim. Should we not have '--with-mpfr-lib=$(pwd)/../gcc-4.6.3/mpfr/src/.libs' then?

Azrael84 12-01-2012 03:43 AM

1 Attachment(s)
I did what you said and it has certainly got me a little further it seems, but now I hit the error below (I've also attached the config.log if that helps)

libtool: link: ar rc .libs/libmpc.a abs.o acos.o acosh.o add.o add_fr.o add_si.o add_ui.o arg.o asin.o asinh.o atan.o atanh.o clear.o cmp.o cmp_si_si.o conj.o cos.o cosh.o div_2si.o div_2ui.o div.o div_fr.o div_ui.o exp.o fma.o fr_div.o fr_sub.o get_prec2.o get_prec.o get_version.o get_x.o imag.o init2.o init3.o inp_str.o log.o log10.o mem.o mul_2si.o mul_2ui.o mul.o mul_fr.o mul_i.o mul_si.o mul_ui.o neg.o norm.o out_str.o pow.o pow_fr.o pow_ld.o pow_d.o pow_si.o pow_ui.o pow_z.o proj.o real.o urandom.o set.o set_prec.o set_str.o set_x.o set_x_x.o sin.o sin_cos.o sinh.o sqr.o sqrt.o strtoc.o sub.o sub_fr.o sub_ui.o swap.o tan.o tanh.o uceil_log2.o ui_div.o ui_ui_sub.o
libtool: link: ranlib .libs/libmpc.a
/bin/sed: can't read /opt/streamline-packages/gmp-5.0.0/lib64/libgmp.la: No such file or directory
libtool: link: `/opt/streamline-packages/gmp-5.0.0/lib64/libgmp.la' is not a valid libtool archive
make[5]: *** [libmpc.la] Error 1
make[5]: Leaving directory `/home/myusername/gcc-temp/objdir/mpc/src'
Making all in tests
make[5]: Entering directory `/home/myusername/gcc-temp/objdir/mpc/tests'
make[5]: Nothing to be done for `all'.
make[5]: Leaving directory `/home/myusername/gcc-temp/objdir/mpc/tests'
Making all in doc
make[5]: Entering directory `/home/myusername/gcc-temp/objdir/mpc/doc'
make[5]: Nothing to be done for `all'.
make[5]: Leaving directory `/home/myusername/gcc-temp/objdir/mpc/doc'
make[5]: Entering directory `/home/myusername/gcc-temp/objdir/mpc'
make[5]: Leaving directory `/home/myusername/gcc-temp/objdir/mpc'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/home/myusername/gcc-temp/objdir/mpc'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/myusername/gcc-temp/objdir/mpc'
make[2]: *** [all-stage1-mpc] Error 2
make[2]: Leaving directory `/home/myusername/gcc-temp/objdir'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/myusername/gcc-temp/objdir'
make: *** [all] Error 2


Looks to me like it is still trying to use the other old system versions? do I need to change the $PATH or $LD_LIBRARY_PATH vars?

knudfl 12-01-2012 04:40 AM

The gmp/ you have in gcc-4.6.3/ should be picked up and used ( as a copy )
in the object directory.

Why have you got gmp in /opt/streamline-packages/gmp-5.0.0/lib64 ? ?
Not required. Could be uninstalled ? Or you can hide it at build time.
The gmp/ in gcc-4.6.3/ will be compiled into gcc, I think :
No system gmp / mpfr libs will be required to run the gcc46 executable's,
if I remember right.

Azrael84 12-01-2012 05:07 AM

Quote:

Why have you got gmp in /opt/streamline-packages/gmp-5.0.0/lib64 ? ?
Not required. Could be uninstalled ?
Not my server so can't do that, as I say this server has old versions of gmp, mpfr and gcc already on it but I can't touch those (the admin wont upgrade but has suggested I can do a local install), that's why I want to make an isolated local install in my home dir.

Quote:

Or you can hide it at build time.
How? just for reference PATH=/bin:/usr/bin: and LD_LIBRARY_PATH="" (as are LIBRARY_PATH, C_INCLUDE_PATH, CPLUS_INCLUDE_PATH, LD_RUN_PATH also empty). I don't even know how the build knows about /opt/streamline-packages.

knudfl 12-01-2012 07:40 AM

On Ubuntu it should be possible to export an exclusive LD_LIBRARY_PATH :

export LD_LIBRARY_PATH=/usr/lib:/lib && ../gcc-4.6.3/configure --prefix=.....

Be aware that the export command is temporary :
Will reset to default when you exit the terminal.

Azrael84 12-02-2012 04:29 PM

I had already exported `export LD_LIBRARY_PATH=""` to try to stop the build looking elsewhere for libs (the libraries you mentioned, /usr/lib:/lib, are the system libs with the old gmp in, maybe you were just giving an example, but I certainly don't want the build looking there for libs, I want to keep the install local.

I'm still getting the same error either way

/bin/sed: can't read /opt/streamline-packages/gmp-5.0.0/lib64/libgmp.la: No such file or directory
libtool: link: `/opt/streamline-packages/gmp-5.0.0/lib64/libgmp.la' is not a valid libtool archive
make[5]: *** [libmpc.la] Error 1

Any ideas?

Just to double confirm : previously you really did mean: `--with-mpfr-lib=$(pwd)/mpfr/src/.libs` NOT `--with-mpfr-lib=$(pwd)/../gcc-4.6.3/mpfr/mpfr/src/.libs` ? This mismatch just seems odd compared to you --with-mpfr-include flag. Surely it really should be location of the mpfr libs in the source dir we are after?

knudfl 12-02-2012 05:17 PM

# 9 : Ref. post # 2. It is still

--with-mpfr-include=$(pwd)/../gcc-4.6.3/mpfr/src
--with-mpfr-lib=$(pwd)/mpfr/src/.libs

"pwd is actually the object / build directory" :
The libraries are in objdir/mpfr/src/.libs ,
and the includes are looked for in the source directory: gcc-4.6.3/mpfr/src/


But that doesn't solve the "/opt////gmp-5.0.0/lib64/libgmp.la" issue.
And : /lib/ cannot be excluded, as gcc depends on /lib///libgcc_s.so.1
( But may be gcc is hard coded to know the path to libgcc_s.so.1 ? )

Which version of Ubuntu are you using ? ( $ cat /etc/issue/ )

.

knudfl 12-02-2012 05:22 PM

# 9

You could also try adding the options, that were used for gcc-4.5.x :

--with-gmp-include=$(pwd)/gmp --with-gmp-lib=$(pwd)/gmp/.libs

Azrael84 12-02-2012 05:34 PM

Red Hat Enterprise Linux Server release 5.8 (Tikanga) is the version of linux on the server


Quote:

The libraries are in objdir/mpfr/src/.libs ,
and the includes are looked for in the source directory: gcc-4.6.3/mpfr/src
you mean the libraries will be *placed* (or installed into) objdir/mpfr/src/.libs? becuase objdir starts out empty before the configure and make right? (just checking, don't mean to be pedantic)

knudfl 12-02-2012 09:12 PM

# 12
Quote:

.. the libraries will be *placed* (or installed into) objdir/mpfr/src/.libs?
Yes, gmp/, mpfr/, etc. will appear in objdir/ after a very short time,
when things work as intended.

* Red Hat Enterprise Linux Server release 5.8 - 64bits : OK.
Please confirm 64bits : $ uname -m
The perfect solution for all issues: Building gcc on another EL 5, a clean install.
I did build a gcc-4.7.0 on EL5. So gcc-4.6.3 should be equally easy.
And my result, an rpm? package can be downloaded 'from Google Docs'.
A stand alone package is 20..25 MB (gcc-4.6.3 is 26 MB as a .deb binary package.)

Suggest --prefix : /home/<username>/usr/ ?
<username> : If you don't want to show it here, please send a message :
http://www.linuxquestions.org/questi...ember&u=386037

.

Azrael84 12-03-2012 04:11 AM

Yes, def 64 bit: uname -m leads to x86_64.

In the end I tried a method based on http://www.acsu.buffalo.edu/~charngda/cc_build.html, i.e. installed mpfr,gmp,mpc first in another directory `/home/myusername/tmp/gcc`, so that they weren't just extracted but actually pre-built and pre-built statically (e.g. configure --disable-shared --enable-static --prefix=/tmp/gcc --enable-cxx for building gmp first).

I then removed the gmp,mpfr, mpc sub dir from the gcc source from when we were attempting to install that way. I exported `export LD_LIBRARY_PATH=/home/myusername/tmp/gcc/lib`, `export LIBRARY_PATH=/home/myusername/tmp/gcc/lib`, `export LD_RUN_PATH=/home/myusername/tmp/gcc/lib`, `C_INCLUDE_PATH=/home/myusername/tmp/gcc/include`, `CPLUS_INCLUDE_PATH=/home/myusername/tmp/gcc/include`, and `export PATH=/bin:/usr/bin:` (just so I can still `ls`, 'cd' etc).

Finally went into my `objdir` and did

/home/myusername/gcc-temp/gcc-4.6.3/configure --prefix=/home/myusername/opt/gcc-4.6.3 --program-suffix=46 --enable-languages=c,c++ --enable-threads=posix --enable-shared --enable-__cxa_atexit --enable-clocale=gnu --disable-multilib --with-mpfr-include=/home/myusername/tmp/gcc/include --with-mpfr-lib=/home/myusername/tmp/gcc/lib --with-gmp-include=/home/myusername/tmp/gcc/include --with-gmp-lib=/home/myusername/tmp/gcc/lib --with-mpc-include=/home/myusername/tmp/gcc/include --with-mpc-lib=/home/myusername/tmp/gcc/lib

this has now installed 4.6.3 it seems.

Azrael84 12-03-2012 04:13 AM

Quote:

Originally Posted by knudfl (Post 4841482)
# 12

The perfect solution for all issues: Building gcc on another EL 5, a clean install.
I did build a gcc-4.7.0 on EL5. So gcc-4.6.3 should be equally easy.
And my result, an rpm? package can be downloaded 'from Google Docs'.
A stand alone package is 20..25 MB (gcc-4.6.3 is 26 MB as a .deb binary package.)

.

I may be misunderstanding but are you suggesting some how locally installing enterprise linux 5 (el5) in my home dir, then installing gcc within that?


All times are GMT -5. The time now is 10:46 AM.