2

I'm trying to install GCC 4.7.2 on a CentOS (virtual) machine. In order to do this, I downloaded GCC 4.7.2, and tried to configure and to make it. Unfortunately the configuring didn't work, as other dependencies were missing (GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+).
As mentioned in the corresponding error message, I have downloaded those packages from "ftp://gcc.gnu.org/pub/gcc/infrastructure/", and I have tried to configure and make those dependent libraries.

This worked, and now the end of my error message looks as follows:

...
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... no
configure: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.
...

So it seems that GMP is OK, MPFR too, but MPC is giving a problem.

For your information: while making GMP and MPFR, a lib*.a file was created, while during the making of MPC, a "src" directory was created and filled (but I don't have any lib*.a file).

Also very important: in order to configure the GCC, I use following command:

[root@dbserv1 gcc-4.7.2]# ./configure --with-gmp-include=/tmp/gcc/gmp/gmp-4.3.2 --with-gmp-lib=/tmp/gcc/gmp/gmp-4.3.2/.libs --with-mpfr-include=/tmp/gcc/mpfr/mpfr-2.4.2 --with-mpfr-lib=/tmp/gcc/mpfr/mpfr-2.4.2/.libs --with-mpc-include=/tmp/gcc/mpc/mpc-0.8.1 --with-mpc-lib=/tmp/gcc/mpc/mpc-0.8.1/src
[root@dbserv1 gcc-4.7.2]# pwd
/tmp/gcc/gcc-4.7.2

Does anybody know how I can proceed from here? For all information: the choice for a CentOS 5.2 is the choice of the customer, I can't upgrade the Linux version.

@Paul, as an answer to your question, I have taken an "ls" of all involved directories, hereby the results:

[root@dbserv1 gcc-4.7.2]# ls /tmp/gcc/gmp/gmp-4.3.2
acinclude.m4     config.log      extract-dbl.o     install-sh   mp_bases.h     mp_minv_tab.c   randclr.o    randmt.o     README
aclocal.m4       config.m4       fib_table.h       invalid.c    mp_bpl.c       mp_minv_tab.lo  randdef.c    randmts.c    scanf
ansi2knr.1       config.status   gen-bases         invalid.lo   mp_bpl.lo      mp_minv_tab.o   randdef.lo   randmts.lo   stamp-h1
ansi2knr.c       config.sub      gen-bases.c       invalid.o    mp_bpl.o       mpn             randdef.o    randmts.o    tal-debug.c
assert.c         configure       gen-fac_ui        libgmp.la    mpbsd          mpq             randiset.c   randmui.c    tal-notreent.c
assert.lo        configure.in    gen-fac_ui.c      libmp.sym    mp_clz_tab.c   mp_set_fns.c    randiset.lo  randmui.lo   tal-reent.c
assert.o         COPYING         gen-fib           libtool      mp_clz_tab.lo  mp_set_fns.lo   randiset.o   randmui.o    tal-reent.lo
AUTHORS          COPYING.LIB     gen-fib.c         longlong.h   mp_clz_tab.o   mp_set_fns.o    randlc2s.c   rand.o       tal-reent.o
ChangeLog        cxx             gen-psqr          ltmain.sh    mp_dv_tab.c    mpz             randlc2s.lo  rands.c      tests
compat.c         demos           gen-psqr.c        macos        mp_dv_tab.lo   NEWS            randlc2s.o   randsd.c     tune
compat.lo        doc             gmp.h             Makefile     mp_dv_tab.o    printf          randlc2x.c   randsd.lo    version.c
compat.o         dumbmp.c        gmp-h.in          Makefile.am  mpf            randbui.c       randlc2x.lo  randsd.o     version.lo
configfsf.guess  errno.c         gmp-impl.h        Makefile.in  mp_get_fns.c   randbui.lo      randlc2x.o   randsdui.c   version.o
configfsf.sub    errno.lo        gmp-mparam.h      memory.c     mp_get_fns.lo  randbui.o       rand.lo      randsdui.lo
config.guess     errno.o         gmpxx.h           memory.lo    mp_get_fns.o   rand.c          randmt.c     randsdui.o
config.h         extract-dbl.c   INSTALL           memory.o     mp.h           randclr.c       randmt.h     rands.lo
config.in        extract-dbl.lo  INSTALL.autoconf  missing      mp-h.in        randclr.lo      randmt.lo    rands.o
[root@dbserv1 gcc-4.7.2]# ls /tmp/gcc/gmp/gmp-4.3.2/.libs
assert.o  extract-dbl.o  libgmp.la   libgmp.so.3      mp_bpl.o      mp_get_fns.o   randbui.o  randiset.o  randmt.o   rand.o      rands.o
compat.o  invalid.o      libgmp.lai  libgmp.so.3.5.2  mp_clz_tab.o  mp_minv_tab.o  randclr.o  randlc2s.o  randmts.o  randsd.o    tal-reent.o
errno.o   libgmp.a       libgmp.so   memory.o         mp_dv_tab.o   mp_set_fns.o   randdef.o  randlc2x.o  randmui.o  randsdui.o  version.o
[root@dbserv1 gcc-4.7.2]# ls /tmp/gcc/mpfr/mpfr-2.4.2
abort_prec_max.c   cmp_ui.o          eq.lo            get_d.lo          li2.c            out_str.o            set_ld.lo       sqrt_ui.o
abort_prec_max.lo  comparisons.c     eq.o             get_d.o           li2.lo           PATCHES              set_ld.o        stack_interface.c
abort_prec_max.o   comparisons.lo    erf.c            get_exp.c         li2.o            pow.c                set.lo          stack_interface.lo
acinclude.m4       comparisons.o     erfc.c           get_exp.lo        libmpfr.la       powerof2.c           setmax.c        stack_interface.o
aclocal.m4         compile           erfc.lo          get_exp.o         libtool          powerof2.lo          setmax.lo       strtofr.c
acos.c             config.guess      erfc.o           get_f.c           lngamma.c        powerof2.o           setmax.o        strtofr.lo
acosh.c            config.log        erf.lo           get_f.lo          lngamma.lo       pow.lo               setmin.c        strtofr.o
acosh.lo           config.status     erf.o            get_f.o           lngamma.o        pow.o                setmin.lo       sub1.c
acosh.o            config.sub        examples         get_ld.c          log10.c          pow_si.c             setmin.o        sub1.lo
acos.lo            configure         exceptions.c     get_ld.lo         log10.lo         pow_si.lo            set_nan.c       sub1.o
acos.o             configure.in      exceptions.lo    get_ld.o          log10.o          pow_si.o             set_nan.lo      sub1sp.c
add1.c             constant.c        exceptions.o     get_patches.c     log1p.c          pow_ui.c             set_nan.o       sub1sp.lo
add1.lo            constant.lo       exp10.c          get_patches.lo    log1p.lo         pow_ui.lo            set.o           sub1sp.o
add1.o             constant.o        exp10.lo         get_patches.o     log1p.o          pow_ui.o             set_prc_raw.c   sub.c
add1sp.c           const_catalan.c   exp10.o          get_patches.sh    log2.c           pow_z.c              set_prc_raw.lo  sub_d.c
add1sp.lo          const_catalan.lo  exp_2.c          get_si.c          log2.lo          pow_z.lo             set_prc_raw.o   sub_d.lo
add1sp.o           const_catalan.o   exp2.c           get_si.lo         log2.o           pow_z.o              set_prec.c      sub_d.o
add.c              const_euler.c     exp_2.lo         get_si.o          log.c            printf.c             set_prec.lo     sub.lo
add_d.c            const_euler.lo    exp2.lo          get_sj.c          logging.c        printf.lo            set_prec.o      subnormal.c
add_d.lo           const_euler.o     exp_2.o          get_sj.lo         logging.lo       printf.o             set_q.c         subnormal.lo
add_d.o            const_log2.c      exp2.o           get_sj.o          logging.o        print_raw.c          set_q.lo        subnormal.o
add.lo             const_log2.lo     exp3.c           get_str.c         log.lo           print_raw.lo         set_q.o         sub.o
add.o              const_log2.o      exp3.lo          get_str.lo        log.o            print_raw.o          set_rnd.c       sub_ui.c
add_ui.c           const_pi.c        exp3.o           get_str.o         ltmain.sh        print_rnd_mode.c     set_rnd.lo      sub_ui.lo
add_ui.lo          const_pi.lo       exp.c            get_ui.c          m4               print_rnd_mode.lo    set_rnd.o       sub_ui.o
add_ui.o           const_pi.o        exp.lo           get_ui.lo         Makefile         print_rnd_mode.o     set_si_2exp.c   sum.c
agm.c              COPYING           expm1.c          get_ui.o          Makefile.am      random2.c            set_si_2exp.lo  sum.lo
agm.lo             COPYING.LIB       expm1.lo         get_uj.c          Makefile.in      random2.lo           set_si_2exp.o   sum.o
agm.o              copysign.c        expm1.o          get_uj.lo         minmax.c         random2.o            set_si.c        swap.c
ansi2knr.1         copysign.lo       exp.o            get_uj.o          minmax.lo        random.c             setsign.c       swap.lo
ansi2knr.c         copysign.o        extract.c        get_z.c           minmax.o         random.lo            setsign.lo      swap.o
asin.c             cos.c             extract.lo       get_z_exp.c       missing          random.o             setsign.o       tan.c
asinh.c            cosh.c            extract.o        get_z_exp.lo      modf.c           README               set_si.lo       tanh.c
asinh.lo           cosh.lo           factorial.c      get_z_exp.o       modf.lo          rec_sqrt.c           set_si.o        tanh.lo
asinh.o            cosh.o            factorial.lo     get_z.lo          modf.o           rec_sqrt.lo          set_sj.c        tanh.o
asin.lo            cos.lo            factorial.o      get_z.o           mparam.h         rec_sqrt.o           set_sj.lo       tan.lo
asin.o             cos.o             FAQ.html         gmp_op.c          mparam_h.in      reldiff.c            set_sj.o        tan.o
atan2.c            cot.c             fdl.texi         gmp_op.lo         mp_clz_tab.c     reldiff.lo           set_str.c       tests
atan2.lo           coth.c            fits_intmax.c    gmp_op.o          mp_clz_tab.lo    reldiff.o            set_str.lo      texinfo.tex
atan2.o            coth.lo           fits_intmax.lo   hypot.c           mp_clz_tab.o     rem1.c               set_str.o       TODO
atan.c             coth.o            fits_intmax.o    hypot.lo          mpf2mpfr.h       rem1.lo              set_str_raw.c   tuneup.c
atanh.c            cot.lo            fits_s.h         hypot.o           mpfr-gmp.c       rem1.o               set_str_raw.lo  uceil_exp2.c
atanh.lo           cot.o             fits_sint.c      init2.c           mpfr-gmp.h       rint.c               set_str_raw.o   uceil_exp2.lo
atanh.o            csc.c             fits_sint.lo     init2.lo          mpfr-gmp.lo      rint.lo              set_ui_2exp.c   uceil_exp2.o
atan.lo            csch.c            fits_sint.o      init2.o           mpfr-gmp.o       rint.o               set_ui_2exp.lo  uceil_log2.c
atan.o             csch.lo           fits_slong.c     init.c            mpfr.h           root.c               set_ui_2exp.o   uceil_log2.lo
AUTHORS            csch.o            fits_slong.lo    init.lo           mpfr-impl.h      root.lo              set_ui.c        uceil_log2.o
BUGS               csc.lo            fits_slong.o     init.o            mpfr.info        root.o               set_ui.lo       ufloor_log2.c
cache.c            csc.o             fits_sshort.c    inits2.c          mpfr-longlong.h  round_near_x.c       set_ui.o        ufloor_log2.lo
cache.lo           d_div.c           fits_sshort.lo   inits2.lo         mpfr.texi        round_near_x.lo      set_uj.c        ufloor_log2.o
cache.o            d_div.lo          fits_sshort.o    inits2.o          mpfr-thread.h    round_near_x.o       set_uj.lo       ui_div.c
cbrt.c             d_div.o           fits_u.h         inits.c           mpn_exp.c        round_p.c            set_uj.o        ui_div.lo
cbrt.lo            depcomp           fits_uint.c      inits.lo          mpn_exp.lo       round_p.lo           set_z.c         ui_div.o
cbrt.o             dim.c             fits_uint.lo     inits.o           mpn_exp.o        round_p.o            set_z.lo        ui_pow.c
ChangeLog          dim.lo            fits_uintmax.c   inp_str.c         mul_2exp.c       round_prec.c         set_z.o         ui_pow.lo
check.c            dim.o             fits_uintmax.lo  inp_str.lo        mul_2exp.lo      round_prec.lo        sgn.c           ui_pow.o
check.lo           div_2exp.c        fits_uintmax.o   inp_str.o         mul_2exp.o       round_prec.o         sgn.lo          ui_pow_ui.c
check.o            div_2exp.lo       fits_uint.o      INSTALL           mul_2si.c        round_raw_generic.c  sgn.o           ui_pow_ui.lo
clear.c            div_2exp.o        fits_ulong.c     install-sh        mul_2si.lo       sec.c                signbit.c       ui_pow_ui.o
clear.lo           div_2si.c         fits_ulong.lo    int_ceil_log2.c   mul_2si.o        sech.c               signbit.lo      ui_sub.c
clear.o            div_2si.lo        fits_ulong.o     int_ceil_log2.lo  mul_2ui.c        sech.lo              signbit.o       ui_sub.lo
clears.c           div_2si.o         fits_ushort.c    int_ceil_log2.o   mul_2ui.lo       sech.o               sin.c           ui_sub.o
clears.lo          div_2ui.c         fits_ushort.lo   isinf.c           mul_2ui.o        sec.lo               sin_cos.c       urandomb.c
clears.o           div_2ui.lo        fits_ushort.o    isinf.lo          mul.c            sec.o                sin_cos.lo      urandomb.lo
cmp2.c             div_2ui.o         fma.c            isinf.o           mul_d.c          set.c                sin_cos.o       urandomb.o
cmp2.lo            div.c             fma.lo           isinteger.c       mulders.c        set_d64.c            sinh.c          vasprintf.c
cmp2.o             div_d.c           fma.o            isinteger.lo      mulders.lo       set_d64.lo           sinh_cosh.c     vasprintf.lo
cmp_abs.c          div_d.lo          fms.c            isinteger.o       mulders.o        set_d64.o            sinh_cosh.lo    vasprintf.o
cmp_abs.lo         div_d.o           fms.lo           isnan.c           mul_d.lo         set_d.c              sinh_cosh.o     VERSION
cmp_abs.o          div.lo            fms.o            isnan.lo          mul_d.o          set_dfl_prec.c       sinh.lo         version.c
cmp.c              div.o             frac.c           isnan.o           mul.lo           set_dfl_prec.lo      sinh.o          version.lo
cmp_d.c            div_ui.c          frac.lo          isnum.c           mul.o            set_dfl_prec.o       sin.lo          version.o
cmp_d.lo           div_ui.lo         frac.o           isnum.lo          mul_ui.c         set_d.lo             sin.o           volatile.c
cmp_d.o            div_ui.o          free_cache.c     isnum.o           mul_ui.lo        set_d.o              si_op.c         volatile.lo
cmp_ld.c           d_sub.c           free_cache.lo    isqrt.c           mul_ui.o         set_exp.c            si_op.lo        volatile.o
cmp_ld.lo          d_sub.lo          free_cache.o     isqrt.lo          neg.c            set_exp.lo           si_op.o         yn.c
cmp_ld.o           d_sub.o           gamma.c          isqrt.o           neg.lo           set_exp.o            sqr.c           yn.lo
cmp.lo             dump.c            gamma.lo         iszero.c          neg.o            set_f.c              sqr.lo          yn.o
cmp.o              dump.lo           gamma.o          iszero.lo         NEWS             set_f.lo             sqr.o           zeta.c
cmp_si.c           dump.o            gen_inverse.h    iszero.o          next.c           set_f.o              sqrt.c          zeta.lo
cmp_si.lo          eint.c            get_d64.c        jn.c              next.lo          set_inf.c            sqrt.lo         zeta.o
cmp_si.o           eint.lo           get_d64.lo       jn.lo             next.o           set_inf.lo           sqrt.o          zeta_ui.c
cmp_ui.c           eint.o            get_d64.o        jn.o              out_str.c        set_inf.o            sqrt_ui.c       zeta_ui.lo
cmp_ui.lo          eq.c              get_d.c          jyn_asympt.c      out_str.lo       set_ld.c             sqrt_ui.lo      zeta_ui.o
[root@dbserv1 gcc-4.7.2]# ls /tmp/gcc/mpfr/mpfr-2.4.2/.libs
abort_prec_max.o  constant.o       exp10.o         get_si.o         libmpfr.so.1      pow_z.o           set_prc_raw.o      sub1sp.o
acosh.o           const_catalan.o  exp_2.o         get_sj.o         libmpfr.so.1.2.2  printf.o          set_prec.o         sub_d.o
acos.o            const_euler.o    exp2.o          get_str.o        lngamma.o         print_raw.o       set_q.o            subnormal.o
add1.o            const_log2.o     exp3.o          get_ui.o         log10.o           print_rnd_mode.o  set_rnd.o          sub.o
add1sp.o          const_pi.o       expm1.o         get_uj.o         log1p.o           random2.o         set_si_2exp.o      sub_ui.o
add_d.o           copysign.o       exp.o           get_z_exp.o      log2.o            random.o          setsign.o          sum.o
add.o             cosh.o           extract.o       get_z.o          logging.o         rec_sqrt.o        set_si.o           swap.o
add_ui.o          cos.o            factorial.o     gmp_op.o         log.o             reldiff.o         set_sj.o           tanh.o
agm.o             coth.o           fits_intmax.o   hypot.o          minmax.o          rem1.o            set_str.o          tan.o
asinh.o           cot.o            fits_sint.o     init2.o          modf.o            rint.o            set_str_raw.o      uceil_exp2.o
asin.o            csch.o           fits_slong.o    init.o           mp_clz_tab.o      root.o            set_ui_2exp.o      uceil_log2.o
atan2.o           csc.o            fits_sshort.o   inits2.o         mpfr-gmp.o        round_near_x.o    set_ui.o           ufloor_log2.o
atanh.o           d_div.o          fits_uintmax.o  inits.o          mpn_exp.o         round_p.o         set_uj.o           ui_div.o
atan.o            dim.o            fits_uint.o     inp_str.o        mul_2exp.o        round_prec.o      set_z.o            ui_pow.o
cache.o           div_2exp.o       fits_ulong.o    int_ceil_log2.o  mul_2si.o         sech.o            sgn.o              ui_pow_ui.o
cbrt.o            div_2si.o        fits_ushort.o   isinf.o          mul_2ui.o         sec.o             signbit.o          ui_sub.o
check.o           div_2ui.o        fma.o           isinteger.o      mulders.o         set_d64.o         sin_cos.o          urandomb.o
clear.o           div_d.o          fms.o           isnan.o          mul_d.o           set_dfl_prec.o    sinh_cosh.o        vasprintf.o
clears.o          div.o            frac.o          isnum.o          mul.o             set_d.o           sinh.o             version.o
cmp2.o            div_ui.o         free_cache.o    isqrt.o          mul_ui.o          set_exp.o         sin.o              volatile.o
cmp_abs.o         d_sub.o          gamma.o         iszero.o         neg.o             set_f.o           si_op.o            yn.o
cmp_d.o           dump.o           get_d64.o       jn.o             next.o            set_inf.o         sqr.o              zeta.o
cmp_ld.o          eint.o           get_d.o         li2.o            out_str.o         set_ld.o          sqrt.o             zeta_ui.o
cmp.o             eq.o             get_exp.o       libmpfr.a        powerof2.o        setmax.o          sqrt_ui.o
cmp_si.o          erfc.o           get_f.o         libmpfr.la       pow.o             setmin.o          stack_interface.o
cmp_ui.o          erf.o            get_ld.o        libmpfr.lai      pow_si.o          set_nan.o         strtofr.o
comparisons.o     exceptions.o     get_patches.o   libmpfr.so       pow_ui.o          set.o             sub1.o
[root@dbserv1 gcc-4.7.2]# ls /tmp/gcc/mpc/mpc-0.8.1
acinclude.m4  ChangeLog     config.h.in    config.sub   configure.ac  doc         libtool    Makefile.am  missing  src       TODO
aclocal.m4    config.guess  config.log     configure    COPYING.LIB   INSTALL     ltmain.sh  Makefile.in  NEWS     stamp-h1
AUTHORS       config.h      config.status  #configure#  depcomp       install-sh  Makefile   Makefile.vc  README   tests
[root@dbserv1 gcc-4.7.2]# ls /tmp/gcc/mpc/mpc-0.8.1/src
abs.c      asin.c        conj.c       exp.c           imag.c       mem.o        neg.c       pow_si.c     set_str.c   strtoc.c   uceil_log2.c
abs.lo     asinh.c       conj.lo      exp.lo          imag.lo      mpc.h        neg.lo      pow_si.lo    set_str.lo  strtoc.lo  uceil_log2.lo
abs.o      asinh.lo      conj.o       exp.o           imag.o       mpc-impl.h   neg.o       pow_si.o     set_str.o   strtoc.o   uceil_log2.o
acos.c     asinh.o       cos.c        fr_div.c        init2.c      mul_2exp.c   norm.c      pow_ui.c     set_x.c     sub.c      ui_div.c
acosh.c    asin.lo       cosh.c       fr_div.lo       init2.lo     mul_2exp.lo  norm.lo     pow_ui.lo    set_x.lo    sub_fr.c   ui_div.lo
acosh.lo   asin.o        cosh.lo      fr_div.o        init2.o      mul_2exp.o   norm.o      pow_ui.o     set_x.o     sub_fr.lo  ui_div.o
acosh.o    atan.c        cosh.o       fr_sub.c        init3.c      mul.c        out_str.c   pow_z.c      set_x_x.c   sub_fr.o   ui_ui_sub.c
acos.lo    atanh.c       cos.lo       fr_sub.lo       init3.lo     mul_fr.c     out_str.lo  pow_z.lo     set_x_x.lo  sub.lo     ui_ui_sub.lo
acos.o     atanh.lo      cos.o        fr_sub.o        init3.o      mul_fr.lo    out_str.o   pow_z.o      set_x_x.o   sub.o      ui_ui_sub.o
add.c      atanh.o       div_2exp.c   get_prec2.c     inp_str.c    mul_fr.o     pow.c       proj.c       sin.c       sub_ui.c   urandom.c
add_fr.c   atan.lo       div_2exp.lo  get_prec2.lo    inp_str.lo   mul_i.c      pow_d.c     proj.lo      sinh.c      sub_ui.lo  urandom.lo
add_fr.lo  atan.o        div_2exp.o   get_prec2.o     inp_str.o    mul_i.lo     pow_d.lo    proj.o       sinh.lo     sub_ui.o   urandom.o
add_fr.o   clear.c       div.c        get_prec.c      libmpc.la    mul_i.o      pow_d.o     real.c       sinh.o      swap.c
add.lo     clear.lo      div_fr.c     get_prec.lo     log.c        mul.lo       pow_fr.c    real.lo      sin.lo      swap.lo
add.o      clear.o       div_fr.lo    get_prec.o      log.lo       mul.o        pow_fr.lo   real.o       sin.o       swap.o
add_ui.c   cmp.c         div_fr.o     get_str.c       log.o        mul_si.c     pow_fr.o    set.c        sqr.c       tan.c
add_ui.lo  cmp.lo        div.lo       get_str.lo      Makefile     mul_si.lo    pow_ld.c    set.lo       sqr.lo      tanh.c
add_ui.o   cmp.o         div.o        get_str.o       Makefile.am  mul_si.o     pow_ld.lo   set.o        sqr.o       tanh.lo
arg.c      cmp_si_si.c   div_ui.c     get_version.c   Makefile.in  mul_ui.c     pow_ld.o    set_prec.c   sqrt.c      tanh.o
arg.lo     cmp_si_si.lo  div_ui.lo    get_version.lo  mem.c        mul_ui.lo    pow.lo      set_prec.lo  sqrt.lo     tan.lo
arg.o      cmp_si_si.o   div_ui.o     get_version.o   mem.lo       mul_ui.o     pow.o       set_prec.o   sqrt.o      tan.o
  • Do all the folders in the command options actually contain files? – Paul Calabro Jan 18 '16 at 15:53
  • Look near the end of gcc-4.7.2/config.log. Which of the several mpc tests failed? – Mark Plotnick Jan 18 '16 at 17:44
  • 1
    configure's tests for MPC involve compiling C programs with the line #include <mpc.h>. So you probably want --with-mpc-include=/tmp/gcc/mpc/mpc-0.8.1/src instead of --with-mpc-include=/tmp/gcc/mpc/mpc-0.8.1 – Mark Plotnick Jan 18 '16 at 18:30
1

Three things.

  1. You are running CentOS 5.2. That is an extremely old version. Please run a yum update to get to 5.11. It doesn't matter what the customer thinks or want, you are using an unsupported and very unsecure version of the distribution that will get owned at some point in time. Clearly you understand this, right? The customer is not always right.
  2. If you manage to get it to compile, at all, do NOT make install. You will trash the system.
  3. Don't compile everything if you don't have to. There are RPM's available at various sources for the stuff you need. See gmp-devel, mpc-devel, mpfr-devel. Try rpm.pbone.net.
3

Check out the 'Supported Libraries' section in https://gcc.gnu.org/wiki/InstallingGCC. I was successful in building gcc 5.3 on Centos 6.5 by running

./contrib/download_prerequisites 

mentioned in the above doc.

0

Meanwhile I've proceeded, mostly by re-building the MPC (something must have gone wrong while configuring/making the MPC library). Once this succeeded, I have launched following command (mind the MPC references), and now everything seems to be working.

root@dbserv1 gcc-4.7.2]#  ./configure --with-gmp-include=/tmp/gcc/gmp/gmp-4.3.2 --with-gmp-lib=/tmp/gcc/gmp/gmp-4.3.2/.libs --with-mpfr-include=/tmp/gcc/mpfr/mpfr-2.4.2 --with-mpfr-lib=/tmp/gcc/mpfr/mpfr-2.4.2/.libs --with-mpc-include=/tmp/gcc/mpc/mpc-0.8.1/src --with-mpc-lib=/tmp/gcc/mpc/mpc-0.8.1/src/.libs 

As far as the "download_prerequisites" is concerned: I don't have network connectivity, so I can't work this way of working, but thanks for the proposal anyway.

For the same reason, yum also can't be used.

  • The difficult way, which is not recommended, is to download the sources for GMP, MPFR and MPC, then configure and install each of them in non-standard locations, then configure GCC with --with-gmp=/some/silly/path/gmp --with-mpfr=/some/silly/path/mpfr --with-mpc=/some/silly/path/mpc,... This is silly and causes major problems for anyone who doesn't understand how dynamic linkers find libraries at runtime. Do not do this. If building GCC fails when using any of the --with-gmp or --with-mpfr or --with-mpc options then you probably shouldn't be using them. gcc.gnu.org/wiki/InstallingGCC – Yaroslav Nikitenko Jun 5 '17 at 18:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.