$ sudo yum groupinstall 'Development Tools'
$ sudo yum install postgresql-devel pandoc
this can take a quite a while
$ curl https://ftp.gnu.org/gnu/gcc/gcc-8.2.0/gcc-8.2.0.tar.gz -O
$ tar -xvf gcc-8.2.0.tar.gz
$ sudo yum install libmpc-devel mpfr-devel gmp-devel zlib-devel*
$ mkdir gcc-8.2.0-build
$ cd gcc-8.2.0-build/
$ ../gcc-8.2.0/configure --with-system-zlib --disable-multilib --enable-languages=c,c++
$ make -j $(nproc)
$ make install
$ whereis gcc
output: gcc: /usr/bin/gcc /usr/lib/gcc ...
$ gcc --version
output: gcc (GCC) 8.2.0
$ export PATH=/usr/local/bin:$PATH
$ export LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH
Configure libpq (source: https://galactictalk.org/d/20-setting-up-stellar-core-on-centos-7)
Need to configure libpq manually or else you will run into issues. create the file /usr/lib64/pkgconfig/libpq.pc and enter the following contents
prefix=/usr
libdir=${prefix}/lib64
includedir=${prefix}/include/pgsql
Name: LibPQ
Version: 5.5.0
Description: PostgreSQL client library
Requires:
Libs: -L${libdir}/libpq.so -lpq
Cflags: -I${includedir}
$ git clone https://github.com/stellar/stellar-core.git
$ cd stellar-core/
$ git submodule init
$ git submodule update
$ ./autogen.sh
$ ./configure
$ make
$ make check
$ make install
$ which stellar-core
output: /usr/local/bin/stellar-core