1

I have followed HDJEMAI suggestion, but when I do

./configure --with-system-zlib --disable-multilib --enable-languages=c,c++

there is this error:

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.

but then if I do

sudo yum install libmpc-devel
Loaded plugins: fastestmirror, nvidia, refresh-packagekit
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: repos-tx.psychz.net
 * elrepo: repos.dfw.lax-noc.com
 * extras: mirrors.thaidns.co.th
 * rpmforge: mirror.team-cymru.org
 * updates: mirror.mojohost.com
No package libmpc-devel available.
Error: Nothing to do

If I look fo the libraries, I have

ls /usr/lib64/libmp
libmpcdec.so.5        libmpfr.so.1.2.0      libmpssconfig.so
libmpcdec.so.5.0.2    libmp.so              libmpssconfig.so.0
libmpfr.so            libmp.so.3            libmpssconfig.so.0.1
libmpfr.so.1          libmp.so.3.1.14

but notice that there is no libmpfr.a as in here. In that same dirrectory I have libgmp.so.

How do I install libmpc-devel? And then how do I install gcc?

HDJEMAI
  • 9,436
  • 46
  • 67
  • 93
user2820579
  • 3,261
  • 7
  • 30
  • 45

1 Answers1

1

You should use contrib/download_prerequisites in the GCC source directory to download the sources of the dependencies. GCC will automatically build and use them during the build process.

Matching system libraries on Red Hat Enterprise Linux 6 are either missing or just too old.

Florian Weimer
  • 32,022
  • 3
  • 48
  • 92
  • Thanks, the installation is done. However, I do not know where the executables are. Going to the file `gcc-7.2.0` there is no bin folder and I cannot guess where I can find `gcc`, `g++` and `gfortran`. – user2820579 Nov 09 '17 at 21:09
  • I can see a `gcc` in here `COLLECT_GCC=/usr/local/bin/gcc COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/7.2.0/lto-wrapper`, but I suspect that's the `yum` installation, which is the one that I don't want to use. – user2820579 Nov 09 '17 at 21:13
  • Have you already run `make install`? It defaults to a `/usr/local` prefix. The Red Hat repositories do not contain programs in `/usr/local/bin`. – Florian Weimer Nov 09 '17 at 21:20
  • Yes, I ran `make install`. It ends with something like `Libraries have been installed in: /usr/local/lib/../lib64`. But in `/usr/local/bin` there is just the gcc that I mentioned before. There is nothing on `etc` either. – user2820579 Nov 09 '17 at 21:26
  • So you have installed GCC to `/usr/local`. It's not clear to me why you aren't done after that. – Florian Weimer Nov 09 '17 at 21:50