csci5451/assignments/02/Makefile

23 lines
No EOL
374 B
Makefile

.PHONY: all clean run-example
CC := cc
CFLAGS := -g
LDFLAGS := -g
CFLAGS += $(shell pkg-config --cflags mpi)
LDFLAGS += $(shell pkg-config --libs mpi)
all: qs_mpi
run-example: qs_mpi
mpirun --allow-run-as-root -np 4 ./qs_mpi 32 output.txt
qs_mpi: qs_mpi.o
$(CC) $^ $(CFLAGS) $(LDFLAGS) -o $@
qs_mpi.o: qs_mpi.c
$(CC) $(CFLAGS) -c -o $@ $^
clean:
rm -f qs_mpi *.o