LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 11-30-2012, 05:31 PM   #1
Azrael84
Member
 
Registered: Nov 2012
Posts: 55

Rep: Reputation: Disabled
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?

Last edited by Azrael84; 11-30-2012 at 05:48 PM.
 
Old 12-01-2012, 01:32 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,947

Rep: Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602
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.))

.
 
Old 12-01-2012, 01:55 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,947

Rep: Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602
.. 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".

.
 
Old 12-01-2012, 03:08 AM   #4
Azrael84
Member
 
Registered: Nov 2012
Posts: 55

Original Poster
Rep: Reputation: Disabled
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?
 
Old 12-01-2012, 03:43 AM   #5
Azrael84
Member
 
Registered: Nov 2012
Posts: 55

Original Poster
Rep: Reputation: Disabled
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?
Attached Files
File Type: log config.log (26.6 KB, 6 views)

Last edited by Azrael84; 12-01-2012 at 04:04 AM.
 
Old 12-01-2012, 04:40 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,947

Rep: Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602
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.
 
Old 12-01-2012, 05:07 AM   #7
Azrael84
Member
 
Registered: Nov 2012
Posts: 55

Original Poster
Rep: Reputation: Disabled
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.

Last edited by Azrael84; 12-01-2012 at 05:15 AM.
 
Old 12-01-2012, 07:40 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,947

Rep: Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602
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.
 
Old 12-02-2012, 04:29 PM   #9
Azrael84
Member
 
Registered: Nov 2012
Posts: 55

Original Poster
Rep: Reputation: Disabled
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?
 
Old 12-02-2012, 05:17 PM   #10
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,947

Rep: Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602
# 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/ )

.
 
Old 12-02-2012, 05:22 PM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,947

Rep: Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602
# 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
 
Old 12-02-2012, 05:34 PM   #12
Azrael84
Member
 
Registered: Nov 2012
Posts: 55

Original Poster
Rep: Reputation: Disabled
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)
 
Old 12-02-2012, 09:12 PM   #13
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,947

Rep: Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602
# 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

.
 
Old 12-03-2012, 04:11 AM   #14
Azrael84
Member
 
Registered: Nov 2012
Posts: 55

Original Poster
Rep: Reputation: Disabled
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.
 
Old 12-03-2012, 04:13 AM   #15
Azrael84
Member
 
Registered: Nov 2012
Posts: 55

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
# 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?
 
  


Reply

Tags
gcc463


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error building GMP, MPFR, MPC libs with gcc 4.7.0 in cygwin lb_dbd Linux - Newbie 2 04-11-2012 04:23 PM
i have an error Building GCC: requires GMP 4.1+ and MPFR 2.3.0+. robineecc1 Linux From Scratch 14 10-03-2011 09:41 PM
Finding path of GMP and MPFR for gcc upgrade drosselmeyer Linux - Newbie 2 08-03-2011 07:15 AM
[SOLVED] gcc in CLFS section 5.8.1 does not compile without the omitted mpfr and gmp Openumerix Linux From Scratch 4 11-20-2009 01:35 PM
Why install MPFR and GMP in GCC as opposed to separately? GuyWhoKilledBear Linux - Software 1 08-12-2009 12:46 PM


All times are GMT -5. The time now is 01:03 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration