Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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 to the letter, working in my home directory. In summary I downloaded the new tars (gcc,gmp,mpfr,mpc) extracted them and moved gmp,mpfr,mpc into the sources directory of gcc (ensuring they were then named gmp, mpfr, mpc). I then cd .. out of sources and then into the build directory (objdir) and from there I 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? I've set things like LD_LIBRARY_PATH="" to try to stop it looking elsewhere to no avail. I would have thought it would happily just use the mpfr in the gcc sources directory though, as it seems to be OK using the gmp that is there.

The full config.log:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.64.  Invocation command line was

  $ /home/myusername/gcc-temp/gcc-4.6.3/configure --prefix=/home/myusername/opt/gcc-4.6.3 --with-local-prefix=/home/myusername/usr/local

## --------- ##
## Platform. ##
## --------- ##

hostname = erased
uname -m = x86_64
uname -r = 2.6.18-308.1.1.el5
uname -s = Linux
uname -v = #1 SMP Fri Feb 17 16:51:01 EST 2012

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = x86_64
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /opt/streamline/bin
PATH: /opt/streamline/sbin
PATH: /software/bin
PATH: /usr/kerberos/bin
PATH: /opt/intel/Compiler/11.1/bin/intel64/
PATH: /opt/absoft/bin
PATH: /opt/pgi//linux86-64/9.0/bin
PATH: /usr/local/bin
PATH: /bin
PATH: /usr/bin
PATH: /opt/pathscale/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2222: checking build system type
configure:2236: result: x86_64-unknown-linux-gnu
configure:2283: checking host system type
configure:2296: result: x86_64-unknown-linux-gnu
configure:2316: checking target system type
configure:2329: result: x86_64-unknown-linux-gnu
configure:2383: checking for a BSD-compatible install
configure:2451: result: /usr/bin/install -c
configure:2462: checking whether ln works
configure:2484: result: yes
configure:2488: checking whether ln -s works
configure:2492: result: yes
configure:2499: checking for a sed that does not truncate output
configure:2563: result: /bin/sed
configure:2572: checking for gawk
configure:2588: found /bin/gawk
configure:2599: result: gawk
configure:3913: checking for gcc
configure:3929: found /usr/bin/gcc
configure:3940: result: gcc
configure:4169: checking for C compiler version
configure:4178: gcc --version >&5
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-52)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:4189: $? = 0
configure:4178: gcc -v >&5
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-52)
configure:4189: $? = 0
configure:4178: gcc -V >&5
gcc: '-V' option must have argument
configure:4189: $? = 1
configure:4178: gcc -qversion >&5
gcc: unrecognized option '-qversion'
gcc: no input files
configure:4189: $? = 1
configure:4209: checking for C compiler default output file name
configure:4231: gcc    conftest.c  >&5
configure:4235: $? = 0
configure:4272: result: a.out
configure:4288: checking whether the C compiler works
configure:4297: ./a.out
configure:4301: $? = 0
configure:4316: result: yes
configure:4323: checking whether we are cross compiling
configure:4325: result: no
configure:4328: checking for suffix of executables
configure:4335: gcc -o conftest    conftest.c  >&5
configure:4339: $? = 0
configure:4361: result: 
configure:4367: checking for suffix of object files
configure:4389: gcc -c   conftest.c >&5
configure:4393: $? = 0
configure:4414: result: o
configure:4418: checking whether we are using the GNU C compiler
configure:4437: gcc -c   conftest.c >&5
configure:4437: $? = 0
configure:4446: result: yes
configure:4455: checking whether gcc accepts -g
configure:4475: gcc -c -g  conftest.c >&5
configure:4475: $? = 0
configure:4516: result: yes
configure:4533: checking for gcc option to accept ISO C89
configure:4597: gcc  -c -g -O2  conftest.c >&5
configure:4597: $? = 0
configure:4610: result: none needed
configure:4688: checking for g++
configure:4704: found /usr/bin/g++
configure:4715: result: g++
configure:4742: checking for C++ compiler version
configure:4751: g++ --version >&5
g++ (GCC) 4.1.2 20080704 (Red Hat 4.1.2-52)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:4762: $? = 0
configure:4751: g++ -v >&5
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-52)
configure:4762: $? = 0
configure:4751: g++ -V >&5
g++: '-V' option must have argument
configure:4762: $? = 1
configure:4751: g++ -qversion >&5
g++: unrecognized option '-qversion'
g++: no input files
configure:4762: $? = 1
configure:4766: checking whether we are using the GNU C++ compiler
configure:4785: g++ -c   conftest.cpp >&5
configure:4785: $? = 0
configure:4794: result: yes
configure:4803: checking whether g++ accepts -g
configure:4823: g++ -c -g  conftest.cpp >&5
configure:4823: $? = 0
configure:4864: result: yes
configure:4953: checking for gnatbind
configure:4983: result: no
configure:5045: checking for gnatmake
configure:5075: result: no
configure:5094: checking whether compiler driver understands Ada
configure:5117: result: no
configure:5126: checking how to compare bootstrapped objects
configure:5151: result: cmp --ignore-initial=16 $$f1 $$f2
configure:5167: checking for objdir
configure:5182: result: .libs
configure:5724: checking for PWL_handle_timeout in -lpwl
configure:5749: gcc -o conftest -g -O2    conftest.c -lpwl   >&5
/usr/bin/ld: cannot find -lpwl
collect2: ld returned 1 exit status
configure:5749: $? = 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.  */
| 
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char PWL_handle_timeout ();
| int
| main ()
| {
| return PWL_handle_timeout ();
|   ;
|   return 0;
| }
configure:5758: result: no
configure:5772: checking for version 0.11 (revision 0 or later) of PPL
configure:5789: gcc -c -g -O2  -I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp -I$$r/$(HOST_SUBDIR)/mpfr -I$$s/mpfr -I$$s/mpc/src   conftest.c >&5
conftest.c:10:19: error: ppl_c.h: No such file or directory
conftest.c: In function 'main':
conftest.c:16: error: 'choke' undeclared (first use in this function)
conftest.c:16: error: (Each undeclared identifier is reported only once
conftest.c:16: error: for each function it appears in.)
conftest.c:16: error: expected ';' before 'me'
configure:5789: $? = 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 "ppl_c.h"
| int
| main ()
| {
| 
|     #if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR < 11
|     choke me
|     #endif
| 
|   ;
|   return 0;
| }
configure:5793: result: no
configure:7214: checking for default BUILD_CONFIG
configure:7246: result: bootstrap-debug
configure:7736: checking for bison
configure:7752: found /usr/bin/bison
configure:7763: result: bison -y
configure:7784: checking for bison
configure:7800: found /usr/bin/bison
configure:7811: result: bison
configure:7831: checking for gm4
configure:7861: result: no
configure:7831: checking for gnum4
configure:7861: result: no
configure:7831: checking for m4
configure:7847: found /usr/bin/m4
configure:7858: result: m4
configure:7878: checking for flex
configure:7894: found /usr/bin/flex
configure:7905: result: flex
configure:7926: checking for flex
configure:7942: found /usr/bin/flex
configure:7953: result: flex
configure:7973: checking for makeinfo
configure:7989: found /usr/bin/makeinfo
configure:8000: result: makeinfo
configure:8034: checking for expect
configure:8064: result: no
configure:8083: checking for runtest
configure:8113: result: no
configure:8228: checking for ar
configure:8244: found /usr/bin/ar
configure:8255: result: ar
configure:8369: checking for as
configure:8385: found /usr/bin/as
configure:8396: result: as
configure:8510: checking for dlltool
configure:8540: result: no
configure:8651: checking for ld
configure:8667: found /usr/bin/ld
configure:8678: result: ld
configure:8792: checking for lipo
configure:8822: result: no
configure:8933: checking for nm
configure:8949: found /usr/bin/nm
configure:8960: result: nm
configure:9074: checking for ranlib
configure:9090: found /usr/bin/ranlib
configure:9101: result: ranlib
configure:9210: checking for strip
configure:9226: found /usr/bin/strip
configure:9237: result: strip
configure:9346: checking for windres
configure:9376: result: no
configure:9487: checking for windmc
configure:9517: result: no
configure:9628: checking for objcopy
configure:9644: found /usr/bin/objcopy
configure:9655: result: objcopy
configure:9769: checking for objdump
configure:9785: found /usr/bin/objdump
configure:9796: result: objdump
configure:9949: checking for cc
configure:9965: found /usr/bin/cc
configure:9976: result: cc
configure:10110: checking for c++
configure:10126: found /usr/bin/c++
configure:10137: result: c++
configure:10271: checking for gcc
configure:10287: found /usr/bin/gcc
configure:10298: result: gcc
configure:10427: checking for gcj
configure:10443: found /usr/bin/gcj
configure:10454: result: gcj
configure:10588: checking for gfortran
configure:10604: found /usr/bin/gfortran
configure:10615: result: gfortran
configure:10749: checking for gccgo
configure:10779: result: no
configure:10840: checking for ar
configure:10873: result: no
configure:10990: checking for ar
configure:11006: found /usr/bin/ar
configure:11017: result: ar
configure:11070: checking for as
configure:11103: result: no
configure:11220: checking for as
configure:11236: found /usr/bin/as
configure:11247: result: as
configure:11300: checking for dlltool
configure:11333: result: no
configure:11450: checking for dlltool
configure:11480: result: no
configure:11530: checking for ld
configure:11563: result: no
configure:11680: checking for ld
configure:11696: found /usr/bin/ld
configure:11707: result: ld
configure:11760: checking for lipo
configure:11793: result: no
configure:11910: checking for lipo
configure:11940: result: no
configure:11990: checking for nm
configure:12023: result: no
configure:12140: checking for nm
configure:12156: found /usr/bin/nm
configure:12167: result: nm
configure:12220: checking for objdump
configure:12253: result: no
configure:12370: checking for objdump
configure:12386: found /usr/bin/objdump
configure:12397: result: objdump
configure:12450: checking for ranlib
configure:12483: result: no
configure:12600: checking for ranlib
configure:12616: found /usr/bin/ranlib
configure:12627: result: ranlib
configure:12680: checking for strip
configure:12713: result: no
configure:12830: checking for strip
configure:12846: found /usr/bin/strip
configure:12857: result: strip
configure:12910: checking for windres
configure:12943: result: no
configure:13060: checking for windres
configure:13090: result: no
configure:13140: checking for windmc
configure:13173: result: no
configure:13290: checking for windmc
configure:13320: result: no
configure:13348: checking where to find the target ar
configure:13381: result: host tool
configure:13390: checking where to find the target as
configure:13423: result: host tool
configure:13432: checking where to find the target cc
configure:13455: result: just compiled
configure:13474: checking where to find the target c++
configure:13500: result: just compiled
configure:13519: checking where to find the target c++ for libstdc++
configure:13545: result: just compiled
configure:13564: checking where to find the target dlltool
configure:13597: result: host tool
configure:13606: checking where to find the target gcc
configure:13629: result: just compiled
configure:13648: checking where to find the target gcj
configure:13674: result: just compiled
configure:13693: checking where to find the target gfortran
configure:13719: result: just compiled
configure:13738: checking where to find the target gccgo
configure:13774: result: host tool
configure:13783: checking where to find the target ld
configure:13816: result: host tool
configure:13825: checking where to find the target lipo
configure:13847: result: host tool
configure:13856: checking where to find the target nm
configure:13889: result: host tool
configure:13898: checking where to find the target objdump
configure:13931: result: host tool
configure:13940: checking where to find the target ranlib
configure:13973: result: host tool
configure:13982: checking where to find the target strip
configure:14015: result: host tool
configure:14024: checking where to find the target windres
configure:14057: result: host tool
configure:14066: checking where to find the target windmc
configure:14099: result: host tool
configure:14136: checking whether to enable maintainer-specific portions of Makefiles
configure:14145: result: no
configure:14178: checking whether -fkeep-inline-functions is supported
configure:14197: gcc -c -g -O2 -fkeep-inline-functions  conftest.c >&5
configure:14197: $? = 0
configure:14198: result: yes
configure:14395: creating ./config.status

## ---------------------- ##
## Running config.status. ##
## ---------------------- ##

This file was extended by config.status, which was
generated by GNU Autoconf 2.64.  Invocation command line was

  CONFIG_FILES    = 
  CONFIG_HEADERS  = 
  CONFIG_LINKS    = 
  CONFIG_COMMANDS = 
  $ ./config.status 

on lin04.hpc.nottingham.ac.uk

config.status:996: creating Makefile

## ---------------- ##
## Cache variables. ##
## ---------------- ##

#### ---snip---
#### (cut ac_cv_xxx variables so that the log would fit in the post)

acx_cv_cc_gcc_supports_ada=no
acx_cv_prog_LN=ln
gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2'
gcc_cv_tool_dirs=/home/myusername/opt/gcc-4.6.3/libexec/gcc/x86_64-unknown-linux-gnu/4.6.3:/home/myusername/opt/gcc-4.6.3/libexec/gcc/x86_64-unknown-linux-gnu:/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.3:/usr/lib/gcc/x86_64-unknown-linux-gnu:/home/myusername/opt/gcc-4.6.3/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu/4.6.3:/home/myusername/opt/gcc-4.6.3/x86_64-unknown-linux-gnu/bin:
gcc_cv_tool_prefix=/home/myusername/opt/gcc-4.6.3
lt_cv_objdir=.libs

