SourceForge

COMPILING AND LINKING WITH GMAKE

When you untar the PARAMESH distribution tar-ball you will find a gmake file called Makefile.gnu in the PARAMESH root directory. This file will compile the PARAMESH source files and create a set of library files to which you can link. To use it, make sure it is in the PARAMESH root directory. It works by running gmake on the Makefile.gnu files which appear in the AMRDIR/headers, AMRDIR/source and AMRDIR/mpi_source sub-directories. To create these PARAMESH library files, type

     gmake -f Makefile.gnu
when in the PARAMESH root directory. The library files will then be found in a newly created sub-directory called AMRDIR/libs.

The association between the packages source files and these library files is as follows:

    AMRDIR/headers    =>   AMRDIR/libs/libmodules.a
AMRDIR/mpi_source => AMRDIR/libs/libmpi_paramesh.a
AMRDIR/source => AMRDIR/libs/libparamesh.a.

The compiler and compiler flags to be used, are specified near the top of the top level Makefile.gnu file. It is assumed that you wish to use MPI, unless you uncomment the line which sets and exports the variable SHMEM, in which case the SHMEM library will be used. (Note: setting this make variable, SHMEM, only affects these make files - you will also need to define the preprocessor variables SHMEM_USED or MPI_USED as appropriate in the file AMRDIR/headers/paramesh_preprocessor.fh.)

If you type

     gmake -f Makefile.gnu Tests
it will also compile and link the test programs in the AMRDIR/Tests sub-directory. There is a file called Makefile.gnu inside AMRDIR/Tests which is used to compile the test programs and subroutines.

To compile and link application files in a sub-directory called User_applic you could type

    gmake -f Makefile.gnu User_applic
provided you copy Makefile.gnu from Tests to AMRDIR/User_applic, and modify it appropriately.

If you wish to use MPI you should link to all three of the library files in /libs. If you are using SHMEM, then you will only need /libs/libmodules.a and /libs/libparamesh.a.

Finally, the entire directory tree can be cleaned up by running with the standard clean target.

    gmake -f Makefile.gnu clean

If you wish to use these gmakefiles as an example to guide construction of your own make system, note that when using MPI, you should not compile and link all the files in /source. By studying the file lists in the Makefile.gnu file in /source, it should be clear which files are required.

These makefiles are provided as templates. We have tried to comment them in sufficient detail to help the user make the necessary modifications. However because make tends to vary from machine to machine in subtle ways, it is quite possible that these files will require some hacking before they will work on your machine.

Example make files for the compilers we ues to test PARAMESH are given in the directory AMRDIR/Ex_Makefiles.

Return to Main Page.