next up previous contents index
Next: 6.3.1 Manual pages Up: 6. Introduction Previous: 6.2.8 history.h   Contents   Index


6.3 Building NEMO programs

Besides writing the actual code for a program, an application programmer has to take care of a few more items before the software can be added and formally be accepted to NEMO. This concerns writing the documentation and possibly a Makefile, the former one preferably in the form of standard UNIX manual pages (man(5)). We have templates for both Makefile's and manual pages. Both these are discussed in detail in the next subsections.

Because NEMO is a development package within which a multitude of people are donating software and libraries, linking a program can become cumbersome. In the most simple case however (no graphics or mathematical libraries needed), only the main NEMO library is needed, and the following command should suffice to produce an executable:

    % cc -g -o snapprint snapprint $NEMOLIB/libnemo.a -lm
or:
    % cc -g -o snapprint snapprint -lnemo -lm

The second form would only work if your cc compiler understands the -L switch, and the $NEMOBIN/cc has installed this feature. See Appendix [*] how to properly install this script.

For graphics programs a solution would be to use the YAPPLIB environment variable.

An example of the compilation of a graphics program:

    % cc -g -o snapplot snapplot.c -lnemo $YAPPLIB -lm

Each user is given a subdirectory in $NEMO/usr, under which code may be donated which can be compiled into the running version of NEMO. Stable code, which has been sufficiently tested and verified, can be placed in one of the appropriate $NEMO/src directories. For proper inclusion of user contributed software a few rules in the Makefile have to be adhered to.

The bake and mknemo script should handle compilation and installation of most of the standard NEMO cases. Some programs, like the N-body integrators, are almost like complicated packages themselves, and require their own Makefile or install script. For most programs you can compile it by:

    % bake snapprint

or to install:6.13

    % mknemo snapprint



Subsections
next up previous contents index
Next: 6.3.1 Manual pages Up: 6. Introduction Previous: 6.2.8 history.h   Contents   Index
(c) Peter Teuben