## ----------------- ##
## Output variables. ##
## ----------------- ##

AR='ar'
AR_FOR_BUILD='$(AR)'
AR_FOR_TARGET='$(AR)'
AS='as'
AS_FOR_BUILD='$(AS)'
AS_FOR_TARGET='$(AS)'
AWK='gawk'
BISON='bison'
BUILD_CONFIG='bootstrap-debug'
CC='gcc'
CC_FOR_BUILD='$(CC)'
CC_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/'
CFLAGS='-g -O2'
CFLAGS_FOR_BUILD='-g -O2'
CFLAGS_FOR_TARGET='-g -O2'
COMPILER_AS_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/as'
COMPILER_LD_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/collect-ld'
COMPILER_NM_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/nm'
CONFIGURE_GDB_TK=''
CPPFLAGS=''
CXX='g++'
CXXFLAGS='-g -O2'
CXXFLAGS_FOR_BUILD='-g -O2'
CXXFLAGS_FOR_TARGET='-g -O2'
CXX_FOR_BUILD='$(CXX)'
CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/g++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `if test -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags; then $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes; else echo -funconfigured-libstdc++-v3 ; fi` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
DEBUG_PREFIX_CFLAGS_FOR_TARGET=''
DEFS='-DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DLT_OBJDIR=\".libs/\"'
DLLTOOL='dlltool'
DLLTOOL_FOR_BUILD='$(DLLTOOL)'
DLLTOOL_FOR_TARGET='$(DLLTOOL)'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EXEEXT=''
EXPECT='expect'
FLAGS_FOR_TARGET=' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
FLEX='flex'
GCC_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/'
GCC_SHLIB_SUBDIR=''
GCJ_FOR_BUILD='$(GCJ)'
GCJ_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/gcj -B$$r/$(HOST_SUBDIR)/gcc/'
GDB_TK=''
GFORTRAN_FOR_BUILD='$(GFORTRAN)'
GFORTRAN_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/gfortran -B$$r/$(HOST_SUBDIR)/gcc/'
GNATBIND='no'
GNATMAKE='no'
GOC_FOR_BUILD='$(GOC)'
GOC_FOR_TARGET='$(GOC)'
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_GDB_TK=''
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
LD='ld'
LDFLAGS=''
LDFLAGS_FOR_BUILD=''
LD_FOR_BUILD='$(LD)'
LD_FOR_TARGET='$(LD)'
LEX='flex'
LIBOBJS=''
LIBS=''
LIPO='lipo'
LIPO_FOR_TARGET='$(LIPO)'
LN='ln'
LN_S='ln -s'
LTLIBOBJS=''
M4='m4'
MAINT='#'
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE='#'
MAKEINFO='makeinfo'
NM='nm'
NM_FOR_BUILD='$(NM)'
NM_FOR_TARGET='$(NM)'
OBJCOPY='objcopy'
OBJDUMP='objdump'
OBJDUMP_FOR_TARGET='$(OBJDUMP)'
OBJEXT='o'
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
RANLIB='ranlib'
RANLIB_FOR_BUILD='$(RANLIB)'
RANLIB_FOR_TARGET='$(RANLIB)'
RAW_CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
RPATH_ENVVAR='LD_LIBRARY_PATH'
RUNTEST='runtest'
SED='/bin/sed'
SHELL='/bin/sh'
STRIP='strip'
STRIP_FOR_TARGET='$(STRIP)'
SYSROOT_CFLAGS_FOR_TARGET=''
TOPLEVEL_CONFIGURE_ARGUMENTS='/home/myusername/gcc-temp/gcc-4.6.3/configure --prefix=/home/myusername/opt/gcc-4.6.3 --with-local-prefix=/home/myusername/usr/local'
WINDMC='windmc'
WINDMC_FOR_BUILD='$(WINDMC)'
WINDMC_FOR_TARGET='$(WINDMC)'
WINDRES='windres'
WINDRES_FOR_BUILD='$(WINDRES)'
WINDRES_FOR_TARGET='$(WINDRES)'
YACC='bison -y'
ac_ct_CC='gcc'
ac_ct_CXX='g++'
bindir='${exec_prefix}/bin'
build='x86_64-unknown-linux-gnu'
build_alias=''
build_configargs=' --cache-file=../config.cache '\''--prefix=/home/myusername/opt/gcc-4.6.3'\'' '\''--with-local-prefix=/home/myusername/usr/local'\'' '\''--enable-languages=c,c++,fortran,java,lto,objc'\'' --program-transform-name='\''s,y,y,'\'' --disable-option-checking'
build_configdirs=' libiberty fixincludes'
build_cpu='x86_64'
build_libsubdir='build-x86_64-unknown-linux-gnu'
build_noncanonical='x86_64-unknown-linux-gnu'
build_os='linux-gnu'
build_subdir='build-x86_64-unknown-linux-gnu'
build_tooldir='${exec_prefix}/x86_64-unknown-linux-gnu'
build_vendor='unknown'
clooginc=''
clooglibs=''
compare_exclusions='gcc/cc*-checksum$(objext) | gcc/ada/*tools/*'
config_shell='/bin/sh'
configdirs=' intl libiberty zlib libcpp libdecnumber gmp mpfr mpc fixincludes gcc lto-plugin'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
do_compare='cmp --ignore-initial=16 $$f1 $$f2'
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='${prefix}'
extra_host_libiberty_configure_flags='--enable-shared'
extra_mpc_gmp_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/.libs'
extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/.libs'
extra_mpfr_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/.libs'
gmpinc='-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp -I$$r/$(HOST_SUBDIR)/mpfr -I$$s/mpfr -I$$s/mpc/src '
gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/.libs -L$$r/$(HOST_SUBDIR)/mpfr/.libs -L$$r/$(HOST_SUBDIR)/mpc/src/.libs -lmpc -lmpfr -lgmp'
host='x86_64-unknown-linux-gnu'
host_alias=''
host_configargs=' --cache-file=./config.cache  '\''--prefix=/home/myusername/opt/gcc-4.6.3'\'' '\''--with-local-prefix=/home/myusername/usr/local'\'' '\''--enable-languages=c,c++,fortran,java,lto,objc'\'' --program-transform-name='\''s,y,y,'\'' --disable-option-checking'
host_cpu='x86_64'
host_noncanonical='x86_64-unknown-linux-gnu'
host_os='linux-gnu'
host_subdir='.'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
poststage1_ldflags='-static-libstdc++ -static-libgcc'
poststage1_libs=''
pplinc=''
ppllibs=''
prefix='/home/myusername/opt/gcc-4.6.3'
program_transform_name='s,y,y,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
stage1_cflags='-g -fkeep-inline-functions'
stage1_checking='--enable-checking=yes,types'
stage1_languages='c,lto'
stage1_ldflags=''
stage1_libs=''
stage2_werror_flag=''
sysconfdir='${prefix}/etc'
target='x86_64-unknown-linux-gnu'
target_alias=''
target_configargs='--cache-file=./config.cache --enable-multilib   '\''--prefix=/home/myusername/opt/gcc-4.6.3'\'' '\''--with-local-prefix=/home/myusername/usr/local'\'' '\''--enable-languages=c,c++,fortran,java,lto,objc'\'' --program-transform-name='\''s,y,y,'\'' --disable-option-checking'
target_configdirs=' libgcc libgomp libstdc++-v3 libmudflap libssp libquadmath libgfortran boehm-gc libffi zlib libjava libobjc'
target_cpu='x86_64'
target_noncanonical='x86_64-unknown-linux-gnu'
target_os='linux-gnu'
target_subdir='x86_64-unknown-linux-gnu'
target_vendor='unknown'
tooldir='${exec_prefix}/x86_64-unknown-linux-gnu'

## ------------------- ##
## File substitutions. ##
## ------------------- ##

alphaieee_frag='/dev/null'
host_makefile_frag='/dev/null'
ospace_frag='/dev/null'
serialization_dependencies='serdep.tmp'
target_makefile_frag='/home/myusername/gcc-temp/gcc-4.6.3/config/mt-gnu'

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define LT_OBJDIR ".libs/"

configure: exit 0
share|improve this question

1 Answer 1

up vote 0 down vote accepted

If configure says "MPFR >= 2.4.2 needed", there is probably a good reason for that. I'm not sure whether GCC's build system can compile the libraries before it tries to link against them. The traditional way of doing this, is:

  • build the required libraries and install them into your home directory or a subdirectory thereof, e.g. $HOME/tools (this is usually achieved by setting the --prefix option for the configure scripts) - that creates a tree of bin, include, lib / lib64 and share under the target directory.

  • tell the GCC's buildsystem to use libraries from your preferred directory using the --with-mpfr=$HOME/tools option to configure. Obviously you'll have to add these for any library you'll want to use from a non-standard location - see configure --help for all available options.

Tweaking LD_LIBRARY_PATH isn't likely to help you as it only changes behaviour of the dynamic linker ld.so and it (amlost) always looks into /lib and /usr/lib as a last resort (see man ld.so for in depth explanation).

As a side note, you might want to grab GCC 4.7.2 instead of the older 4.6.3.

share|improve this answer
    
I haven't tried what you say yet, but the install guide leads me to believe that if you extract the tar for mpfr,mpc, and gmp into the gcc src dir, then build things should be OK (cf advogato.org/person/redi/diary/240.html). I have then a separate build dir (not a subdir of gcc of src dir) from which I run: –  fpghost Dec 2 '12 at 23:03
    
/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)/../gcc-4.6.3/mpfr/src/.libs –  fpghost Dec 2 '12 at 23:04
    
this gets rid of previous error but now I get 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` –  fpghost Dec 2 '12 at 23:05
    
I have exported LD_LIBRARY_PATH="" (and others like LIBRARY_PATH are already blank) so no idea why it's behaving like this. –  fpghost Dec 2 '12 at 23:05
    
--with-mpfr... should be used when you already have built the libraries. GCC documentation indeed claims, that if the sources are present in the subdirectories it will build them alongside itself. You can try preparing the source tree again, this time running all cp, mv and similar commands with -v so that you see what really gets moved/copied where. –  peterph Dec 2 '12 at 23:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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