GNU Astronomy Utilities

Next: , Previous: , Up: Library   [Contents][Index]

10.3 Gnuastro library

Gnuastro library’s programming constructs (function declarations, macros, data structures, or global variables) are classified by context into multiple header files (see Headers)128. In this section, the functions in each header will be discussed under a separate sub-section, which includes the name of the header. Assuming a function declaration is in headername.h, you can include its declaration in your source code with:

# include <gnuastro/headername.h>

The names of all constructs in headername.h are prefixed with gal_headername_ (or GAL_HEADERNAME_ for macros). The gal_ prefix stands for GNU Astronomy Library.

Gnuastro library functions are compiled into a single file which can be linked on the command-line with the -lgnuastro option, (see Linking and Summary and example on libraries for an introduction on linking and example). Gnuastro library is a high-level library which depends on lower level libraries for some operations (see Dependencies). Therefore if at least one of Gnuastro’s functions in your program use functions from the dependencies, you will also need to link those dependencies after linking with Gnuastro. The outside libraries that need to be linked for such functions are mentioned following the function name. See BuildProgram for a small Gnuastro program that will take care of the libraries to link against and lets you focus on your exciting science.

Libraries are still under heavy development: Gnuastro was initially created to be a collection of command-line programs. However, as the programs and their the shared functions grew, internal (not installed) libraries were added. Since the 0.2 release, the libraries are install-able. Hence the libraries are currently under heavy development and will significantly evolve between releases and will become more mature and stable in due time. It will stabilize with the removal of this notice. Check the NEWS file for interface changes. If you use the Info version of this manual (see Info), you don’t have to worry: the documentation will correspond to your installed version.



Within Gnuastro’s source, all installed .h files in lib/gnuastro/ are accompanied by a .c file in /lib/.

Next: , Previous: , Up: Library   [Contents][Index]