xref: /f-stack/doc/F-Stack_Build_Guide.md (revision 98895edd)
1ba50df96Sxklllll# F-Stack Build GUide
2ba50df96Sxklllll
3ba50df96SxklllllThe procedures to compile f-stack in different linux releases is almost the same, but there are still some points you need to pay attention to. This document aims to help you solve some of the problems you may meet when compiling f-stack in different linux releases.
4ba50df96Sxklllll
5ba50df96Sxklllll```sh
6ba50df96Sxklllll$ sudo -i
7ba50df96Sxklllll# in centos and redhat
8ba50df96Sxklllll$ yum install -y git gcc openssl-devel kernel-devel-$(uname -r) bc numactl-devel python
9ba50df96Sxklllll# in ubuntu
10ba50df96Sxklllll$ apt-get install git gcc openssl libssl-dev linux-headers-$(uname -r) bc libnuma1 libnuma-dev libpcre3 libpcre3-dev zlib1g-dev python
11ba50df96Sxklllll
12ba50df96Sxklllll$ mkdir /data/f-stack
13ba50df96Sxklllll$ git clone https://github.com/F-Stack/f-stack.git /data/f-stack
14ba50df96Sxklllll
15ba50df96Sxklllll# compile dpdk
16ba50df96Sxklllll$ cd /data/f-stack/dpdk
176b8a3e40Sjfb8856606$ meson -Denable_kmods=true build
188d76b62eSfengbojiang$ ninja -C build
198d76b62eSfengbojiang$ ninja -C build install
208d76b62eSfengbojiang
218d76b62eSfengbojiang# Upgrade pkg-config while version < 0.28
228d76b62eSfengbojiang$ cd /data
238d76b62eSfengbojiang$ wget https://pkg-config.freedesktop.org/releases/pkg-config-0.29.2.tar.gz
248d76b62eSfengbojiang$ tar xzvf pkg-config-0.29.2.tar.gz
258d76b62eSfengbojiang$ cd pkg-config-0.29.2
268d76b62eSfengbojiang$ ./configure --with-internal-glib
27ba50df96Sxklllll$ make
288d76b62eSfengbojiang$ make install
298d76b62eSfengbojiang$ mv /usr/bin/pkg-config /usr/bin/pkg-config.bak
308d76b62eSfengbojiang$ ln -s /usr/local/bin/pkg-config /usr/bin/pkg-config
31ba50df96Sxklllll
32ba50df96Sxklllll# Compile f-stack lib
33ba50df96Sxklllll$ export FF_PATH=/data/f-stack
348d76b62eSfengbojiang$ export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/local/lib64/pkgconfig:/usr/lib/pkgconfig
35ba50df96Sxklllll$ cd /data/f-stack/lib
36ba50df96Sxklllll$ make
37ba50df96Sxklllll
38ba50df96Sxklllll# Compile Nginx
3928e10b57Sfengbojiang(姜凤波)$ cd ../app/nginx-1.16.1
40ba50df96Sxklllll$ ./configure --prefix=/usr/local/nginx_fstack --with-ff_module
41ba50df96Sxklllll$ make
42ba50df96Sxklllll$ make install
43ba50df96Sxklllll
44ba50df96Sxklllll# Compile Redis
4514cef497Sfengbojiang$ cd ../redis-5.0.5
46ba50df96Sxklllll$ make
47ba50df96Sxklllll
48ba50df96Sxklllll# Compile f-stack tools
49ba50df96Sxklllll$ cd ../../tools
50ba50df96Sxklllll$ make
51ba50df96Sxklllll
52ba50df96Sxklllll# Compile helloworld examples
53ba50df96Sxklllll$ cd ../examples
54ba50df96Sxklllll$ make
55ba50df96Sxklllll```
56ba50df96Sxklllll
5728e10b57Sfengbojiang(姜凤波)## Compile tools in Ubuntu
58ba50df96Sxklllll
59ba50df96Sxklllll- remove '\\' in statement printf at f-stack/tools/netstat/Makefile line 70, now it should be:
60ba50df96Sxklllll
61ba50df96Sxklllll```
62ba50df96Sxklllll-   printf("\#define\tN%s\t%s\n", toupper($$2), i++);
63ba50df96Sxklllll+   printf("#define\tN%s\t%s\n", toupper($$2), i++);
64ba50df96Sxklllll```
65ba50df96Sxklllll
66ba50df96Sxklllll## Compile dpdk in virtual machine
67ba50df96Sxklllll
68*98895eddSChenzs108- f-stack/dpdk/kernel/linux/igb_uio/igb_uio.c line 274:
69ba50df96Sxklllll```
70ba50df96Sxklllll
71ba50df96Sxklllll-   if (pci_intx_mask_supported(udev->pdev)) {
72ba50df96Sxklllll+   if (true || pci_intx_mask_supported(udev->pdev)) {
73ba50df96Sxklllll```
74