Skip to content

Commit

Permalink
update the building instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Peng Jian committed Jun 16, 2017
1 parent 020e749 commit cdad9ea
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 36 deletions.
41 changes: 5 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,47 +20,16 @@ Now, the redis commands were supported by Pedis as follow:
* **HyperLogLog**: PFADD, PFCOUNT, PFMERGE
* **OTHER**: ECHO, PING, SELECT

## Building Pedis on Ubuntu 14.04
## Building Pedis

In addition to required packages by Seastar, the following packages are required by Pedis.

Installing required packages:
```
sudo apt-get install libaio-dev ninja-build ragel libhwloc-dev libnuma-dev libpciaccess-dev libcrypto++-dev libboost-all-dev libxen-dev libxml2-dev xfslibs-dev
```

Installing GCC 4.9 for gnu++1y. Unlike the Fedora case above, this will
not harm the existing installation of GCC 4.8, and will install an
additional set of compilers, and additional commands named gcc-4.9,
g++-4.9, etc., that need to be used explicitly, while the "gcc", "g++",
etc., commands continue to point to the 4.8 versions.

```
# Install add-apt-repository
sudo apt-get install software-properties-common python-software-properties
# Use it to add Ubuntu's testing compiler repository
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
# Install gcc 4.9 and relatives
sudo apt-get install g++-4.9
# Also set up necessary header file links and stuff (?)
sudo apt-get install gcc-4.9-multilib g++-4.9-multilib
```

To compile Seastar explicitly using gcc 4.9, use:
```
git clone https://github.com/fastio/pedis.git
cd pedis
git submodule update --init --recursive
./configure.py --compiler=g++-4.9
ninja
```
In fact, the building instructions of Seastar also works for Pedis.

See building instructions for [Fedora](docs/building-fedora.md), [CentOS](docs/building-centos.md) and [Ubuntu](docs/building-ubuntu.md).

## Run Pedis
## Getting started

```
./build/release/pedis --smp 1
./build/release/pedis --c 1 -m 1G
```

Expand Down
14 changes: 14 additions & 0 deletions docs/building-centos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Building Seastar on CentOS

### Building seastar on CentOS 7

Installing required packages:
```
sudo ./install-dependencies.sh
```

To compile Seastar explicitly using gcc 5, use:
```
./configure.py --compiler=/opt/scylladb/bin/g++ --static-stdc++
ninja-build
```
23 changes: 23 additions & 0 deletions docs/building-fedora.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Building Seastar on Fedora

### Building seastar on Fedora 21 and later

Installing required packages:
```
sudo ./install-dependencies.sh
```

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
```

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
14 changes: 14 additions & 0 deletions docs/building-ubuntu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Building Seastar on Ubuntu

### Building seastar on Ubuntu 14.04/15.10/16.04

Installing required packages:
```
sudo ./install-dependencies.sh
```

To compile Seastar explicitly using gcc 5, use:
```
./configure.py --compiler=g++-5
ninja
```
51 changes: 51 additions & 0 deletions install-dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash
#
# This file is open source software, licensed to you under the terms
# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
# distributed with this work for additional information regarding copyright
# ownership. You may not use this file except in compliance with the License.
#
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

. /etc/os-release

if [ "$ID" = "ubuntu" ] || [ "$ID" = "debian" ]; then
if [ "$VERSION_ID" = "14.04" ]; then
if [ ! -f /usr/bin/add-apt-repository ]; then
apt-get -y install software-properties-common
fi

add-apt-repository -y ppa:ubuntu-toolchain-r/test
apt-get -y update
fi
apt-get install -y libaio-dev ninja-build ragel libhwloc-dev libnuma-dev libpciaccess-dev libcrypto++-dev libboost-all-dev libxen-dev libxml2-dev xfslibs-dev libgnutls28-dev liblz4-dev libsctp-dev gcc make libprotobuf-dev protobuf-compiler python3 libunwind8-dev systemtap-sdt-dev
if [ "$ID" = "ubuntu" ]; then
apt-get install -y g++-5
echo "g++-5 is installed for Seastar. To build Seastar with g++-5, specify '--compiler=g++-5' on configure.py"
else # debian
apt-get install -y g++
fi
elif [ "$ID" = "centos" ] || [ "$ID" = "fedora" ]; then
if [ "$ID" = "centos" ]; then
yum install -y epel-release
curl -o /etc/yum.repos.d/scylla-1.2.repo http://downloads.scylladb.com/rpm/centos/scylla-1.2.repo
fi
yum install -y libaio-devel hwloc-devel numactl-devel libpciaccess-devel cryptopp-devel libxml2-devel xfsprogs-devel gnutls-devel lksctp-tools-devel lz4-devel gcc make protobuf-devel protobuf-compiler libunwind-devel systemtap-sdt-devel
if [ "$ID" = "fedora" ]; then
dnf install -y gcc-c++ ninja-build ragel boost-devel xen-devel libubsan libasan
else # centos
yum install -y scylla-binutils scylla-gcc-c++ scylla-ninja-build scylla-ragel scylla-boost-devel scylla-libubsan scylla-libasan scylla-libstdc++-static python34
echo "g++-5 is installed for Seastar. To build Seastar with g++-5, specify '--compiler=/opt/scylladb/bin/g++ --static-stdc++' on configure.py"
echo "Before running ninja-build, execute following command: . /etc/profile.d/scylla.sh"
fi
fi

0 comments on commit cdad9ea

Please sign in to comment.