mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
The SOFA Library

The IAU's Standards of Fundamental Astronomy library

Introduction

The International Astronomical Union maintains and distributes the Standards of Fundamental Astronomy (SOFA) c and Fortran libraries. mxlib depends on SOFA for time and astronomical calculations, and it is generally a good thing to have if you do astronomy coding.

Getting SOFA

SOFA can be found at http://www.iausofa.org/index.html .

As of May 2014 the direct link to the downloads page is: http://www.iausofa.org/current_C.html#Downloads

Installing SOFA

Unpack the archive in any location, note that it contains a sofa/ top directory, and a subdirectory for each version.

In the sofa/20XXMMDD* directory review the 00READ.ME file. Note the need to edit the makefile. In particular:

IMPORTANT:
You MUST edit the CFLAGF and CFLAGX lines by adding "-fPIC". This is necessary for inclusion in the shared version of mxlib.

Note also that you can edit these variables:

These are set to $(HOME), $(HOME)/lib and $(HOME)/include by default. For mxlib to use SOFA, it doesn't matter where you install these as long as you tell the compiler to look in these directories (i.e. with -I/path/to/sofa and -L/path/to/sofa -lsofa_c).

Once you have edited the makefile, cd into the directory src/c and type make, and make install.

SOFA Documentation

The SOFA documentation can be found at http://www.iausofa.org/current_C.html#Documents.

Keeping SOFA Up To date

It is important to keep SOFA up to date, particularly for making sure that it has the latest leap second information from the International Earth Rotation and Reference Systems Service (IERS). You can register with SOFA at http://www.iausofa.org/register.html.

In addition, IERS announces leap seconds, or confirms that there will not be a leap second, twice a year. You can receive IERS Bulletin C via email by creating an account on the IERS website and subscribing. This will then notify you when it is time to update SOFA.