# -*- makefile -*- # # $COPYRIGHT$ # # Configuration for "make" for all the subdirectories # # It expects $(BIN) to be defined before this file is included. # SHELL = /bin/sh CC = mpicc CXX = mpiCC F77 = mpif77 # # You can optionally add CFLAGS, CXXFLAGS, or FFLAGS here or via the # environment if necessary # #CFLAGS = #CXXFLAGS = #FFLAGS = # # Non-LAM/MPI users may want to change these definitions to suit their # implementation of MPI. # # All of the macros can use any of the following variables that will # be substituted in for each test program that is run: # - %np is the number of nodes to run on # - %mode is the mode to run with; one of the words from the MODES # macro # - %cmd is the program to run (with absolute pathname) # PRE_MPIRUN: A command to be executed before each test program is # invoked. # MPIRUN: The actual command used execute each program. # POST_MPIRUN: A command to be executed after each test program is # invoked. # MODES: A list of modes to test; can be empty or a # whitespace-separated list that can be substitued in the MPIRUN # macro. PRE_MPIRUN = lamclean MPIRUN = mpirun -x TEST -np %np -s h %mode -O %cmd POST_MPIRUN = lamclean\; mpirun -np %np -s h -O ../reporting/collector REPORT_ERROR = ../reporting/report_error MODES = -lamd -c2c ############################################################################ # # Users should not need to change anything below this line # ############################################################################ CLINKER = $(CC) CXXLINKER = $(CXX) FLINKER = $(F77) MPICFLAGS = $(CFLAGS) -I../reporting MPICXXFLAGS = $(CXXFLAGS) -I../reporting MPIFFLAGS = $(LDFLAGS) ERR_O = ../reporting/lamtest_error.o CLINK = $(CLINKER) $(MPICFLAGS) -o $@ $@.o $(ERR_O) CXXLINK = $(CXXLINKER) $(MPICXXFLAGS) -o $@ $@.o $(ERR_O) FLINK = $(CLINKER) $(MPIFFLAGS) -o $@ $@.o $(ERR_O) .c.o: $(CC) $(MPICFLAGS) -c $*.c .cc.o: $(CXX) $(MPICXXFLAGS) -c $*.cc .f.o: $(F77) $(MPIFFLAGS) -c $*.f default: echo DEFAULT $(MAKE) build clean: /bin/rm -f *.o *~ core *% $(BIN) $(BUILD_BIN) $(EXTRA_CLEAN) # # This is the main target to invoke the tests with # testing-redirect: $(BIN) $(BUILD_BIN) @ for mode in $(MODES); do \ echo "*** Testing $$mode mode ***"; \ $(MAKE) MODE="$$mode" runtests; \ done # # Compatability targets for LAM/MPI. These should probably not be # invoke directly anymore. # testing-lamd: $(BIN) @ $(MAKE) MODE="-lamd" runtests testing-c2c: $(BIN) @ $(MAKE) MODE="-c2c" runtests # # Note that we suffix the mpirun command with "|| echo" so that the # MPI_ABORT test actually returns a successful return value so that # make doesn't abort. # # Caution: There's some deep makefile/shell mojo to get the command # substitution to work properly. Not for the faint of heart. # runtests: $(BIN) @ $(SHELL) ../runtests.sh "$(PRE_MPIRUN)" "$(MPIRUN)" \ "$(POST_MPIRUN)" "$(REPORT_ERROR)" "$(MODE)" "$(BIN)"