forked from johnynek/netmodeler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
72 lines (51 loc) · 2.56 KB
/
README
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
Netmodeler uses the autoconf and automake build system.
There is a script called bootstrap.sh which should allow you to build
everything (for those of us that have not bothered to understand
autoconf).
After running the bootstrap code, you may need to go into the src
directory and type
make netmodeler.h
(Obviously the above is purely due to the author's autoconf/automake
ignorance).
After that, you are on your own!
The above should make the libnetmod.a library and the netmodeler executable from
the main.cpp in the main library. This main.cpp probably is not exactly what
you want. Check the examples directory for simpler examples.
To write your own code you just use any parts you would like, then using the
compiler, link to the libnetmod.a. For g++ (the GNU C++ compiler), you could
do the following:
First compile your my.cpp:
g++ -c my.cpp -I /path/to/headers/
Then link it:
g++ -o test my.o /path/to/library/libnetmod.a
The default path is src/.libs/libnetmod.a
now, the executible "test" should be your code.
You may need to give a complete path to the headers (which is represented in
the above example as /path/to/headers/) and you may need to give the complete
path to the libnetmod.a file (which is represented above as
/path/to/library/).
You may want to make new classes in /src/ directory.
After making new files (Let's name them yourfile.cpp and yourfile.h), You need to add your files to the input to Makefile.
Add yourfile.cpp and yourfile.h to 'libnetmod_la_SOURCES' in /src/Makefile.in
Add yourfile.lo to 'am_libnetmod_la_OBJECTS' in /src/Makefile.in
run 'make' in the upper directory.
Now, you can use your own classes.
======SWIG/Python Support=====
Netmodeler now has some support for SWIG, which allows us to use netmodeler
from languages other than C/C++. To enable this, use:
./configure --enable-swig
This requires swig to be installed as well as the headers for python (and
in the future maybe other languages). Go to the pytools directory to see
some examples of using python with netmodeler.
======CODE DOCUMENTATION======
The source code is annotated with doxygen (Javadoc) style comments. Not all
of the code is properly documented, but much of it is. To produce this
documentation, go into the doc directory, and type:
doxygen netmodeler.doxy
Of course, you will need doxygen installed. This will produce HTML and latex
documentation that should help you get an idea of the structure of the code.
If you are lost, I recommend looking at the software in the tools directory
for examples of code that does something useful.
Good Luck,
POB