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.. |
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/ |
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. .. |
.. 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++ ). .. |
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... |
Re:
Quote:
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.. |
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. .. |
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..... |
"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. .. |
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.....:) |
Hey Guys, Thanks for the info. This was really helpful.
|
Thanks
Thanks to all of you for your great help...
|
--with-gmp-lib=/usr/local/lib --with-mpfr-lib=/usr/local/lib --with-mpc-lib=/usr/local/lib
These options working fine!!!!! Thanks Rajan |
just a comment. LD_LIBRARY_PATH will not help linking, you can use -L/usr/local/lib instead
|
It was very helpful!
|
If you really think it was helpful please press YES (bottom right corner of the post)
|
All times are GMT -5. The time now is 01:05 PM. |