-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.txt
142 lines (89 loc) · 3.71 KB
/
README.txt
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
These are the sources for leafysd, the WiredLeaf project electrophysiology
daemon.
For the impatient
-----------------
On Ubuntu 12.04:
(also tested on Linux Mint 16)
1. Install mandatory dependencies:
$ sudo apt-get install libprotobuf-dev libprotobuf-c0-dev \
libhdf5-serial-dev protobuf-c-compiler scons python \
libevent-dev libpulse-dev
2. Install optional dependencies:
$ sudo apt-get install check python-protobuf protobuf-compiler \
python-h5py python-matplotlib
3. Compile everything:
$ scons
4. Now you can run the daemon, ./build/leafysd. Use "./build/leafysd -h" for
help with command line arguments.
You can install some useful programs later, if you want:
$ sudo apt-get install hdf5-tools hdfview
Mandatory dependencies
----------------------
You can't build the daemon without these. If you only install these, you can
build just the daemon with
$ scons SKIP_TESTS=1 SKIP_UTIL=1
The compiled daemon is build/leafysd. The shared library and its headers are in
build/libsng.
- scons:
http://www.scons.org/
- HDF5's C library:
http://www.hdfgroup.org/
- Google's protocol buffers (libprotobuf) and compiler:
https://code.google.com/p/protobuf/
- C bindings to protobuf (protobuf-c), and compiler:
https://code.google.com/p/protobuf-c/
- Python 2.7 (_not_ 3):
http://www.python.org/
- libevent:
http://libevent.org/
Optional dependencies and useful tools
--------------------------------------
You can build the daemon without these, but you won't be able to run tests or
use the utility programs (under util/). With these installed, you can build
everything with
$ scons
- check: unit test framework for C:
http://check.sourceforge.net/.
- Google's protocol buffer Python bindings and compiler:
https://code.google.com/p/protobuf/
- Python bindings to the HDF5 library:
https://code.google.com/p/h5py/
- Python matplotlib, for graphing HDF5 file contents:
http://matplotlib.org/
- HDF5's command line utilities (h5*) and Java-based file viewer (hdfviewer):
http://www.hdfgroup.org/downloads/index.html
Dealing with tests
------------------
To write a test:
- Tests in C are in subdirectories of test/ matching shell glob 'test-*'.
- Tests in Python are files in test/ matching 'test_*.py'.
To build all the tests (YOU MUST REBUILD AFTER CHANGES):
$ scons
To run all the tests with dummy programs instead of the real data node:
$ ./build/run-tests.py
To run all the tests with the real data node, at default IP address (see
run-tests.py):
$ DO_IT_LIVE=1 ./build/run-tests.py
Run just one test, "foo" (Python: test/test_foo.py, C: test/test-foo/):
$ ./build/run-tests.py foo
Tests can use headers in lib/ and libsng/. They can run the daemon and anything
in util/. See test/test_helpers.py for some help with that.
Repository contents
-------------------
- README.txt: this file.
- SConstruct, site_scons/: build system files.
- lib/: Helper libraries used by the daemon and libsng.
- libsng/: Sources for shared library used by SNG to interact with the daemon.
- proto/: Google protobuf message files. These are kept separate from
the source tree, as we may need to share them with others.
The build system takes care of ensuring that the generated headers
are available ("proto/foo.proto" gets included as
"proto/foo.pb-c.h") and that the generated C sources get built and
linked into the final program.
The build system also generates Python output, but doesn't do anything to get
it into sys.path.
- src/: Daemon source code.
- test/: Test code.
Test programs are a pain to run individually; they need a special
environment. Use run-tests.py for that; see "Dealing with tests", above.
- util/: Miscellaneous helper utilities.