36 lines
No EOL
622 B
Makefile
36 lines
No EOL
622 B
Makefile
.PHONY: all handin clean run-example
|
|
|
|
CC := cc
|
|
|
|
# CFLAGS := -g -O0
|
|
# LDFLAGS := -g
|
|
CFLAGS := -O3
|
|
LDFLAGS :=
|
|
|
|
CFLAGS += $(shell pkg-config --cflags mpi)
|
|
LDFLAGS += $(shell pkg-config --libs mpi)
|
|
|
|
all: qs_mpi
|
|
|
|
handin: zhan4854.tar.gz
|
|
|
|
zhan4854.tar.gz: Makefile ASSIGNMENT.md qs_mpi.c report.pdf
|
|
mkdir -p zhan4854
|
|
cp $^ zhan4854
|
|
tar -czvf $@ zhan4854
|
|
rm -r zhan4854
|
|
|
|
run-example: qs_mpi
|
|
mpirun -v --allow-run-as-root -np 4 ./qs_mpi 32 output.txt
|
|
|
|
report.pdf: report.typ
|
|
typst compile $< $@
|
|
|
|
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
|