-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
37 lines (23 loc) · 1.06 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# This is a simple makefile just to build PROG
#COMP_FLAGS = -O0 -ggdb3 -fsanitize=address
#COMP_FLAGS = -O3
DEF_FLAGS_CPP = $(COMP_FLAGS) -mcmodel=small -Wall -g -Wextra
DEF_FLAGS_CC = $(COMP_FLAGS)
CPP := g++ $(DEF_FLAGS_CPP)
CC := mpic++ $(DEF_FLAGS_CC)
DIR_SRC_CPP := $(wildcard *.cpp)
DIR_SRC_CC:= $(wildcard *.c)
CFLAGS = -I C/MUMPS_5.5.1/include # While running on your local system, change it with location where MUMPS has been stored.
PROG_CPP = main_cpp
####################################################################
# Lines from here to down should not be changed. They are the actual
# rules which make uses to build PROG
.KEEP_STATE:
all: $(PROG_CPP)
OBJS_CPP = $(DIR_SRC_CPP:%.cpp=%.o) #$(DIR_SRC_CPP:%.c=%.o)
OBJS_MPI = $(DIR_SRC_CC:%.c=%.o)
$(PROG_CPP):$(OBJS_CPP) $(OBJS_MPI)
mpic++ -o $(PROG_CPP) $(OBJS_CPP) $(OBJS_MPI) $(CFLAGS) -ldmumps -lmumps_common -lpord -lmetis -lscotch -lscotcherr -lmpi
rm -f *.o $(OBJS_CPP) $(OBJS_MPI) # make sure the above linkers are installed on your system (-lmumps , -lmpi etc.)
run : all
./$(PROG_CPP)