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