C How do I create a Makefile for an MPI program?
I have 3 C files, they all form one C program. One of them is an MPI file called mpi.c, the others are read.c and write.c. I donβt know how to include mpi.c in my Makefile, here is if I got it so far (and itβs wrong):
all: program
program: mpi.o read.o write.o
mpicc mpi.o read.o write.o -o program // I think this line is wrong
mpi.o: mpi.c
mpicc -o mpi.o mpi.c
read.o: read.c
gcc -c read.c -o read.o
write.o: write.c
gcc -c write.c -o write.o
clean:
rm -f write.o read.o mpi.o program core *~
+3
source to share