Compiling the Code

  • Chris MacMackin
  • November 2018

The easiest way to obtain ISOFT is by downloading it from GitHub:

make clone --recurse-submodules https://github.com/cmacmackin/isoft

This will download all libraries included in ISOFT as submodules (listed below).

Dependencies

ISOFT depends on a number of external pieces of software. Mostly these are libraries which it uses, although there are also a few programs which are used at build-time. Except for the compiler, the latter are all Python-based and the Makefile will automatically install them in a virtual environment. Of the libraries, those which are widely used must be installed on your system prior to building ISOFT. The remainder are distributed with ISOFT and will automatically be compiled as part of the build process. Builds have been tested with the gfortran compiler and are known to work with v6.2. In principle, subsequent releases of gfortran should also work, barring any regressions.

The following libraries and programs must be installed on your operating system prior to starting the build process. The corresponding package name in Ubuntu is given in parentheses.

The following programs are required during the build process. They will be installed in a virtual environment called buildtools in the top of the ISOFT directory.

  • fypp, a preprocessor for Fortran
  • FoBiS.py, a simple build system for Fortran
  • FORD, a documentation tool for Fortran

The following libraries were downloaded with ISOFT as submodules and will automatically be compiled as part of the build process:

The Makefile

A Makefile is provided which can handle the build process on Unix-like operating systems in most cases. It features the following build targets:

  • all: alias for lib (default)
  • all_objects: rebuilds all object files for the library
  • clean: deletes object files, module files, dependency files, and Emacs backup files
  • doc: generates HTML documentation for ISOFT
  • script: writes a script for compiling and linking programs which use the ISOFT library
  • tests: builds and runs the unit tests
  • lib: builds the static library of ISOFT routines and derived types

At the top of the Makefile are two definitions used for finding libraries installed on your system. These are

SYSTEM_LIB := /usr/lib       # Paths containing external libraries
SYSTEM_INC := /usr/include   # Paths containing module/include files
                             # for external libraries

These defaults should work on Ubuntu-like operating systems. They may be overridden if necessary. Multiple paths may also be provided, separated by white-space.

Building

After having amended the Makefile as described above, building ISOFT should be straightforward. Simply run

make lib

to compile the necessary dependencies and create the libisoft.a file. Then run

make script

to generate a script which can compile and link programs using ISOFT.

Unit Tests

An extensive set of unit tests has been written, using the pFUnit framework. These ensure that methods behave as expected and, where possible, test that simulations converge to analytically-predicted solutions. These tests can be built and run with the command

make tests