本人从事Geophysics的研究,最近在尝试用Madagascar和MPI混合编程,小有收获,现在贴出Makefile文件的配置,供大家参考。
# Makefile for CPU program based on Madagascar,MPI
# Home path
MPI_HOME = /home/xx/MPICH
MADA_HOME = /home/xx/madagascar2.0.1/madagascar-2.0
# Which compiler
CC = mpicc
# Include path
IFLAGS = -I$(MPI_HOME)/include -I$(MADA_HOME)/include
# Lib path
LFLAGS = -L$(MPI_HOME)/lib -L$(MADA_HOME)/lib
LD = -lrsf -lmpi
C_APPS=fdm2d_cpu
all: ${C_APPS}
%: %.c
-$(CC) $(@F).c -o $@ $(LD) $(LFLAGS) $(IFLAGS)
clean:
rm -f ${C_APPS}