PLATFORM = $(shell ./config.guess) include make.$(PLATFORM) CPPFLAGS = "-DCOMPILER=\"$(CC)\"" "-DFLAGS=\"$(OPTFLAGS)\"" \ "-DPLATFORM=\"$(PLATFORM)\"" # Add -DDEBUG_RUN to CPPFLAGS to cut down on the cases. # Compile a C version (using basic_dgemm.c, in this case): LIBS = -lm -lrt OBJS = matmul.o timing.o .PHONY: all all: matmul matmul-blocked # --- matmul: $(OBJS) basic_dgemm.o $(CC) -o $@ $^ $(LDFLAGS) $(LIBS) matmul-blocked: $(OBJS) blocked_dgemm.o $(CC) -o $@ $^ $(LDFLAGS) $(LIBS) # An example of using Fortran. matmul-fortran: $(OBJS) fortran_dgemm.o fortran_dgemm_wrapper.o $(F77) -o $@ $^ $(LDFLAGS) $(LIBS) # Platform BLAS, more or less. matmul-blas: $(OBJS) blas_dgemm.o $(F77) -o $@ $^ $(LDFLAGS) $(LIBS) $(BLASLIB) # --- # This is just a suggestion on how to generate timing plots... Feel # free to improve on these, so long as you show MFlop/s v. matrix size. # For running outside of Millennium, use # make MILLRUN=env timing MILLRUN = gexec -n 1 timing: matmul $(MILLRUN) `pwd`/matmul > timing.raw perl -ne 'if (/Size:\s+(\S+).*s:\s+(\S+)/) {print "$1 $2\n";}' \ timing.raw > timing .PHONY: display display: timing echo "set term x11;" | gnuplot -persist - timing.gnuplot timing.ps: timing echo "set term postscript; set output 'timing.ps';" \ | gnuplot - timing.gnuplot timing.ppm: timing echo "set term pbm color; set output 'timing.ppm';" \ | gnuplot - timing.gnuplot # --- .PHONY: clean realclean clean: rm -f matmul matmul-blocked matmul-blas matmul-fortran *.o realclean: clean rm -f *~ timing timing.raw timing.ps timing.ppm