Skip to content

Instantly share code, notes, and snippets.

@brendangregg
Created September 21, 2015 20:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brendangregg/cfa482acb71aa577789c to your computer and use it in GitHub Desktop.
Save brendangregg/cfa482acb71aa577789c to your computer and use it in GitHub Desktop.
bcc build steps, 21-sep-2015
To get https://github.com/iovisor/bcc running (eBPF front-end)
# do a normal linux 4.3+ build, or get 4.3+ pkgs (https://github.com/iovisor/bcc/blob/master/INSTALL.md#ubuntu---binary)
sudo apt-get -y install bison build-essential cmake flex git libedit-dev python zlib1g-dev
# Build LLVM and Clang development libs
git clone --depth 1 http://llvm.org/git/llvm.git
cd llvm/tools; git clone --depth 1 http://llvm.org/git/clang.git
cd ..; mkdir -p build/install; cd build
cmake -G "Unix Makefiles" -DLLVM_TARGETS_TO_BUILD="BPF;X86" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install ..
make -j4
make install
export PATH=$PWD/install/bin:$PATH # and add this to ~/.bashrc
# Install and compile BCC
cd /mnt/src
git clone https://github.com/iovisor/bcc.git
mkdir bcc/build; cd bcc/build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install
# test
cd ../examples
./hello_world.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment