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


next up previous contents index
Next: Code development Up: System generation Previous: mkinst

Subsections



updatelib

Update AIPS++ object libraries.

Synopsis

updatelib [-f] package

Description

updatelib updates the object libraries associated with a particular AIPS++ package and language (see §1). It is normally used only by AIPS++ makefiles (p[*]) but can be invoked in stand-alone mode. It can process dual debug and optimized libraries concurrently with another invokation, possibly on another machine.

An ``_f'' or ``_c'' appended to the package name, for example ``aips_f'', indicates that the FORTRAN or C libraries for the package are to be updated rather than the default C++ libraries. The libraries themselves have names of this form, for example $LIBOPTD/libaips_f.a.

The lib and lib/% targets of the implement and fortran makefiles deposit object modules in package/language-specific subdirectories of $ARCHTMPD referred to as $TMPPCKGD, for example $ARCHTMPD/aips_f. These have separate dbg and opt subdirectories for debug and optimized compilations. When the lib rules have finished compiling all modules they invoke updatelib to insert them into the libraries.

Once invoked, updatelib copies the library into the temporary area, inserts the object modules into it, and then ranlibs it. It does this in turn for the debug and and optimized libraries.

updatelib uses the library control variables to determine whether sharable libraries are to be built (see makedefs (p[*])). If so, they are constructed in a subdirectory called BLDSHR.$ID, where $ID is an identification string of the form <user>@<host>.

Only if each static and sharable library was successfully updated does it copy them back to $LIBDBGD and/or $LIBOPTD.

With reference to the library control variables, updatelib explicitly looks for and deletes static and/or shared libraries for the package/language which are not being maintained, thus ensuring that the libraries remain synchronized.

This whole process is complicated by the fact that the debug and optimized libraries for a package-language combination can be updated concurrently by multiple invokations of updatelib, possibly on different machines. Independent invokations of updatelib communicate via semaphore files with names of the form updatelib.*. These are described below.

Options

-f
Force a ranlib and rebuild of the sharable objects (if applicable) even if no new object modules are found.

Notes

Diagnostics

Status return values
0: success
1: initialization error
2: library update failed

If any library update fails, none of the libraries will be updated--with one exception: if a static library build succeeds and its corresponding shared library build fails then the static library will be updated.

Examples

The command

   updatelib aips

would update $LIBDBGD/libaips.a, $LIBOPTD/libaips.a, and the corresponding sharable libraries if enabled for the installation.

Files

updatelib uses the following semaphore files:

$TMPPCKGD/updatelib.process.$ID
...This file simply declares an invokation of updatelib. updatelib determines whether it is the first invokation by testing for the existence of any file with a name of the form updatelib.process.*.

$TMPPCKGD/updatelib.proceed
...This file is created by the first invokation of updatelib. It is used as an ``all-is-well'' semaphore and is deleted by any invokation which fails to update a library. Other invokations abort their updates if it disappears.

$TMPPCKGD/{dbg,opt}/updatelib.$ID
...This is a lock file for the task of updating the static library, whether debug or optimized, and possibly its sharable counterpart. Files older than 24 hours are ignored when testing for the existence of one of these locks. If a valid lock does already exist then updatelib reports it before looking for further work.

$TMPPCKGD/{dbg,opt}/updatelib.done
...When an invokation of updatelib has finished updating the library it renames updatelib.$ID to updatelib.done and then looks for further work. The invokation which has reserved the job of installing the updated libraries tests for the existence of this file as a signal that the invokation responsible for updating the library has finished.

$TMPPCKGD/updatelib.lock
...Lock file for the invokation of updatelib which will install the updated libraries. If an invokation sees that this file already exists it waits for it to disappear before proceeding, thereby synchronizing the termination of multiple invokations and ensuring that updatelib doesn't return before the library update is complete.

The invokation of updatelib which installs the libraries also deletes all semaphore files on completion.

See also

The unix manual page for ar(1).
The unix manual page for ranlib(1).
AIPS++ variable names (§1.2).
makedefs (p[*]), AIPS++ makefile definitions.
makefiles (p[*]), GNU makefiles used to rebuild AIPS++.

Author

Original: 1992/04/03 by Mark Calabretta, ATNF.


next up previous contents index
Next: Code development Up: System generation Previous: mkinst   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