MASA-0.44.0
|
libMASA uses the GNU autotools suite (autoconf, automake, and libtool) for its development build system. This system is popular among the Linux development community and provides a familiar build environment for end users.
To build libMASA starting from a release distribution, untar the distribution and enter the top-level directory.
tar xvfz masa-0.44.0.tar.gz cd masa-0.44.0/
Since libMASA provides a Fortran interface, a valid Fortran90 compiler is also required. To date, libMASA has been successfully tested with gfortran and the Intel ifort compilers. The configuration step will look for available compilers in the user environment but as with any autoconf based configuration, these can be overridden with command line arguments (by setting CXX
, FC
, and F77
appropriately).
Installation Directory: Use the –prefix
option to specify your desired top-level installation directory for MASA. The examples below all configure libMASA to be installed in the user's ~/bin/masa directory.
Once configured, issue a make
to build the software. If successful, this will build the libMASA library (static and dynamic versions) and several examples.
Verifying the build: To verify that the software is working properly, a test option is provided to run a short suite of functionality tests against the local build. To run, issue a make check
to run the tests. If successful, output similar to the following will be generated.
After the build is complete, issue a make install
to install the library. The installation will consist of three top-level directories housing the library, include files, and example files. An example of the top-level directories after installation is shown below:
Top-level libMASA installation directory:
To link an external C/C++ or Fortran application with the library, the include
directory must be added to the compilers include search path in order to access the masa.h header file (or for Fortran, the lib
directory should be added to access the pre-compiled masa F90 module). The lib
directory should also be added to the linker search path along with a request to link against the libMASA library. Several example link steps are provided below. These examples assume that the libMASA library has been successfully built and installed previously in the users's ~/bin/masa directory:
If you set your PKG_CONFIG_PATH
environment variable to contain $HOME/lib/pkgconfig
you can use <ahref="http://pkg-config.freedesktop.org/wiki/">pkg-config
to lookup the relevant linking information automatically:
Fortran applications also require linking against the fmasa library:
As with C/C++, users can use make use of pkg-config:
To embed the dynamic library search path for the libMASA library directly into the application executable, use an additional linker option as follows:
Important Note: F90 module file formats are not consistent across multiple compilers. Therefore, a Fortran application and the libMASA F90 interface must be built with the same Fortran compiler family to ensure compatibility.