The fortran program need the Makefile to build under linx. There are several Makefile generate on the web. The mkmf is the one used to build the SPH code.
1. Download the mkmf from the website: http://www.gfdl.noaa.gov/~vb/mkmf.html
2. Create a template for mkmf, which define the compiler, pre-processor (CPP,FPP), include path and library path and so on. The sample template is sown below, file name “mkmf_template” :
# template for the Intel fortran compiler version with mpich2
# typical use with mkmf:
#-------------------------------------------------------
# perl mkmf -t mkmf_template ../src_prec_source
#------------------------------------------------------
# compiler to compile the source code.
FC = mpif90 -fpp
# compiler to link the source doe.
LD = mpif90 -fpp
CPPDEFS =
CPPFLAGS =
FPPFLAGS =
#define the include files.
#FFLAGS = -g -heap-arrays -O3 -axSSE4.2 -I/home/tmsxh/Desktop/hostshare/PPM_library_Linux/libppm-1.2.1/include/ppm
FFLAGS = -g -heap-arrays -I/home/tmsxh/Desktop/hostshare/PPM_library_Linux/libppm-1.2.1/include/ppm
OTHERFLAGS =
LDFLAGS =
# add your libraries after LIBS= , e.g. -lblas
#LIBS = c:/mingw/lib
MKLLIB = -L/opt/intel/mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5
#MKLLIB = /opt/intel/mkl/lib/intel64/libmkl_intel_lp64.a /opt/intel/mkl/lib/intel64/libmkl_intel_thread.a /opt/intel/mkl/lib/#intel64/libmkl_core.a -liomp5
#LIBS = -L/home/tmsxh/ppm/ppm-1.0.1/lib -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6 -lppm -lmetis -lvizing ${MKLLIB}
LIBS = -L/home/tmsxh/Desktop/hostshare/PPM_library_Linux/libppm-1.2.1/lib -lppm -lmetis ${MKLLIB}
LDFLAGS = $(LIBS)
3. generate the make file by : perl mkmf -t mkmf_template ../src_prec_source
3.1 “-t mfmk_template” : specify the template file;
3.2 “../src_prec_source ” : specify the folder the fortran code located.
4. make ; to generate the code.