Skip to content

Instantly share code, notes, and snippets.

@poliha
Created October 16, 2018 21:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poliha/2009b172ef3877907da1d9ff3dea5e44 to your computer and use it in GitHub Desktop.
Save poliha/2009b172ef3877907da1d9ff3dea5e44 to your computer and use it in GitHub Desktop.
build stellar core from source on CentOS 7.5

Install dependencies

$ sudo yum groupinstall 'Development Tools'

$ sudo yum install postgresql-devel pandoc

Install the latest gcc from source

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

Confirm gcc installation

$ whereis gcc output: gcc: /usr/bin/gcc /usr/lib/gcc ...

$ gcc --version output: gcc (GCC) 8.2.0

Add gcc directory to path

$ export PATH=/usr/local/bin:$PATH 
$ export LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH

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}

Build Stellar Core

$ 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

Confirm stellar core installation

$ which stellar-core output: /usr/local/bin/stellar-core

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment