LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 07-05-2010, 12:25 AM   #1
tatha
LQ Newbie
 
Registered: Nov 2009
Posts: 3

Rep: Reputation: 0
Error in installing gcc 4.5.0


Hi,

I am getting the following error while upgrade my gcc to gcc 4.5.0

---------------------------------------------------------------------------------

checking for the correct version of gmp.h... yes
checking for the correct version of mpfr.h... yes
checking for the correct version of mpc.h... yes
checking for the correct version of the gmp/mpfr/mpc libraries... no
configure: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations. Source code for these libraries can be found at
their respective hosting sites as well as at
ftp://gcc.gnu.org/pub/gcc/infrastructure/. See also
http://gcc.gnu.org/install/prerequisites.html for additional info. If
you obtained GMP, MPFR and/or MPC from a vendor distribution package,
make sure that you have installed both the libraries and the header
files. They may be located in separate packages.

-----------------------------------------------------------------------------------

The GMP 5.0.1,MPFR 3.0.0,MPC 0.8.2 is alrady installed in my system.
But still there is an error occur..

The config.log is given below...

---------------------------------------------------------------------------------

configure:5634: checking for the correct version of the gmp/mpfr/mpc libraries
configure:5665: gcc -o conftest -g -O2 conftest.c -lmpc -lmpfr -lgmp >&5
/usr/local/lib/libmpc.so: undefined reference to `mpfr_remquo'
/usr/local/lib/libmpc.so: undefined reference to `__gmp_get_memory_functions'
/usr/local/lib/libmpc.so: undefined reference to `mpfr_get_z_2exp'
collect2: ld returned 1 exit status
configure:5665: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define LT_OBJDIR ".libs/"
| /* end confdefs.h. */
| #include <mpc.h>
| int
| main ()
| {
|
| mpfr_t n;
| mpfr_t x;
| mpc_t c;
| int t;
| mpfr_init (n);
| mpfr_init (x);
| mpfr_atan2 (n, n, x, GMP_RNDN);
| mpfr_erfc (n, x, GMP_RNDN);
| mpfr_subnormalize (x, t, GMP_RNDN);
| mpfr_clear(n);
| mpfr_clear(x);
| mpc_init2 (c, 53);
| mpc_set_ui_ui (c, 1, 1, MPC_RNDNN);
| mpc_cosh (c, c, MPC_RNDNN);
| mpc_pow (c, c, c, MPC_RNDNN);
| mpc_acosh (c, c, MPC_RNDNN);
| mpc_clear (c);
|
| ;
| return 0;
| }
configure:5669: result: no
configure:5690: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.

-----------------------------------------------------------------------------------------

Is there any way out??

Thanks in advance..
 
Old 07-05-2010, 01:43 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,006

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Have a look under section 6 on this page and see what options they have used and try to use the same:

http://www.linuxfromscratch.org/lfs/view/development/
 
Old 07-05-2010, 03:20 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Say you have installed gmp, mpfr, mpc to /usr/local/.

/usr/local/ is not in the LD_LIBRARY_PATH on RH EL5.
Thus none of the libraries will be found.
..
 
Old 07-06-2010, 05:13 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
.. And by the way, why do you want gcc-4.5 ?

# yum install gcc44-c++
will provide gcc and g++ version 4.4.0
which is fairly new : /usr/bin/gcc44 : g++44
( You can have all the compilers, you want, installed
at the same time. Also available: compat-gcc-34-c++ ).
..
 
Old 07-13-2010, 11:31 AM   #5
indian_munnda
LQ Newbie
 
Registered: Jul 2010
Posts: 8

Rep: Reputation: 0
Hi tatha,

I think you need to install GMP, MPFR and MPC. you can get these at ftp://gcc.gnu.org/pub/gcc/infrastructure/. It should work after installing these...
 
Old 07-14-2010, 12:24 AM   #6
tatha
LQ Newbie
 
Registered: Nov 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Re:

Quote:
Originally Posted by indian_munnda View Post
Hi tatha,

I think you need to install GMP, MPFR and MPC. you can get these at ftp://gcc.gnu.org/pub/gcc/infrastructure/. It should work after installing these...
As I mentioned previously , I have alrady installed GMP 5.0.1,MPFR 3.0.0,MPC 0.8.2 in my system.

You can check the configure.log for detail...

checking for the correct version of gmp.h... yes
checking for the correct version of mpfr.h... yes
checking for the correct version of mpc.h... yes
checking for the correct version of the gmp/mpfr/mpc libraries... no

You can see that the system is getting the correct version of GMP,MPFR,MPC ...I have checked in the /usr/local/lib manually,but still library error..

I have set the LD_LIBRARY_PATH to /usr/local/lib for libraries but no responce(i have found the library files in /usr/local/lib)....

Thanks for your help..

If any other sollution comes, please inform me..

Last edited by tatha; 07-14-2010 at 12:27 AM.
 
Old 07-15-2010, 02:46 AM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Example: http://www.linuxfromscratch.org/lfs/...ter06/gcc.html
( Please read everything about gcc-4.5.0 )
Other minimum requirements ? : The patch ..
gcc-4.5.0-startfiles_fix-1.patch
http://www.linuxfromscratch.org/lfs/...3/patches.html


* EDIT EDIT EDIT : There is a better (and newer) build example here
* http://www.linuxquestions.org/questi...-1-a-842567/#2

mkdir gcc450-build
cd gcc450-build/
../gcc-4.5.0-20100709/configure --help

../gcc-4.5.0-20100709/configure --prefix=/usr/local/gcc450 --with-gmp-lib=/usr/local/lib --with-mpfr-lib=/usr/local/lib --with-mpc-lib=/usr/local/lib --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++

And please have a look into gcc-4.5.0-2.fc14.src.rpm :
http://download.fedora.redhat.com/pu...2.fc14.src.rpm
.. where you can read the file "gcc.spec" to know how
Fedora / Redhat handles the gcc 4.5.0-20100709 build.

Who says it is at all possible to do at an old Redhat OS ?
( You didn't tell which version you have ? )
Suggest : Install the compat / extra gcc44 and try it out.
Changing the system compiler is not recommended.
All "compat" gcc installs will use different file names,
thus not conflicting with any system files.
..

Last edited by knudfl; 06-29-2011 at 08:06 AM.
 
Old 07-17-2010, 12:36 AM   #8
indian_munnda
LQ Newbie
 
Registered: Jul 2010
Posts: 8

Rep: Reputation: 0
Hello tatha,

Do onething, get the source of gcc-4.5.0 if already have that in tarballs or archive then its good. Also, get the sources of GMP, MPFR and MPC.

Now do as follows,

1) First extract the gcc-4.5.0 to and then extract GMP, MPFR and MPC to gcc folder.

2) second, goto extracted gcc folder and remove versions from the GMP, MPFR and MPC folders. I mean rename these folders eg:- if your MPC folder name is MPC3.0.0 then rename it as MPC and same for GMP and MPFR.

3) Now configure and install it will take GMP, MPFR and MPC from your source only....

I hope it should be installed successfully now.....
 
Old 07-17-2010, 01:32 AM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
"GMP, MPFR, MPC" : just a minor issue. Of course there is
no reason to install them. gcc'/'g++' will only need a gmp
run time library, when installed. Line 68 here
http://www.linuxfromscratch.org/lfs/...gcc-pass2.html
describes, what's referred in post #8 by @indian_munnda.
GCC 4.5.0 is buggy ? and not even easy to compile on a new Linux.
http://gcc.gnu.org/ → → Status → Serious regressions.
..
 
Old 07-19-2010, 11:34 AM   #10
indian_munnda
LQ Newbie
 
Registered: Jul 2010
Posts: 8

Rep: Reputation: 0
knudfl, yeah even i face a lot of problems while installing 4.5.0 but i installed it successfully after i did the same as i mention in my previous post.....

Actually, i got this answer once in the channel #rhel when i was facing porblem but yes it is easy to install gcc-4.1.0 rather than 4.5.0 and it really works good enough...

Tatha, you can install 4.1.0 also, if you want to install easily, else you have to do tweaks.....
 
Old 04-28-2011, 10:19 PM   #11
clairvoyant5
LQ Newbie
 
Registered: Apr 2011
Posts: 1

Rep: Reputation: 0
Hey Guys, Thanks for the info. This was really helpful.
 
Old 04-30-2011, 02:24 AM   #12
tatha
LQ Newbie
 
Registered: Nov 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Thumbs up Thanks

Thanks to all of you for your great help...
 
Old 04-18-2012, 07:04 AM   #13
rajan261093
LQ Newbie
 
Registered: Apr 2012
Posts: 1

Rep: Reputation: Disabled
Smile

--with-gmp-lib=/usr/local/lib --with-mpfr-lib=/usr/local/lib --with-mpc-lib=/usr/local/lib

These options working fine!!!!!


Thanks
Rajan
 
Old 04-18-2012, 07:24 AM   #14
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
just a comment. LD_LIBRARY_PATH will not help linking, you can use -L/usr/local/lib instead
 
Old 11-06-2012, 12:42 PM   #15
arbitatuofm
LQ Newbie
 
Registered: Dec 2008
Distribution: Fedora 9
Posts: 2

Rep: Reputation: 0
Thumbs up

It was very helpful!
 
  


Reply

Tags
gcc



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
gcc 4.3 error when installing Quadro FX 540 james100 Linux - Hardware 5 07-19-2009 08:09 AM
Installing Squid on Suse 11.1 - Error on GCC asifrajan SUSE / openSUSE 1 07-09-2009 03:46 AM
Error in installing gcc Hitboxx Fedora 1 04-27-2006 09:33 AM
GCC error when installing GAIM BoardinBum Linux - Newbie 2 08-20-2004 01:48 PM
error installing GCC +please help saurav_gohain Linux From Scratch 5 07-07-2003 11:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration