Skip to content
Ziyi Yan edited this page Apr 26, 2019 · 13 revisions

Building seastar on Fedora 24

Installing required packages:

dnf install gcc-c++ libaio-devel ninja-build ragel hwloc-devel numactl-devel libpciaccess-devel cryptopp-devel \
gnutls-c++ gnutls-devel boost-devel lksctp-tools-devel xen-devel libasan libubsan libxml2-devel xfsprogs-devel

You then need to run the following to create the "build.ninja" file:

./configure.py

Note it is enough to run this once, and you don't need to repeat it before every build. build.ninja includes a rule which will automatically re-run ./configure.py if it changes.

Then finally:

ninja-build

Building seastar on Fedora 21

Installing required packages:

yum install gcc-c++ libaio-devel ninja-build ragel hwloc-devel numactl-devel libpciaccess-devel cryptopp-devel

You then need to run the following to create the "build.ninja" file:

./configure.py

Then finally:

ninja-build

Building seastar on Ubuntu 15.04

Installing required packages:

sudo apt-get install libaio-dev ninja-build ragel libhwloc-dev libnuma-dev libpciaccess-dev libcrypto++-dev libboost-all-dev

Download seastar

git clone https://github.com/scylladb/seastar.git

You then need to run the following to create the "build.ninja" file:

cd seastar
./configure.py

Note it is enough to run this once, and you don't need to repeat it before every build. build.ninja includes a rule which will automatically re-run ./configure.py if it changes.

to invoke the compiler:

ninja

Gotchas:

  1. In ubuntu 15.04 there are 2 different packages. ninja-build and ninja. Both the packages create binary with the same name ninja. But the location of the 2 binaries is different: package -- ninja-build creates /usr/bin/ninja -- ninja creates /use/sbin/ninja Make sure that you are invoking /usr/bin/ninja

  2. In case there are compilation issues, especially like g++: internal compiler error: Killed (program cc1plus) try giving more memory to gcc,
    either by limiting the amount of threads ( -j1 ) and/or allowing at least
    4g ram to your machine

Building seastar on Fedora 20

Installing required packages:

yum install gcc-c++ libaio-devel ninja-build ragel hwloc-devel numactl-devel

You then need to run the following to create the "build.ninja" file:

./configure.py

Note it is enough to run this once, and you don't need to repeat it before every build. build.ninja includes a rule which will automatically re-run ./configure.py if it changes.

Then finally:

ninja-build

Building seastar on Fedora 20

Installing GCC 4.9 for gnu++1y:

  • Beware that this installation will replace your current GCC version.
yum install fedora-release-rawhide
yum --enablerepo rawhide update gcc-c++
yum --enablerepo rawhide install libubsan libasan

Installing required packages:

yum install libaio-devel ninja-build ragel hwloc-devel numactl-devel

You then need to run the following to create the "build.ninja" file:

./configure.py

Note it is enough to run this once, and you don't need to repeat it before every build. build.ninja includes a rule which will automatically re-run ./configure.py if it changes.

Then finally:

ninja-build

Building seastar in Docker container

If your host OS does not provide a sufficiently recent version of gcc (4.9 or later is required), you can build seastar inside a docker container:

To build a Docker image:

docker build -t seastar-dev . -f docker/dev/Dockerfile

Create a shell function for building inside the container (bash syntax given):

$ seabuild() { docker run -v $HOME/seastar/:/seastar -u $(id -u):$(id -g) -w /seastar -t seastar-dev "$@"; }

(it is recommended to put this inside your .bashrc or similar)

To build inside a container:

$ seabuild ./configure.py
$ seabuild ninja-build

Building with a DPDK network backend

  • Setup host to compile seastar

  • Setup host to compile DPDK:

    • Ubuntu
sudo apt-get install -y build-essential linux-image-extra-`uname -r`
  • Prepare a DPDK SDK:

    • Download the latest DPDK release: wget http://dpdk.org/browse/dpdk/snapshot/dpdk-1.8.0.tar.gz
    • Untar it.
    • Edit config/common_linuxapp:
      • set CONFIG_RTE_MBUF_REFCNT to 'n'.
      • set CONFIG_RTE_MAX_MEMSEG to 4096
    • Start the tools/setup.sh script as root.
    • Compile a linuxapp target (option 9).
    • Install IGB_UIO module (option 11).
    • Bind some physical port to IGB_UIO (option 17).
    • Configure hugepage mappings (option 14/15).
  • Run a configure.py:

./configure.py --dpdk-target <Path to untared dpdk-1.8.0 above>/x86_64-native-linuxapp-gcc 
  • Run ninja-build.