I would like to install the latest version of gcc in a local account (not having administrator privileges). I need the latest version to be used by default in my local account since it is required for the installation of another software. I have ended up using Windows for running my programs just because of this problem with the gcc installation. I am still hoping to find a solution and convert to Linux since it is much faster.
I have installed first successfully all the dependencies and I have attached the code in installdependencies.txt.
I have modified the bash profile as follows (although I got the error even before this modification):
PATH=/home/geo6/build/gmp-6.0.0:/home/geo6/build/mpfr-3.1.2:/home/geo6/build/mpc-1.0.2:$PATH
Code used to install gcc:
Build gcc:
#tar xjf gcc-g++-4.5.0.tar.bz2 # optional
mkdir ~/gcc-4.9.2
cd ~/build
tar xzf /home/geo6/contrib/gcc-4.9.2.tar.gz
cd gcc-4.9.2
LD_LIBRARY_PATH=/home/geo6/gmp-6.0.0/lib:/home/geo6/mpfr-3.1.2/lib:/home/geo6/mpc-1.0.2/lib
./configure --disable-shared --enable-static --prefix=/home/geo6/gcc-4.9.2 --with-gmp=/home/geo6/build/gmp-6.0.0 --with-mpfr=/home/geo6/build/mpfr-3.1.2 --with-mpc=/home/geo6/build/mpc-1.0.2 --disable-multilib
I also checked the folder home/geo6/build/gmp-6.0.0 and gmp.h is listed there.
The error I get is the following:
checking for the correct version of gmp.h... no
configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ 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.
This issue has been reported and asked in other questions and as far as I have understood one solution is to move the gmp and mpfr into the gcc folder so I tried:
mv gmp-6.0.0 gcc-4.9.2/gmp
mv mpfr-3.1.2 gcc-4.9.2/mpfr
However I got the same error.
Any help is greatly appreciated.