-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpdserv.tex
More file actions
108 lines (81 loc) · 2.6 KB
/
pdserv.tex
File metadata and controls
108 lines (81 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
\chapter{PdServ}
PdServ is the library that implements the MSR protocol on the server side.
\section{Install prerequisites}
The following prerequisites must be installed to compile PdServ and its test
server.
\noindent Open a terminal and type (the trailing backslash means that
the command continues on the next line).
\begin{shellcmd}
sudo apt install git cmake g++ pkg-config \
libdb-dev libsasl2-dev libyaml-dev \
liblog4cplus-dev libcommoncpp2-dev
\end{shellcmd}
\section{Get the PdServ source code}
Download the source code with git, then switch to the revision that has
been tested in this tutorial (rev 528).
\begin{shellcmd}
cd /tmp
git clone https://gitlab.com/etherlab.org/pdserv.git
cd pdserv
git checkout 528
\end{shellcmd}
\section{Compile the PdServ source code}
PdServ needs \texttt{cmake} to create the Makefile.\\
Do not forget the dot immediately after \texttt{cmake}.
\begin{shellcmd}
cd /tmp/pdserv
cmake . -DCMAKE_INSTALL_PREFIX=/opt/etherlab
make
\end{shellcmd}
\section{Install the PdServ library}
The library is installed in \texttt{/opt/etherlab}. \\
Become root with \texttt{sudo -i}, then run the installation commands.
\begin{shellcmd}
sudo -i
cd /tmp/pdserv
make install
echo /opt/etherlab/lib > /etc/ld.so.conf.d/etherlab.conf
/sbin/ldconfig
ln -sf /opt/etherlab/lib/pkgconfig/libpdserv.pc /usr/share/pkgconfig/
\end{shellcmd}
\section{Compile a test server}
\label{test-server-for-testmanager}
PdServ comes with a test server, but it needs to be patched
to have more visible signals in the viewer.
\noindent Edit the file \texttt{/tmp/pdserv/test/test1.cpp} with
\texttt{gedit},
\begin{shellcmd}
gedit /tmp/pdserv/test/test1.cpp
\end{shellcmd}
\noindent Go to line 165 and add this line at the beginning of the while loop.
\begin{shellout}
s1.c = (s1.c + 1) % 20;
\end{shellout}
\noindent Check the modification with git.
\begin{shellcmd}
cd /tmp/pdserv
git diff
\end{shellcmd}
\begin{shellout}
diff --git a/test/test1.cpp b/test/test1.cpp
index db5cb2d..20c2f68 100644
--- a/test/test1.cpp
+++ b/test/test1.cpp
@@ -170,6 +170,7 @@ int main(int argc, const char *argv[])
int i;
while (1) {
+ s1.c = (s1.c + 1) % 20;
//sleep(1);
usleep(100000);
clock_gettime(CLOCK_REALTIME, &time);
\end{shellout}
\noindent Compile the test server
\begin{shellcmd}
g++ -o test1 test1.cpp -I/opt/etherlab/include -L/opt/etherlab/lib -lpdserv
\end{shellcmd}
\noindent Run the program
\begin{shellcmd}
./test1
\end{shellcmd}
\noindent Keep this program running until the end of the tutorial
to have a test server for TestManager and DLS.