-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile
88 lines (73 loc) · 1.4 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
81
82
83
84
85
86
87
# gasp -- global address space toolbox
#
# makefile for tests
#
CC=mpicc
CRAY?=no
INTEL?=no
ifneq ($(wildcard /opt/cray/.),)
CRAY=yes
endif
.SUFFIXES: .c .h .o
.PHONY: clean
CFLAGS+=-Wall
CFLAGS+=-std=c11
CFLAGS+=-D_GNU_SOURCE
CFLAGS+=-fpic
CFLAGS+=-I.
CFLAGS+=-I../include
CFLAGS+=-I../src
ifdef $(INCLUDE)
CFLAGS+=-I$(INCLUDE)
endif
ifdef TRACE_DTREE
CFLAGS+=-DTRACE_DTREE=$(TRACE_DTREE)
endif
ifeq ($(CRAY),yes)
CC=cc
#CFLAGS+=-craympich-mt
CFLAGS+=-fopenmp
LDFLAGS+=-dynamic
LDFLAGS+=-L..
LDFLAGS+=-lgasp
LDFLAGS+=-Wl,--whole-archive,-ldmapp,--no-whole-archive
else
ifeq ($(shell uname), Darwin)
#LDFLAGS+=-dynamic
#LDFLAGS+=-L..
#LDFLAGS+=-lgasp
LDFLAGS+=../libgasp.dylib
else
CFLAGS+=-fopenmp
LDFLAGS+=../libgasp.so
endif
endif
ifeq ($(INTEL),yes)
CC=mpiicc
CFLAGS+=-mt_mpi
CFLAGS+=-qopenmp
endif
ifneq ($(MKLROOT),)
LDFLAGS+=-L$(MKLROOT)/lib/intel64
LDFLAGS+=-lmkl_intel_ilp64
LDFLAGS+=-lmkl_core
LDFLAGS+=-lmkl_sequential
endif
LDFLAGS+=-lpthread
LDFLAGS+=-lm
LDFLAGS+=-ldl
SRCS=garraytest.c dtreetest.c
OBJS=$(subst .c,.o, $(SRCS))
BINS=$(subst .c,, $(SRCS))
ifeq ($(DEBUG),yes)
CFLAGS+=-O0 -g
else
CFLAGS+=-O3
endif
all: $(BINS)
garraytest: $(SRCS)
$(CC) $(CFLAGS) garraytest.c -o garraytest $(LDFLAGS)
dtreetest: dtreetest.c
$(CC) $(CFLAGS) dtreetest.c -o dtreetest $(LDFLAGS)
clean:
$(RM) -f $(BINS) $(OBJS)