Difference between revisions of "How to install, build and use XDP related packages"

From epsciwiki
Jump to navigation Jump to search
Line 78: Line 78:
 
export SBINDIR=bin
 
export SBINDIR=bin
 
export SCRIPTSDIR=scripts
 
export SCRIPTSDIR=scripts
 +
make install
 +
 +
// to install bps stuff from the libbpf repo (instead of xdl-tools)
 +
export DESTDIR=<install dir>
 +
export PREFIX=""
 
make install
 
make install
  

Revision as of 20:30, 20 October 2023

PAGE UNDER CONSTRUCTION


There are multiple software packages that need to be downloaded, compiled, and installed for XPD-related code to run

Installing libbpf

1st: install the libelf library
sudo apt-get install -y libelf-dev
2nd: get and install the libbpf related files
export DESTDIR=<installation dir>
export PREFIX=""
git clone https://github.com/libbpf/libbpf.git
cd libbpf
cd src
make install
3rd: get and install the libxpd related files
export DESTDIR=<installation dir>
export PREFIX=""
git clone https://github.com/xdp-project/xdp-tools.git
cd xdp-tools
Follow the instructions in xdp-tools/README.md file for compilation. Note: there is no need to do a git submodule on libbpf.

Instructions are at https://github.com/xdp-project/xdp-tutorial , go to the setup_dependencies.org link at https://github.com/xdp-project/xdp-tutorial/blob/master/setup_dependencies.org

This tells us to

// (to get bpftool)
sudo apt install linux-tools-common linux-tools-generic
sudo apt install clang llvm libpcap-dev build-essential
sudo apt install linux-headers-$(uname -r)

// xdl-tools needs emacs
sudo apt install emacs

// you will need to use clang 11 for this to work so install and set commands to this version
sudo apt install clang-11 clang-format-11
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-11 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-11 100
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-11 100
sudo update-alternatives --install /usr/bin/llc llc /usr/bin/llc-11 100

// check to see if this worked by doing
ls -al /usr/bin/clang*
ls -al /etc/alternatives/clang*
ls -al /usr/bin/llc*
ls -al /etc/alternatives/llc*

// now one can do
./configure
make

// to install
export DESTDIR=<install dir>
export LIBDIR=lib
export HDRDIR=include
export MANDIR=share
export SBINDIR=bin
export SCRIPTSDIR=scripts
make install

// to install bps stuff from the libbpf repo (instead of xdl-tools)
export DESTDIR=<install dir>
export PREFIX=""
make install



Clone the repository
git clone --recurse-submodules -b v1.50 --depth 1 --shallow-submodules https://github.com/grpc/grpc
Build the package