-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathREADME
More file actions
276 lines (243 loc) · 9.96 KB
/
README
File metadata and controls
276 lines (243 loc) · 9.96 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
EVM (EVENT MACHINE) SOFTWARE PROJECT
====================================
--------------------------------------------------------------------
Copyright 2019 Samo Pogacnik <samo_pogacnik@t-2.net>
The EVM software project is provided under the terms of the
Apache License, Version 2.0, which is available in the LICENSE file
of this project.
--------------------------------------------------------------------
The EVM (EVent Machine) software is a C library named libevm. Its public
API is defined in "libevm.h".
Features:
=========
- Check "design-notes" under docs...
Building:
=========
Prepare sources:
----------------
$
$ git clone https://github.com/spog/evm.git
Cloning into 'evm'...
remote: Enumerating objects: 553, done.
remote: Counting objects: 100% (553/553), done.
remote: Compressing objects: 100% (209/209), done.
remote: Total 1035 (delta 348), reused 511 (delta 313), pack-reused 482
Receiving objects: 100% (1035/1035), 235.85 KiB | 973.00 KiB/s, done.
Resolving deltas: 100% (623/623), done.
$
$
$ cd evm
evm$
evm$
evm$ ls -la
skupno 60
drwxr-xr-x 7 samo samo 4096 maj 2 12:23 .
drwxr-xr-x 19 samo samo 4096 maj 2 12:22 ..
drwxr-xr-x 2 samo samo 4096 maj 2 18:22 automk
-rw-r--r-- 1 samo samo 1218 maj 2 12:22 config.mk
lrwxrwxrwx 1 samo samo 16 maj 2 12:22 configure -> automk/configure
drwxr-xr-x 2 samo samo 4096 maj 2 12:22 demos
drwxr-xr-x 2 samo samo 4096 maj 2 12:22 docs
drwxr-xr-x 8 samo samo 4096 maj 2 12:22 .git
drwxr-xr-x 3 samo samo 4096 maj 2 12:22 include
drwxr-xr-x 3 samo samo 4096 maj 2 12:22 libs
-rw-r--r-- 1 samo samo 10175 maj 2 12:22 LICENSE
lrwxrwxrwx 1 samo samo 15 maj 2 12:22 Makefile -> automk/Makefile
-rw-r--r-- 1 samo samo 8787 maj 2 12:22 README
-rw-r--r-- 1 samo samo 20 maj 2 12:22 TODO
evm$
Configure:
----------
evm$
evm$ env BUILDIR=./build PREFIX=/usr/local ./configure
Sources absolute path (_SRCDIR_): .../evm
Build absolute path (_BUILDIR_): .../evm/build
Sources relative path (SRCDIR): .
Build relative path (BUILDIR): .build/
Target absolute installation prefix path (PREFIX): /usr/local
--
Later (in the installation command), you may provide additional absolute
target installation path prefix via the DESTDIR environment variable!
--
Creating the build directory...
No extra environment shell script provided to configure!
make: Entering directory '.../evm'
.../evm/automk/default.sh generate_makefile .
generate_makefile: .../evm/.build/./auto.mk
Done!
.../evm/automk/default.sh submakes_config .
submakes_config: .../evm/automk/configure.mk configure
make[1]: Entering directory '.../evm/libs'
.../evm/automk/default.sh generate_makefile libs
generate_makefile: .../evm/.build/libs/auto.mk
Done!
.../evm/automk/default.sh submakes_config libs
submakes_config: .../evm/automk/configure.mk configure
make[2]: Entering directory '.../evm/libs/evm'
.../evm/automk/default.sh generate_makefile libs/evm
generate_makefile: .../evm/.build/libs/evm/auto.mk
Done!
.../evm/automk/default.sh submakes_config libs/evm
make[2]: Leaving directory '.../evm/libs/evm'
make[1]: Leaving directory '.../evm/libs'
submakes_config: .../evm/automk/configure.mk configure
make[1]: Entering directory '.../evm/demos'
.../evm/automk/default.sh generate_makefile demos
generate_makefile: .../evm/.build/demos/auto.mk
Done!
.../evm/automk/default.sh submakes_config demos
make[1]: Leaving directory '.../evm/demos'
make: Leaving directory '.../evm'
evm$
Make:
-----
evm$
evm$ make
.../evm/automk/default.sh targets_make all
Sources absolute path (_SRCDIR_): .../evm
Build absolute path (_BUILDIR_): .../evm/.build
Target absolute installation prefix path (PREFIX): /usr/local
Additional absolute target installation path prefix (DESTDIR):
No extra environment shell script provided to configure!
targets_make: .../evm/.build/./libs/auto.mk all
make[1]: Entering directory '.../evm/libs'
.../evm/automk/default.sh targets_make all
targets_make: .../evm/.build/libs/evm/auto.mk all
make[2]: Entering directory '.../evm/libs/evm'
.../evm/automk/default.sh targets_make all
targets_make: .../evm/libs/evm/libevm.mk all
make[3]: Entering directory '.../evm/libs/evm'
...
make[3]: Leaving directory '.../evm/libs/evm'
make[2]: Leaving directory '.../evm/libs/evm'
make[1]: Leaving directory '.../U2UP/evm/libs'
targets_make: .../evm/.build/./demos/auto.mk all
make[1]: Entering directory '.../evm/demos'
...
make[1]: Leaving directory '.../evm/demos'
evm$
Install (user):
---------------
evm$
evm$ env DESTDIR=$(pwd)/install make install
.../evm/automk/default.sh targets_make install
Sources absolute path (_SRCDIR_): .../evm
Build absolute path (_BUILDIR_): .../evm/.build
Target absolute installation prefix path (PREFIX): /usr/local
Additional absolute target installation path prefix (DESTDIR): .../evm/install
No extra environment shell script provided to configure!
targets_make: .../evm/.build/./libs/auto.mk install
make[1]: Entering directory '.../evm/libs'
.../evm/automk/default.sh targets_make install
targets_make: .../evm/.build/libs/evm/auto.mk install
make[2]: Entering directory '.../evm/libs/evm'
.../evm/automk/default.sh targets_make install
targets_make: .../evm/libs/evm/libevm.mk install
make[3]: Entering directory '.../evm/libs/evm'
install -d .../evm/install/usr/local/lib
install .../evm/.build/libs/evm/libevm.so .../evm/install/usr/local/lib/libevm.so
install -d .../evm/install/usr/local/include/evm
install .../evm/include/evm/libevm.h .../evm/install/usr/local/include/evm/libevm.h
make[3]: Leaving directory '.../evm/libs/evm'
make[2]: Leaving directory '.../evm/libs/evm'
make[1]: Leaving directory '../evm/libs'
targets_make: .../evm/.build/./demos/auto.mk install
make[1]: Entering directory '.../evm/demos'
.../evm/automk/default.sh targets_make install
targets_make: .../evm/demos/hello1.mk install
install -d .../evm/install/usr/local/bin
install .../evm/.build/demos/hello1_evm .../evm/install/usr/local/bin/hello1_evm
...
make[1]: Leaving directory '.../evm/demos'
evm$
Install (system-local):
-----------------------
evm$
evm$ sudo su
evm#
evm#
evm# make install
.../evm/automk/default.sh targets_make install
Sources absolute path (_SRCDIR_): .../evm
Build absolute path (_BUILDIR_): .../evm/.build
Target absolute installation prefix path (PREFIX): /usr/local
Additional absolute target installation path prefix (DESTDIR):
No extra environment shell script provided to configure!
targets_make: .../evm/.build/./libs/auto.mk install
make[1]: Entering directory '.../evm/libs'
.../evm/automk/default.sh targets_make install
targets_make: .../evm/.build/libs/evm/auto.mk install
make[2]: Entering directory '.../evm/libs/evm'
.../evm/automk/default.sh targets_make install
targets_make: .../evm/libs/evm/libevm.mk install
make[3]: Entering directory '.../evm/libs/evm'
install .../evm/.build/libs/evm/libevm.so /usr/local/lib/libevm.so
install .../evm/include/evm/libevm.h /usr/local/include/evm/libevm.h
make[3]: Leaving directory '.../evm/libs/evm'
make[2]: Leaving directory '.../evm/libs/evm'
make[1]: Leaving directory '.../evm/libs'
targets_make: .../evm/.build/./demos/auto.mk install
make[1]: Entering directory '.../evm/demos'
.../evm/automk/default.sh targets_make install
targets_make: .../evm/demos/hello1.mk install
install .../evm/.build/demos/hello1_evm /usr/local/bin/hello1_evm
...
make[1]: Leaving directory '.../evm/demos'
evm#
evm#
evm# exit
evm$
Clean:
------
evm$
evm$ make clean
.../evm/automk/default.sh targets_make clean
Sources absolute path (_SRCDIR_): .../evm
Build absolute path (_BUILDIR_): .../evm/.build
Target absolute installation prefix path (PREFIX): /usr/local
Additional absolute target installation path prefix (DESTDIR):
No extra environment shell script provided to configure!
targets_make: .../evm/.build/./libs/auto.mk clean
make[1]: Entering directory '.../evm/libs'
.../evm/automk/default.sh targets_make clean
targets_make: .../evm/.build/libs/evm/auto.mk clean
make[2]: Entering directory '.../evm/libs/evm'
.../evm/automk/default.sh targets_make clean
targets_make: .../evm/libs/evm/libevm.mk clean
make[3]: Entering directory '.../evm/libs/evm'
...
make[3]: Leaving directory '.../evm/libs/evm'
make[2]: Leaving directory '.../evm/libs/evm'
make[1]: Leaving directory '.../evm/libs'
targets_make: .../evm/.build/./demos/auto.mk clean
make[1]: Entering directory '.../evm/demos'
.../evm/automk/default.sh targets_make clean
...
make[1]: Leaving directory '.../evm/demos'
evm$
If you want to remove all files not under version control and you are using git:
--------------------------------------------------------------------------------
$ git clean -d -f -x
Demos:
======
Programs included under "demos" directory demonstrate usage of the framework.
"hello1_evm" - Minimal framework utilization by sending HELLO message to itself
on every IDLE timer expiration. Sending messages to ourself may be accomplished
directly in framework without any system call (as in this demo).
"hello2_evm" - This demo shows sending message between two processes. The parent
process sends the first HELLO message to its child process. Every received
message in a child or parent process sets new timeout and another HELLO
message is sent back to the sender process after timeout expiration.
"hello3_evm" - This a threaded version of the second demo. The first
thread sends the first HELLO message to the second thread. Every received
message in any thread sets new timeout and another HELLO message is sent back
to the sender thread after timeout expiration.
"hello4_evm" - This is the one to many threaded example. The initial thread
spawns requested number of other threads and sets QUIT timer. Each other thread
sends initial HELLO message to the first thread. Every received message in any
thread sets a new IDLE timeout and another HELLO message is sent back to the
sender thread after timeout expiration.
"hello5_evm" - This is the one to many threaded example like "hello4". The
difference is, that initial thread posts a message to a topic, instead of sending
individual messages to each additional thread. Additional threads are being
subscribed to this topic at their creation.