-
Notifications
You must be signed in to change notification settings - Fork 30
/
Makefile
80 lines (55 loc) · 1.51 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
ifndef STARPU_DIR
$(error STARPU_DIR variable is not defined, aborting build)
endif
DEBUG ?= 0
CC = mpic++
CFLAGS = -DADD_ -fPIC -std=c++11
LDFLAGS = -Wall -std=c++11
STARPU_VERSION ?= 1.3
#STARPU_DIR = /home/wwu12/starpu/install
#MPI_DIR = /sw/openmpi/2.1.1
ifeq ($(strip $(DEBUG)),0)
CFLAGS += -O3
LDFLAGS += -O3
else
CFLAGS += -g -O0
LDFLAGS += -g -O0
endif
# Include directories
INC = -I$(STARPU_DIR)/include/starpu/$(STARPU_VERSION) -I../core
INC_EXT =
# Location of the libraries.
LIB = -Wl,-rpath,$(STARPU_DIR)/lib: $(STARPU_DIR)/lib/libstarpu-$(STARPU_VERSION).so $(STARPU_DIR)/lib/libstarpumpi-$(STARPU_VERSION).so -L../core -lcore_s
LIB_EXT =
ifeq ($(strip $(TASKBENCH_USE_HWLOC)),1)
INC_EXT += -I$(HWLOC_DIR)/include
endif
INC := $(INC) $(INC_EXT)
LIB := $(LIB) $(LIB_EXT)
CFLAGS += $(INC)
include ../core/make_blas.mk
TARGET = main main_buffer_core main_expl
all: $(TARGET)
.PRECIOUS: %.c %.o
data.o: data.cc data.h
$(CC) -c $(CFLAGS) $<
main.o: main.cc
$(CC) -c $(CFLAGS) $<
main: main.o data.o
$(CC) $^ $(LIB) $(LDFLAGS) -o $@
main_buffer_core.o: main_buffer_core.cc
$(CC) -c $(CFLAGS) $<
main_buffer_core: main_buffer_core.o data.o
$(CC) $^ $(LIB) $(LDFLAGS) -o $@
main_expl.o: main_expl.cc
$(CC) -c $(CFLAGS) $<
main_expl: main_expl.o data.o
$(CC) $^ $(LIB) $(LDFLAGS) -o $@
main_static.o: main_static.cc
$(CC) -c $(CFLAGS) $<
main_static: main_static.o data.o
$(CC) $^ $(LIB) $(LDFLAGS) -o $@
clean:
rm -f *.o
rm -f $(TARGET)
.PHONY: all clean