MASA-0.44.0
Installation/Linkage

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/

Configuration Requirements

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.

> make

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.

> make check
-------------------------------------------------------
Initializing MASA Tests
-------------------------------------------------------
PASS: init.sh
PASS: misc
PASS: fail_cond
PASS: catch_exception
PASS: register
PASS: poly
PASS: uninit
PASS: pass_func
PASS: purge
PASS: heat_const_steady
PASS: heat_var_steady
PASS: heat_const_unsteady
PASS: heat_var_unsteady
PASS: euler1d
PASS: euler2d
PASS: euler3d
PASS: euler_transient_1d
PASS: euler_chem_1d
PASS: ns2d
PASS: ns3d
PASS: ns3d_phys
PASS: n2d3d
PASS: axi_euler
PASS: axi_cns
PASS: rans_sa
PASS: sod
-------------------------------------------------------
Initializing CMASA Tests
-------------------------------------------------------
PASS: c_init.sh
PASS: c_misc
PASS: c_purge
PASS: c_heat1dsc
PASS: c_heat2dsc
PASS: c_heat3dsc
PASS: c_euler1d
PASS: c_euler2d
PASS: c_euler3d
PASS: c_euler_chem_1d
PASS: c_navierstokes2d
PASS: c_navierstokes3d
-------------------------------------------------------
Initializing FortMASA Tests
-------------------------------------------------------
PASS: f_init.sh
MASA :: selected mytest
PASS: f_misc
PASS: f_purge
PASS: f_heat
PASS: f_euler1d
PASS: f_euler2d
PASS: f_euler3d
PASS: f_euler_chem_1d
PASS: f_cns2d
PASS: f_cns3d
-------------------------------------------------------
Initializing MASA Examples Tests
-------------------------------------------------------
PASS: example_test.sh
-------------------------------------------------------
Finalizing MASA Tests, have a well verified day
-------------------------------------------------------
PASS: finalize.sh
===================
All 50 tests passed
===================

Installation

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:

> make install

Top-level libMASA installation directory:

> ls $HOME/bin/masa/
examples/ include/ lib/

Library Linkage

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:

C/C++ Example

> $(CC) -I$HOME/bin/masa/include app.c -L$HOME/bin/masa/lib -lmasa

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:

> $(CC) `pkg-config --cflags masa` app.c `pkg-config --libs masa`

Fortran Example

Fortran applications also require linking against the fmasa library:

> $(FC) -I$HOME/bin/masa/lib app.f90 -L$HOME/bin/masa/lib -lfmasa -lmasa

As with C/C++, users can use make use of pkg-config:

> $(FC) `pkg-config --variable=fflags masa` app.f90 `pkg-config --variable=flibs masa`

To embed the dynamic library search path for the libMASA library directly into the application executable, use an additional linker option as follows:

C/C++ Example

> $(CC) -I$HOME/bin/masa/include app.c -L$HOME/bin/masa/lib \
-Wl,-rpath,$HOME/bin/masa/lib -lmasa

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.


Generated on Tue Apr 21 2015 10:22:49 for MASA-0.44.0 by  doxygen 1.8.5