tcprtt: fix compatibility for python3
[platform/upstream/bcc.git] / INSTALL.md
1 # Installing BCC
2
3 * [Kernel Configuration](#kernel-configuration)
4 * [Packages](#packages)
5   - [Debian](#debian---binary)
6   - [Ubuntu](#ubuntu---binary)
7   - [Fedora](#fedora---binary)
8   - [Arch](#arch---binary)
9   - [Gentoo](#gentoo---portage)
10   - [openSUSE](#opensuse---binary)
11   - [RHEL](#rhel---binary)
12   - [Amazon Linux 1](#Amazon-Linux-1---Binary)
13   - [Amazon Linux 2](#Amazon-Linux-2---Binary)
14   - [Alpine](#alpine---binary)
15 * [Source](#source)
16   - [Debian](#debian---source)
17   - [Ubuntu](#ubuntu---source)
18   - [Fedora](#fedora---source)
19   - [openSUSE](#opensuse---source)
20   - [Centos](#centos---source)
21   - [Amazon Linux](#amazon-linux---source)
22   - [Alpine](#alpine---source)
23   - [Arch](#arch---source)
24 * [Older Instructions](#older-instructions)
25
26 ## Kernel Configuration
27
28 In general, to use these features, a Linux kernel version 4.1 or newer is
29 required. In addition, the kernel should have been compiled with the following
30 flags set:
31
32 ```
33 CONFIG_BPF=y
34 CONFIG_BPF_SYSCALL=y
35 # [optional, for tc filters]
36 CONFIG_NET_CLS_BPF=m
37 # [optional, for tc actions]
38 CONFIG_NET_ACT_BPF=m
39 CONFIG_BPF_JIT=y
40 # [for Linux kernel versions 4.1 through 4.6]
41 CONFIG_HAVE_BPF_JIT=y
42 # [for Linux kernel versions 4.7 and later]
43 CONFIG_HAVE_EBPF_JIT=y
44 # [optional, for kprobes]
45 CONFIG_BPF_EVENTS=y
46 # Need kernel headers through /sys/kernel/kheaders.tar.xz
47 CONFIG_IKHEADERS=y
48 ```
49
50 There are a few optional kernel flags needed for running bcc networking examples on vanilla kernel:
51
52 ```
53 CONFIG_NET_SCH_SFQ=m
54 CONFIG_NET_ACT_POLICE=m
55 CONFIG_NET_ACT_GACT=m
56 CONFIG_DUMMY=m
57 CONFIG_VXLAN=m
58 ```
59
60 Kernel compile flags can usually be checked by looking at `/proc/config.gz` or
61 `/boot/config-<kernel-version>`.
62
63 # Packages
64
65 ## Debian - Binary
66
67 `bcc` and its tools are available in the standard Debian main repository, from the source package [bpfcc](https://packages.debian.org/source/sid/bpfcc) under the names `bpfcc-tools`, `python-bpfcc`, `libbpfcc` and `libbpfcc-dev`.
68
69 ## Ubuntu - Binary
70
71 Versions of bcc are available in the standard Ubuntu
72 Universe repository, as well in iovisor's PPA. The Ubuntu packages have slightly different names: where iovisor
73 packages use `bcc` in the name (e.g. `bcc-tools`), Ubuntu packages use `bpfcc` (e.g.
74 `bpfcc-tools`).
75
76 Currently, BCC packages for both the Ubuntu Universe, and the iovisor builds are outdated. This is a known and tracked in:
77 - [Universe - Ubuntu Launchpad](https://bugs.launchpad.net/ubuntu/+source/bpfcc/+bug/1848137)
78 - [iovisor - BCC GitHub Issues](https://github.com/iovisor/bcc/issues/2678)
79 Currently, [building from source](#ubuntu---source) is currently the only way to get up to date packaged version of bcc.
80
81 **Ubuntu Packages**
82 Source packages and the binary packages produced from them can be
83 found at [packages.ubuntu.com](https://packages.ubuntu.com/search?suite=default&section=all&arch=any&keywords=bpfcc&searchon=sourcenames).
84
85 ```bash
86 sudo apt-get install bpfcc-tools linux-headers-$(uname -r)
87 ```
88
89 The tools are installed in `/sbin` (`/usr/sbin` in Ubuntu 18.04) with a `-bpfcc` extension. Try running `sudo opensnoop-bpfcc`.
90
91 **_Note_**: the Ubuntu packages have different names but the package contents, in most cases, conflict
92 and as such _cannot_ be installed alongside upstream packages. Should one choose to use
93 Ubuntu's packages instead of the upstream iovisor packages (or vice-versa), the
94 conflicting packages will need to be removed.
95
96 The iovisor packages _do_ declare they provide the Ubuntu packages and as such may be
97 used to satisfy dependencies. For example, should one attempt to install package `foo`
98 which declares a dependency on `libbpfcc` while the upstream `libbcc` package is installed,
99 `foo` should install without trouble as `libbcc` declares that it provides `libbpfcc`.
100 That said, one should always test such a configuration in case of version incompatibilities.
101
102 **iovisor packages (Upstream Stable and Signed Packages)**
103
104 ```bash
105 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4052245BD4284CDD
106 echo "deb https://repo.iovisor.org/apt/$(lsb_release -cs) $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/iovisor.list
107 sudo apt-get update
108 sudo apt-get install bcc-tools libbcc-examples linux-headers-$(uname -r)
109 ```
110 (replace `xenial` with `artful` or `bionic` as appropriate). Tools will be installed under /usr/share/bcc/tools.
111
112 **Upstream Nightly Packages**
113
114 ```bash
115 echo "deb [trusted=yes] https://repo.iovisor.org/apt/xenial xenial-nightly main" | sudo tee /etc/apt/sources.list.d/iovisor.list
116 sudo apt-get update
117 sudo apt-get install bcc-tools libbcc-examples linux-headers-$(uname -r)
118 ```
119 (replace `xenial` with `artful` or `bionic` as appropriate)
120
121 ## Fedora - Binary
122
123 ### Fedora 30 and newer
124
125 As of Fedora 30, bcc binaries are available in the standard repository.
126 You can install them via
127
128 ```bash
129 sudo dnf install bcc
130 ```
131
132 **Note**: if you keep getting `Failed to load program: Operation not permitted` when
133 trying to run the `hello_world.py` example as root then you might need to lift
134 the so-called kernel lockdown (cf.
135 [FAQ](https://github.com/iovisor/bcc/blob/c00d10d4552f647491395e326d2e4400f3a0b6c5/FAQ.txt#L24),
136 [background article](https://gehrcke.de/2019/09/running-an-ebpf-program-may-require-lifting-the-kernel-lockdown)).
137
138
139 ### Fedora 29 and older
140
141 Ensure that you are running a 4.2+ kernel with `uname -r`. If not, install a 4.2+ kernel from
142 http://alt.fedoraproject.org/pub/alt/rawhide-kernel-nodebug, for example:
143
144 ```bash
145 sudo dnf config-manager --add-repo=http://alt.fedoraproject.org/pub/alt/rawhide-kernel-nodebug/fedora-rawhide-kernel-nodebug.repo
146 sudo dnf update
147 # reboot
148 ```
149
150 **Nightly Packages**
151
152 Nightly bcc binary packages for Fedora 25, 26, 27, and 28 are hosted at
153 `https://repo.iovisor.org/yum/nightly/f{25,26,27}`.
154
155 To install:
156 ```bash
157 echo -e '[iovisor]\nbaseurl=https://repo.iovisor.org/yum/nightly/f27/$basearch\nenabled=1\ngpgcheck=0' | sudo tee /etc/yum.repos.d/iovisor.repo
158 sudo dnf install bcc-tools kernel-headers kernel-devel
159 ```
160
161 **Stable and Signed Packages**
162
163 Stable bcc binary packages for Fedora 25, 26, 27, and 28 are hosted at
164 `https://repo.iovisor.org/yum/main/f{25,26,27}`.
165
166 ```bash
167 echo -e '[iovisor]\nbaseurl=https://repo.iovisor.org/yum/main/f27/$basearch\nenabled=1' | sudo tee /etc/yum.repos.d/iovisor.repo
168 sudo dnf install bcc-tools kernel-devel-$(uname -r) kernel-headers-$(uname -r)
169 ```
170
171 ## Arch - Binary
172
173 bcc is available in the standard Arch repos, so it can be installed with the `pacman` command:
174 ```
175 # pacman -S bcc bcc-tools python-bcc
176 ```
177
178 ## Gentoo - Portage
179
180 First of all, upgrade the kernel of your choice to a recent version. For example:
181 ```
182 emerge sys-kernel/gentoo-sources
183 ```
184 Then, configure the kernel enabling the features you need. Please consider the following as a starting point:
185 ```
186 CONFIG_BPF=y
187 CONFIG_BPF_SYSCALL=y
188 CONFIG_NET_CLS_BPF=m
189 CONFIG_NET_ACT_BPF=m
190 CONFIG_BPF_JIT=y
191 CONFIG_BPF_EVENTS=y
192 ```
193 Finally, you can install bcc with:
194 ```
195 emerge dev-util/bcc
196 ```
197 The appropriate dependencies (e.g., ```clang```, ```llvm``` with BPF backend) will be pulled automatically.
198
199 ## openSUSE - Binary
200
201 For openSUSE Leap 42.2 (and later) and Tumbleweed, bcc is already included in the official repo. Just install
202 the packages with zypper.
203
204 ```bash
205 sudo zypper ref
206 sudo zypper in bcc-tools bcc-examples
207 ```
208
209 ## RHEL - Binary
210
211 For RHEL 7.6, bcc is already included in the official yum repository as bcc-tools. As part of the install, the following dependencies are installed: bcc.x86_64 0:0.6.1-2.el7 ,llvm-private.x86_64 0:6.0.1-2.el7 ,python-bcc.x86_64 0:0.6.1-2.el7,python-netaddr.noarch 0:0.7.5-9.el7
212
213 ```
214 yum install bcc-tools
215 ```
216
217 ## Amazon Linux 1 - Binary
218 Use case 1. Install BCC for latest kernel available in repo:
219    Tested on Amazon Linux AMI release 2018.03 (kernel 4.14.88-72.73.amzn1.x86_64)
220 ```
221 sudo yum update kernel
222 sudo yum install bcc
223 sudo reboot
224 ```
225
226 Use case 2. Install BCC for your AMI's default kernel (no reboot required):
227    Tested on Amazon Linux AMI release 2018.03 (kernel 4.14.77-70.59.amzn1.x86_64)
228 ```
229 sudo yum install kernel-headers-$(uname -r | cut -d'.' -f1-5)
230 sudo yum install kernel-devel-$(uname -r | cut -d'.' -f1-5)
231 sudo yum install bcc
232 ```
233
234 ## Amazon Linux 2 - Binary
235 Use case 1. Install BCC for your AMI's default kernel (no reboot required):
236    Tested on Amazon Linux AMI release 2020.03 (kernel 4.14.154-128.181.amzn2.x86_64)
237 ```
238 sudo amazon-linux-extras enable BCC
239 sudo yum install kernel-devel-$(uname -r)
240 sudo yum install bcc
241 ```
242
243 ## Alpine - Binary
244
245 As of Alpine 3.11, bcc binaries are available in the community repository:
246
247 ```
248 sudo apk add bcc-tools bcc-doc
249 ```
250
251 The tools are installed in `/usr/share/bcc/tools`.
252
253 **Python Compatibility**
254
255 The binary packages include bindings for Python 3 only. The Python-based tools assume that a `python` binary is available at `/usr/bin/python`, but that may not be true on recent versions of Alpine. If you encounter errors like `<tool-name>: not found`, you can try creating a symlink to the Python 3.x binary like so:
256
257 ```
258 sudo ln -s $(which python3) /usr/bin/python
259 ```
260
261 **Containers**
262
263 Alpine Linux is often used as a base system for containers. `bcc` can be used in such an environment by launching the container in privileged mode with kernel modules available through bind mounts:
264
265 ```
266 sudo docker run --rm -it --privileged \
267   -v /lib/modules:/lib/modules:ro \
268   -v /sys:/sys:ro \
269   -v /usr/src:/usr/src:ro \
270   alpine:3.12
271 ```
272
273 # Source
274
275 ## libbpf Submodule
276
277 Since release v0.10.0, bcc starts to leverage libbpf repo (https://github.com/libbpf/libbpf)
278 to provide wrapper functions to the kernel for bpf syscalls, uapi headers bpf.h/btf.h etc.
279 Unfortunately, the default github release source code does not contain libbpf submodule
280 source code and this will cause build issues.
281
282 To alleviate this problem, starting at release v0.11.0, source code with corresponding
283 libbpf submodule codes will be released as well. See https://github.com/iovisor/bcc/releases.
284
285 ## Debian - Source
286 ### sid
287 #### Repositories
288
289 `/etc/apt/sources.list` should include the `non-free` repository and look something like this:
290
291 ```
292 deb http://deb.debian.org/debian sid main contrib non-free
293 deb-src http://deb.debian.org/debian sid main contrib non-free
294 ```
295
296 #### Install Build Dependencies
297 ```
298 # Before you begin
299 apt-get update
300 # According to https://packages.debian.org/source/sid/bpfcc,
301 # BCC build dependencies:
302 sudo apt-get install arping bison clang-format cmake dh-python \
303   dpkg-dev pkg-kde-tools ethtool flex inetutils-ping iperf \
304   libbpf-dev libclang-dev libclang-cpp-dev libedit-dev libelf-dev \
305   libfl-dev libzip-dev linux-libc-dev llvm-dev libluajit-5.1-dev \
306   luajit python3-netaddr python3-pyroute2 python3-distutils python3
307 ```
308
309 #### Install and compile BCC
310 ```
311 git clone https://github.com/iovisor/bcc.git
312 mkdir bcc/build; cd bcc/build
313 cmake ..
314 make
315 sudo make install
316 ```
317
318 ## Ubuntu - Source
319
320 To build the toolchain from source, one needs:
321 * LLVM 3.7.1 or newer, compiled with BPF support (default=on)
322 * Clang, built from the same tree as LLVM
323 * cmake (>=3.1), gcc (>=4.7), flex, bison
324 * LuaJIT, if you want Lua support
325
326 ### Install build dependencies
327 ```
328 # Trusty (14.04 LTS) and older
329 VER=trusty
330 echo "deb http://llvm.org/apt/$VER/ llvm-toolchain-$VER-3.7 main
331 deb-src http://llvm.org/apt/$VER/ llvm-toolchain-$VER-3.7 main" | \
332   sudo tee /etc/apt/sources.list.d/llvm.list
333 wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
334 sudo apt-get update
335
336 # For Bionic (18.04 LTS)
337 sudo apt-get -y install bison build-essential cmake flex git libedit-dev \
338   libllvm6.0 llvm-6.0-dev libclang-6.0-dev python zlib1g-dev libelf-dev libfl-dev
339
340 # For Eoan (19.10) or Focal (20.04.1 LTS)
341 sudo apt install -y bison build-essential cmake flex git libedit-dev \
342   libllvm7 llvm-7-dev libclang-7-dev python zlib1g-dev libelf-dev libfl-dev
343
344 # For other versions
345 sudo apt-get -y install bison build-essential cmake flex git libedit-dev \
346   libllvm3.7 llvm-3.7-dev libclang-3.7-dev python zlib1g-dev libelf-dev
347
348 # For Lua support
349 sudo apt-get -y install luajit luajit-5.1-dev
350 ```
351
352 ### Install and compile BCC
353
354 ```
355 git clone https://github.com/iovisor/bcc.git
356 mkdir bcc/build; cd bcc/build
357 cmake ..
358 make
359 sudo make install
360 cmake -DPYTHON_CMD=python3 .. # build python3 binding
361 pushd src/python/
362 make
363 sudo make install
364 popd
365 ```
366
367 ## Fedora - Source
368
369 ### Install build dependencies
370
371 ```
372 sudo dnf install -y bison cmake ethtool flex git iperf libstdc++-static \
373   python-netaddr python-pip gcc gcc-c++ make zlib-devel \
374   elfutils-libelf-devel python-cachetools
375 sudo dnf install -y luajit luajit-devel  # for Lua support
376 sudo dnf install -y \
377   http://repo.iovisor.org/yum/extra/mageia/cauldron/x86_64/netperf-2.7.0-1.mga6.x86_64.rpm
378 sudo pip install pyroute2
379 ```
380
381 ### Install binary clang
382
383 ```
384 # FC22
385 wget http://llvm.org/releases/3.7.1/clang+llvm-3.7.1-x86_64-fedora22.tar.xz
386 sudo tar xf clang+llvm-3.7.1-x86_64-fedora22.tar.xz -C /usr/local --strip 1
387
388 # FC23
389 wget http://llvm.org/releases/3.9.0/clang+llvm-3.9.0-x86_64-fedora23.tar.xz
390 sudo tar xf clang+llvm-3.9.0-x86_64-fedora23.tar.xz -C /usr/local --strip 1
391
392 # FC24 and FC25
393 sudo dnf install -y clang clang-devel llvm llvm-devel llvm-static ncurses-devel
394 ```
395
396 ### Install and compile BCC
397 ```
398 git clone https://github.com/iovisor/bcc.git
399 mkdir bcc/build; cd bcc/build
400 cmake ..
401 make
402 sudo make install
403 ```
404
405 ## openSUSE - Source
406
407 ### Install build dependencies
408
409 ```
410 sudo zypper in bison cmake flex gcc gcc-c++ git libelf-devel libstdc++-devel \
411   llvm-devel clang-devel pkg-config python-devel python-setuptools python3-devel \
412   python3-setuptools
413 sudo zypper in luajit-devel       # for lua support in openSUSE Leap 42.2 or later
414 sudo zypper in lua51-luajit-devel # for lua support in openSUSE Tumbleweed
415 ```
416
417 ### Install and compile BCC
418 ```
419 git clone https://github.com/iovisor/bcc.git
420 mkdir bcc/build; cd bcc/build
421 cmake -DLUAJIT_INCLUDE_DIR=`pkg-config --variable=includedir luajit` \ # for lua support
422       ..
423 make
424 sudo make install
425 cmake -DPYTHON_CMD=python3 .. # build python3 binding
426 pushd src/python/
427 make
428 sudo make install
429 popd
430 ```
431
432 ## Centos - Source
433
434 For Centos 7.6 only
435
436 ### Install build dependencies
437
438 ```
439 sudo yum install -y epel-release
440 sudo yum update -y
441 sudo yum groupinstall -y "Development tools"
442 sudo yum install -y elfutils-libelf-devel cmake3 git bison flex ncurses-devel
443 sudo yum install -y luajit luajit-devel  # for Lua support
444 ```
445
446 ### Install and compile LLVM
447
448 You could compile LLVM from source code
449
450 ```
451 curl  -LO  http://releases.llvm.org/7.0.1/llvm-7.0.1.src.tar.xz
452 curl  -LO  http://releases.llvm.org/7.0.1/cfe-7.0.1.src.tar.xz
453 tar -xf cfe-7.0.1.src.tar.xz
454 tar -xf llvm-7.0.1.src.tar.xz
455
456 mkdir clang-build
457 mkdir llvm-build
458
459 cd llvm-build
460 cmake3 -G "Unix Makefiles" -DLLVM_TARGETS_TO_BUILD="BPF;X86" \
461   -DCMAKE_BUILD_TYPE=Release ../llvm-7.0.1.src
462 make
463 sudo make install
464
465 cd ../clang-build
466 cmake3 -G "Unix Makefiles" -DLLVM_TARGETS_TO_BUILD="BPF;X86" \
467   -DCMAKE_BUILD_TYPE=Release ../cfe-7.0.1.src
468 make
469 sudo make install
470 cd ..
471 ```
472
473 or install from centos-release-scl
474
475 ```
476 yum install -y centos-release-scl
477 yum-config-manager --enable rhel-server-rhscl-7-rpms
478 yum install -y devtoolset-7 llvm-toolset-7 llvm-toolset-7-llvm-devel llvm-toolset-7-llvm-static llvm-toolset-7-clang-devel
479 source scl_source enable devtoolset-7 llvm-toolset-7
480 ```
481
482 For permanently enable scl environment, please check https://access.redhat.com/solutions/527703.
483
484 ### Install and compile BCC
485
486 ```
487 git clone https://github.com/iovisor/bcc.git
488 mkdir bcc/build; cd bcc/build
489 cmake3 ..
490 make
491 sudo make install
492 ```
493
494 ## Amazon Linux 1 - Source
495
496 Tested on Amazon Linux AMI release 2018.03 (kernel 4.14.47-56.37.amzn1.x86_64)
497
498 ### Install packages required for building
499 ```
500 # enable epel to get iperf, luajit, luajit-devel, cmake3 (cmake3 is required to support c++11)
501 sudo yum-config-manager --enable epel
502
503 sudo yum install -y bison cmake3 ethtool flex git iperf libstdc++-static python-netaddr python-cachetools gcc gcc-c++ make zlib-devel elfutils-libelf-devel
504 sudo yum install -y luajit luajit-devel
505 sudo yum install -y http://repo.iovisor.org/yum/extra/mageia/cauldron/x86_64/netperf-2.7.0-1.mga6.x86_64.rpm
506 sudo pip install pyroute2
507 sudo yum install -y ncurses-devel
508 ```
509
510 ### Install clang 3.7.1 pre-built binaries
511 ```
512 wget http://releases.llvm.org/3.7.1/clang+llvm-3.7.1-x86_64-fedora22.tar.xz
513 tar xf clang*
514 (cd clang* && sudo cp -R * /usr/local/)
515 ```
516
517 ### Build bcc
518 ```
519 git clone https://github.com/iovisor/bcc.git
520 pushd .
521 mkdir bcc/build; cd bcc/build
522 cmake3 ..
523 time make
524 sudo make install
525 popd
526 ```
527
528 ### Setup required to run the tools
529 ```
530 sudo yum -y install kernel-devel-$(uname -r)
531 sudo mount -t debugfs debugfs /sys/kernel/debug
532 ```
533
534 ### Test
535 ```
536 sudo /usr/share/bcc/tools/execsnoop
537 ```
538
539 ## Amazon Linux 2 - Source
540
541 ```
542 # enable epel to get iperf, luajit, luajit-devel, cmake3 (cmake3 is required to support c++11)
543 sudo yum-config-manager --enable epel
544
545 sudo yum install -y bison cmake3 ethtool flex git iperf libstdc++-static python-netaddr python-cachetools gcc gcc-c++ make zlib-devel elfutils-libelf-devel
546 sudo yum install -y luajit luajit-devel
547 sudo yum install -y http://repo.iovisor.org/yum/extra/mageia/cauldron/x86_64/netperf-2.7.0-1.mga6.x86_64.rpm
548 sudo pip install pyroute2
549 sudo yum install -y ncurses-devel
550 ```
551
552 ### Install clang
553 ```
554 yum install -y clang llvm llvm-devel llvm-static clang-devel clang-libs
555 ```
556
557 ### Build bcc
558 ```
559 git clone https://github.com/iovisor/bcc.git
560 pushd .
561 mkdir bcc/build; cd bcc/build
562 cmake3 ..
563 time make
564 sudo make install
565 popd
566 ```
567
568 ### Setup required to run the tools
569 ```
570 sudo yum -y install kernel-devel-$(uname -r)
571 sudo mount -t debugfs debugfs /sys/kernel/debug
572 ```
573
574 ### Test
575 ```
576 sudo /usr/share/bcc/tools/execsnoop
577 ```
578
579 ## Alpine - Source
580
581 ### Install packages required for building
582
583 ```
584 sudo apk add tar git build-base iperf linux-headers llvm10-dev llvm10-static \
585   clang-dev clang-static cmake python3 flex-dev bison luajit-dev elfutils-dev \
586   zlib-dev
587 ```
588
589 ### Build bcc
590
591 ```
592 git clone https://github.com/iovisor/bcc.git
593 mkdir bcc/build; cd bcc/build
594 # python2 can be substituted here, depending on your environment
595 cmake -DPYTHON_CMD=python3 ..
596 make && sudo make install
597
598 # Optional, but needed if you don't have /usr/bin/python on your system
599 ln -s $(which python3) /usr/bin/python
600 ```
601
602 ### Test
603
604 ```
605 sudo /usr/share/bcc/tools/execsnoop
606 ```
607
608 ## Arch - Source
609
610 ### Install dependencies
611
612 ```
613 pacman -S cmake clang llvm flex bison python
614 ```
615
616 ### Build bcc
617
618 ```
619 git clone https://github.com/iovisor/bcc.git
620 pushd .
621 mkdir bcc/build
622 cd bcc/build
623 cmake .. -DPYTHON_CMD=python3 # for python3 support
624 make -j$(nproc)
625 sudo make install
626 cd src/python
627 make -j$(nproc)
628 sudo make install
629 popd
630 ```
631
632 # Older Instructions
633
634 ## Build LLVM and Clang development libs
635
636 ```
637 git clone https://github.com/llvm/llvm-project.git
638 mkdir -p llvm-project/llvm/build/install
639 cd llvm-project/llvm/build
640 cmake -G "Ninja" -DLLVM_TARGETS_TO_BUILD="BPF;X86" \
641   -DLLVM_ENABLE_PROJECTS="clang" \
642   -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install ..
643 ninja && ninja install
644 export PATH=$PWD/install/bin:$PATH
645 ```