README.md 2.37 KB
Newer Older
1
2
3
4
5
simmc-agent
===========

The agent for the SIMMC - Sistema de Monitoramento do Ministério das Comunicações project.

6
7
requirements
------------
8
c++ compiler
9
cmake
10
libudev
11

Davisson Henrique Paulino's avatar
Davisson Henrique Paulino committed
12
13
14
15
16
17
obtaining repository
--------------------
    $ git clone --recursive git@gitlab.c3sl.ufpr.br:simmc/agent.git

the `--recursive` will download the repository and the submodles 

18
19
20
21
building and compiling
----------------------
Run

Davisson Henrique Paulino's avatar
Davisson Henrique Paulino committed
22
	$ mkdir build && cd build
23
24
25
26
27
28
	$ cmake ..
	
to generate a `Makefile`, library objects and misterious CMake files, then

	$ make
	
29
to compile. The resulting executable `agent-vx.x` will be in `agent/bin`.
30
31
32
33
Run it with

	$ ./agent-vx.x

34
35
development
-----------
36

37
### submodules ###
38
39
40
41
42
43
44
45
46
47
Library cpr is a submodule forked from github's repository

[https://github.com/whoshuu/cpr](https://github.com/whoshuu/cpr)

Which contains library curl, forked from github's repository

[https://github.com/curl/curl](https://github.com/curl/curl)

Also mongoose and googletest.

48
49
50
51
52
To get them working, run

	$ git submodule init
	$ git submodule update --init --recursive

53
54
55
Any editions made to such modules must be commited inside the submodule,
to a branch of our own, and further commited in the superior module. Check
[https://git-scm.com/book/en/v2/Git-Tools-Submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules)
56
57
58
59
60
61
62
63
64
65
66
67

TODO: when packing the version for download, make sure these modules are regular directories.

### cmake fails ###
Current `CMakeLists.txt` is not mature, so if you find that building fails
at something that was already corrected, run

	$ rm -rf *

inside the `build` directory and cmake again.

### building and compiling ###
68
69
When compiling and executing the agent locally, in order to see the resulting
JSON objects, run cmake with the option `PRINT_JSON`
70

71
72
73
74
75
	$ cmake -DPRINT_JSON=ON ..

You may also set the `Debug` flag if using gdb

    $ cmake -DCMAKE_BUILD_TYPE=Debug -DPRINT_JSON=ON ..
76
77
78
79
80
81
82
83

documentation
-------------

Clone doxygen project from github

	$ git clone https://github.com/doxygen/doxygen

Davisson Henrique Paulino's avatar
Davisson Henrique Paulino committed
84
requirements - flex lib and bison
85
86
-----------------------

Davisson Henrique Paulino's avatar
Davisson Henrique Paulino committed
87
	# apt-get install flex bison
88
89
90
91
92

Building and compiling
----------------------

	$ cd doxygen
Davisson Henrique Paulino's avatar
Davisson Henrique Paulino committed
93
	$ mkdir build && cd build
94
95
96
97
98
99
100
101
102
103
104
105
	$ cmake -G "Unix Makefiles" ..
	$ make

Testing
-------

Execute doxygen to generate the simmc-agent documentation

	$ doxygen Doxyfile

Will be generated a Documentation directory that contains HTML pages for each file from agent