You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+73-31
Original file line number
Diff line number
Diff line change
@@ -21,55 +21,97 @@ The SWitch State Service (SWSS) is a collection of software that provides a data
21
21
22
22
## Getting Started
23
23
24
-
### Install
24
+
### Prerequisites
25
+
26
+
Install the following dependencies:
27
+
```
28
+
sudo apt install redis-server
29
+
sudo apt install libhiredis0.14
30
+
sudo apt install libzmq5 libzmq3-dev
31
+
sudo apt install libboost-serialization1.74.0
32
+
sudo apt install libboost1.71-dev
33
+
sudo apt install libasan6
34
+
```
35
+
**Note:** If your are using Ubuntu 18.04, install `libhiredis0.13` instead.
36
+
37
+
Visit the [official sonic-buildimage Azure pipeline for the VS platform](https://dev.azure.com/mssonic/build/_build?definitionId=142&view=branches) and choose the branch that matches the sonic-swss branch you are trying to build or install. Then select the latest successful build.
Download the folder `sonic-buildimage.vs/target/debs/{your host machine's Debian code name}`. You can check the Debian code name of your machine by running `cat /etc/debian_version`.
Extract the downloaded zip file using `unzip sonic-buildimage.vs.zip`. Then navigate to `sonic-buildimage.vs/target/debs/{Debian code name}/` and install the following Debian packages:
**Note:** You can also [build these packages yourself (for the VS platform)](https://github.com/sonic-net/sonic-buildimage/blob/master/README.md).
47
+
48
+
Now, you can either directly install the SONiC SWSS package or you can build it from source and then install it. To install the SONiC SWSS package that is already in `sonic-buildimage.vs/target/debs/{Debian code name}/`, simply run the following command:
echo 'deb http://apt-mo.trafficmanager.net/repos/sonic/ trusty main' | sudo tee -a /etc/apt/sources.list.d/sonic.list
30
-
sudo apt-get update
55
+
Install build dependencies:
56
+
```
57
+
sudo apt install libtool
58
+
sudo apt install autoconf automake
59
+
sudo apt install dh-exec
60
+
sudo apt install nlohmann-json3-dev
61
+
sudo apt install libgmock-dev
62
+
```
31
63
32
-
Install dependencies:
64
+
Clone the `sonic-swss` repository on your host machine: `git clone https://github.com/sonic-net/sonic-swss.git`.
33
65
34
-
sudo apt-get install redis-server -t trusty
35
-
sudo apt-get install libhiredis0.13 -t trusty
36
-
sudo apt-get install libzmq5 libzmq3-dev
37
-
38
-
Install building dependencies:
66
+
Make sure that SAI header files exist in `/usr/include/sai`. Since you have already installed `libsairedis-dev`, `libsaimetadata-dev`, and `libsaivs-dev`, this should already be the case. If you have compiled `libsairedis` yourself, make sure that the SAI header files are copied to `/usr/include/sai`.
39
67
40
-
sudo apt-get install libtool
41
-
sudo apt-get install autoconf automake
42
-
sudo apt-get install dh-exec
68
+
You can compile and install from source using:
69
+
```
70
+
./autogen.sh
71
+
./configure
72
+
make && sudo make install
73
+
```
74
+
**Note:** This will NOT run the mock tests located under `tests/mock_tests`.
43
75
44
-
There are a few different ways you can install SONiC-SWSS.
76
+
You can also build a debian package using:
77
+
```
78
+
./autogen.sh
79
+
fakeroot debian/rules binary
80
+
```
81
+
## Common issues
45
82
46
-
#### Install from Debian Repo
83
+
#### Cannot find `libboost-serialization1.74.0`
47
84
48
-
For your convenience, you can install prepared packages on Debian Jessie:
85
+
Unfortunately, `libboost-serialization1.74.0` is not officially supported on Ubuntu 20.04 (focal) even though it is supported on Debian 11 (bullseye). Therefore, you must build this package from source. You can use a script similar to [this one](https://github.com/ulikoehler/deb-buildscripts/blob/master/deb-boost.sh), but you only need to create a package for the Boost serialization library. You should also make sure that the generated package is named `libboost-serialization1.74.0`. After the package is created, you can install it by running `sudo dpkg -i libboost-serialization1.74.0_1.74.0_amd64.deb`.
49
86
50
-
sudo apt-get install swss
87
+
#### Dependency issue when installing `libzmq3-dev`
51
88
52
-
#### Install from Source
89
+
If you cannot install `libzmq3-dev` because of dependency issues, please check the version of `libkrb5` packages installed on your host machine:
90
+
```
91
+
sudo dpkg -l | grep "libkrb5"
92
+
```
93
+
If the version is not `1.17-6ubuntu4.7`, then you need to install the correct version:
53
94
54
-
Checkout the source: `git clone https://github.com/sonic-net/sonic-swss.git` and install it yourself.
95
+
sudo apt install libkrb5support0=1.17-6ubuntu4.7
96
+
sudo apt install libzmq3-dev
55
97
56
-
Get SAI header files into /usr/include/sai. Put the SAI header files that you use to compile
57
-
libsairedis into /usr/include/sai
98
+
**Warning:** This may remove many packages that are already installed on your system. Please take note of what is being removed.
58
99
59
-
Install prerequisite packages:
100
+
**Note:** Do NOT install `*krb5*`packages that are located in the `sonic-buildimage.vs` folder that you downloaded. These packages have a higher version and will cause dependency issues.
#### Dependency issues when installing some package
62
103
63
-
You can compile and install from source using:
104
+
If you run into dependency issues during the installation of a package, you can run `sudo apt -f install` to fix the issue. But note that if `apt` is unable to fix the dependency problem, it will attempt to remove the broken package(s).
64
105
65
-
./autogen.sh
66
-
./configure
67
-
make && sudo make install
106
+
#### Too many open files
68
107
69
-
You can also build a debian package using:
108
+
If you get a C++ exception with the description "Too many open files" during the mock tests, you should check the maximum number of open files that are permitted on your system:
109
+
```
110
+
ulimit -a | grep "open files"
111
+
```
112
+
You can increase it by executing this command: `ulimit -n 8192`. Feel free to change `8192`. This value worked fine for me.
70
113
71
-
./autogen.sh
72
-
fakeroot debian/rules binary
114
+
**Note:** This change is only valid for the current terminal session. If you want a persistent change, append `ulimit -n 8192` to `~/.bashrc`.
0 commit comments