5.6 Creating a Site-specific Makefile
If setup does not find your hostname in the sites/ directory
it picks a default Makefile based on the operating system.
This Makefile is not always correct but can be used as a
template to create a Makefile for your machine. To create a
Makefile specific to your system follow these instructions.
- Create the directory sites/<hostname>, where <hostname>
is the hostname of your machine.
- Start by copying os/<your os>/Makefile.h to sites/<hostname>
- Use bin/suggestMakefile.sh to help identify the
locations of various libraries on your system. The script scans your
system and displays the locations of some libraries. You must note
the location of MPI library as well. If your compiler is actually
an mpi-wrapper (e.g.mpif90), you must still define LIB_MPI in your
site specific Makefile.h as the empty string.
- Edit sites/<hostname>/Makefile.h to provide the locations of
various libraries on your system.
- Edit sites/<hostname>/Makefile.h to specify the FORTRAN and C compilers to be used.
Actual Compiler or MPI wrapper?:
If you have
MPI installed, you can either specify the actual
compiler (
e.g.f90) or the mpi-wrapper (
e.g.mpif90) for
the “compiler” to be used on your system. Specifying the
actual compiler and the location of the MPI libraries in the site-specific
Makefile allows you the possibility of switching your MPI implementation.
For more information see
Library-HOWTO.
Compilation warning:
The Makefile.h must include a compiler flag to promote Fortran
Reals to Double Precision. FLASH performs all
MPI communication of Fortran Reals using
MPI_DOUBLE_PRECISION type, and assumes that Fortran
Reals are interoperable with C doubles in the I/O unit.
HDF5 Library Interface:
If you are using HDF5 for I/O, and your HDF5 library version is
greater than 1.6.x, the C source files of the
IO unit need to be compiled
with the preprocessor symbol
H5_USE_16_API
defined. This is usually best achieved by having a line
like the following in your Makefile.h:
CFLAGS_HDF5 = -I${HDF5_PATH}/include -DH5_USE_16_API