Commit edf7baa6 authored by Brenden Blanco's avatar Brenden Blanco

Move INSTALL.md to use more block code

Signed-off-by: default avatarBrenden Blanco <bblanco@plumgrid.com>
parent d0c4fd3c
...@@ -5,13 +5,18 @@ ...@@ -5,13 +5,18 @@
In general, to use these features, a Linux kernel version 4.1 or newer is In general, to use these features, a Linux kernel version 4.1 or newer is
required. In addition, the following flags should be set: required. In addition, the following flags should be set:
- `CONFIG_BPF=y` ```
- `CONFIG_BPF_SYSCALL=y` CONFIG_BPF=y
- `CONFIG_NET_CLS_BPF=m` [optional, for tc filters] CONFIG_BPF_SYSCALL=y
- `CONFIG_NET_ACT_BPF=m` [optional, for tc actions] # [optional, for tc filters]
- `CONFIG_BPF_JIT=y` CONFIG_NET_CLS_BPF=m
- `CONFIG_HAVE_BPF_JIT=y` # [optional, for tc actions]
- `CONFIG_BPF_EVENTS=y` [optional, for kprobes] CONFIG_NET_ACT_BPF=m
CONFIG_BPF_JIT=y
CONFIG_HAVE_BPF_JIT=y
# [optional, for kprobes]
CONFIG_BPF_EVENTS=y
```
# Ubuntu - Binary # Ubuntu - Binary
...@@ -80,7 +85,7 @@ To build the toolchain from source, one needs: ...@@ -80,7 +85,7 @@ To build the toolchain from source, one needs:
* Clang 3.7, built from the same tree as LLVM * Clang 3.7, built from the same tree as LLVM
* cmake, gcc (>=4.7), flex, bison * cmake, gcc (>=4.7), flex, bison
* Install build dependencies ## Install build dependencies
``` ```
VER=trusty VER=trusty
echo "deb http://llvm.org/apt/$VER/ llvm-toolchain-$VER-3.7 main echo "deb http://llvm.org/apt/$VER/ llvm-toolchain-$VER-3.7 main
...@@ -91,7 +96,8 @@ sudo apt-get update ...@@ -91,7 +96,8 @@ sudo apt-get update
sudo apt-get -y install bison build-essential cmake flex git libedit-dev \ sudo apt-get -y install bison build-essential cmake flex git libedit-dev \
libllvm3.7 llvm-3.7-dev libclang-3.7-dev python zlib1g-dev libllvm3.7 llvm-3.7-dev libclang-3.7-dev python zlib1g-dev
``` ```
* Install and compile BCC
## Install and compile BCC
``` ```
git clone https://github.com/iovisor/bcc.git git clone https://github.com/iovisor/bcc.git
mkdir bcc/build; cd bcc/build mkdir bcc/build; cd bcc/build
...@@ -102,26 +108,42 @@ sudo make install ...@@ -102,26 +108,42 @@ sudo make install
# Fedora - From source # Fedora - From source
* Install build dependencies ## Install build dependencies
* `sudo dnf install -y bison cmake ethtool flex git iperf libstdc++-static python-netaddr python-pip gcc gcc-c++ make zlib-devel`
* `sudo dnf install -y http://pkgs.repoforge.org/netperf/netperf-2.6.0-1.el6.rf.x86_64.rpm` ```
* `sudo pip install pyroute2` sudo dnf install -y bison cmake ethtool flex git iperf libstdc++-static \
* Install binary clang python-netaddr python-pip gcc gcc-c++ make zlib-devel
* `wget http://llvm.org/releases/3.7.0/clang+llvm-3.7.0-x86_64-fedora22.tar.xz` sudo dnf install -y \
* `sudo tar xf clang+llvm-3.7.0-x86_64-fedora22.tar.xz -C /usr/local --strip 1` http://pkgs.repoforge.org/netperf/netperf-2.6.0-1.el6.rf.x86_64.rpm
* Install and compile BCC sudo pip install pyroute2
* `git clone https://github.com/iovisor/bcc.git` ```
* `mkdir bcc/build; cd bcc/build`
* [optional] `export CC=/usr/local/bin/clang CXX=/usr/local/bin/clang++` ## Install binary clang
* `cmake .. -DCMAKE_INSTALL_PREFIX=/usr`
* `make` ```
* `sudo make install` wget http://llvm.org/releases/3.7.0/clang+llvm-3.7.0-x86_64-fedora22.tar.xz
sudo tar xf clang+llvm-3.7.0-x86_64-fedora22.tar.xz -C /usr/local --strip 1
```
## Install and compile BCC
```
git clone https://github.com/iovisor/bcc.git
mkdir bcc/build; cd bcc/build
# optional
export CC=/usr/local/bin/clang CXX=/usr/local/bin/clang++
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install
```
# [Old] Build LLVM and Clang development libs # [Old] Build LLVM and Clang development libs
* `git clone http://llvm.org/git/llvm.git` ```
* `cd llvm/tools; git clone http://llvm.org/git/clang.git` git clone http://llvm.org/git/llvm.git
* `cd ..; mkdir -p build/install; cd build` cd llvm/tools; git clone http://llvm.org/git/clang.git
* `cmake -G "Unix Makefiles" -DLLVM_TARGETS_TO_BUILD="BPF;X86" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install ..` cd ..; mkdir -p build/install; cd build
* `make -j4` cmake -G "Unix Makefiles" -DLLVM_TARGETS_TO_BUILD="BPF;X86" \
* `make install` -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install ..
* `export PATH=$PWD/install/bin:$PATH` make -j4
make install
export PATH=$PWD/install/bin:$PATH
```
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment