Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: Template instantiation Up: System generation Previous: makefiles

Subsections



Object libraries

Generation of AIPS++ object libraries and usage of external libraries in AIPS++.


Library control variables

An AIPS++ installation may be configured to maintain a debug version of the object libraries, an optimized version, or both as determined by the setting of these variables. They have names of the form LIB<package>, for example LIBaips, and their values consist of six fields corresponding to the debug and optimized C++, C, and FORTRAN libraries in that order,

   #                    C++            C          FORTRAN
   #                 dbg    opt    dbg    opt    dbg    opt
   #               ------------- ------------- -------------
   LIBaips      := static static defeat defeat static static

Four keywords are recognized:

The library control variables are used by the AIPS++ makefiles (p[*]) to determine whether to compile the debug and/or optimized versions of an object module, and which libraries an executable may be linked with. The library updating procedure, updatelib (p[*]), also uses them to determine which sharable libraries to build.


External libraries

AIPS++ uses many external libraries such as PGPLOT, LAPACK, and X11. These are expected to be installed separately from AIPS++. Other libraries such as Glish and WCSLIB while bundled with AIPS++ are nevertheless treated by makedefs (p[*]) as though they were external.

makedefs (p[*]) contains a set of variables for each external library. For example, for Tcl the variables are

   TCLROOT  := /usr/local
   TCLDEFS  := -DTCL
   TCLINCD   = $(TCLROOT)/include
   TCLLIBD   = $(TCLROOT)/lib
   TCLLIB   := -ltcl

The corresponding variables for Glish and WCSLIB are set to point to the AIPS++ system directories where they are installed.

The per-directory makefile for a class implementation module, an application or test program registers its usage of one or more external libraries via the XLIBLIST variable. For example,

   XLIBLIST := GLISH WCSLIB F77
   include $(word 1, $(AIPSPATH))/code/install/makefile.app

This examples tells makedefs (p[*]) to construct compile and link options using Glish, WCSLIB, and FORTRAN. Note that the order is important, WCSLIB comes before F77 in the list since it uses F77 and not vice versa. It is valid for a library to be repeated although that should not be necessary.

Note also that the mnemonics used for the external libraries are case-sensitive. Most are all-uppercase, Motif is the one exception.

The *ROOT variables in the external library definitions are not used directly by makedefs (p[*]) but may allow the site-specific makedefs to provide a simple redefinition as explained elsewhere (§10.4). The other four variables are only used within makedefs as follows:

While external libraries may have preprocessor definitions associated with them, it is also possible to add preprocessor directives to a per-directory makefile via the CPPMODU variable. CPPMODU is processed within makedefs the same way as preprocessor definitions defined for each external library, that is, they are appended to the C-preprocessor options CPPDBG and CPPOPT and not otherwise used outside makedefs. An example of its usage

   XLIBLIST := GLISH WCSLIB F77
   CPPMODU  := -DAIPS_UNAME
   include $(word 1, $(AIPSPATH))/code/install/makefile.app

Note that preprocessor macro definitions made via CPPMODU must not be platform-specific since this would impede portability. Any such definitions should be made in makedefs.

See also

makedefs (p[*]), AIPS++ makefile definitions.
testdefs (p[*]), test makedefs definitions.
updatelib (p[*]), update an AIPS++ object library.


next up previous contents index
Next: Template instantiation Up: System generation Previous: makefiles   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15