To reflect your system, you must modify the different macros defined in Makefile:
-L /path/to/library -lhdf5
For example, here's how you might modify the macros defined in the
Makefile.h for code.rochester.edu. The first part of
Makefile.h defines the paths for the MPI wrapper script and
various I/O and numerical libraries.
MPI_PATH = /opt/mpich2/intel/1.4.1p1 HDF5_PATH = /opt/hdf5/intel/1.8.7 HYPRE_PATH = /opt/hypre/intel/2.7.0b NCMPI_PATH = /opt/netcdf/intel/1.2.0
FCOMP = ${MPI_PATH}/bin/mpif90 CCOMP = ${MPI_PATH}/bin/mpicc CPPCOMP = ${MPI_PATH}/bin/mpicxx LINK = ${MPI_PATH}/bin/mpif90 # pre-processor flag PP = -DThese commands will need to be changed if your compiler names are different. You are encouraged to use the compiler wrapper scripts instead of the compilers directly. Note that some older versions of MPICH do not recognize .F90 as a valid extension. For these, you can either update MPICH to a later version or edit mpif90 and add .F90 to the line that checks for a valid extension. The PP macro refers to the pre-processor and should be set to the flag that the compiler uses to pass information to the C preprocessor (usually -D).
We define three different setups of compiler flags as described earlier: the “_OPT” set for normal, fully optimized code, the “_DEBUG” set for debugging FLASH, and the “_TEST” set for regression testing. This latter set usually has less optimization. These three sets are picked with the -auto, -debug, and -test flags to setup respectively.
FFLAGS_OPT = -c -g -r8 -i4 -O3 -real_size 64 -diag-disable 10120 FFLAGS_DEBUG = -c -g -r8 -i4 -O0 -check bounds -check format \ -check output_conversion -warn all -warn error -real_size 64 -check uninit \ -traceback -fp-stack-check -diag-disable 10120 -fpe0 -check pointers FFLAGS_TEST = ${FFLAGS_OPT} -fp-model precise F90FLAGS = CFLAGS_OPT = -c -O3 -g -D_LARGEFILE64_SOURCE -D_FORTIFY_SOURCE=2 \ -diag-disable 10120 CFLAGS_DEBUG = -c -O0 -g -traceback -debug all -debug extended \ -D_LARGEFILE64_SOURCE -diag-disable 10120 -ftrapuv -fp-stack-check CFLAGS_TEST = ${CFLAGS_OPT} -fp-model precise
Next come the linker flags. Typically, these have only -o to rename the executable, and some debug flags (e.g., -g) for the “_DEBUG” set.
LFLAGS_OPT = -diag-disable 10120 -O3 -o LFLAGS_DEBUG = -diag-disable 10120 -o LFLAGS_TEST = ${LFLAGS_OPT}
Then there are macros for additional flags that may be required by various libraries used by FLASH, e.g., HDF5. Macros beginning with CFLAGS_ are used for compiling C source files to object files; macros beginning with FFLAGS_ are used for compiling Fortran source files to object files; and macros beginning with LIB_ are used for the command (see LINK macro above) that links object files into the FLASH executable. Note that LIB_ macros need to be specified explicitly even if they have empty contents (as shown for LIB_MPI), if the corresponding library has been configured into FLASH.
CFLAGS_MPI = -I$(MPI_PATH)/include CFLAGS_HDF5 = -I${HDF5_PATH}/include -DH5_USE_16_API CFLAGS_NCMPI = -I$(NCMPI_PATH)/include FFLAGS_HYPRE = -I${HYPRE_PATH}/include LIB_MPI = LIB_HDF5 = -L$(HDF5_PATH)/lib -lhdf5_fortran -lhdf5 -lz LIB_NCMPI = -L$(NCMPI_PATH)/lib -lpnetcdf LIB_HYPRE = -L${HYPRE_PATH}/lib -lHYPRE
Finally, we have a macro to specify any platform dependent code and some macros
for basic file manipulation and library tools.
MACHOBJ = MV = mv -f AR = ar -r RM = rm -f CD = cd RL = ranlib ECHO = echo