-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
87 lines (69 loc) · 2.37 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
# Required paths
ifndef LEGION_DIR
$(error LEGION_DIR is not set)
endif
ifndef SOLEIL_DIR
$(error SOLEIL_DIR is not set)
endif
# OS-specific options
ifeq ($(shell uname),Darwin)
DYNLINK_PATH := DYLD_LIBRARY_PATH
else
DYNLINK_PATH := LD_LIBRARY_PATH
endif
# CUDA options
USE_CUDA ?= 1
# HDF options
export USE_HDF ?= 1
export HDF_HEADER ?= hdf5.h
HDF_LIBNAME ?= hdf5
# C compiler options
CFLAGS += -g -O2 -Wall -Werror -fno-strict-aliasing -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent
CXXFLAGS += -std=c++11 -g -O2 -Wall -Werror -fno-strict-aliasing -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent
# Regent options
export INCLUDE_PATH := .
ifdef HDF_ROOT
export INCLUDE_PATH := $(INCLUDE_PATH);$(HDF_ROOT)/include
export $(DYNLINK_PATH) := $($(DYNLINK_PATH)):$(HDF_ROOT)/lib
endif
REGENT := $(LEGION_DIR)/language/regent.py -g
ifeq ($(USE_CUDA), 1)
REGENT_FLAGS := -fflow 0 -fopenmp 1 -foverride-demand-openmp 1 -finner 1 -fcuda 1 -fcuda-offline 1 -foverride-demand-cuda 1
else
REGENT_FLAGS := -fflow 0 -fopenmp 1 -foverride-demand-openmp 1 -finner 1 -fcuda 0 -foverride-demand-cuda 1
endif
# Link flags
ifdef CRAYPE_VERSION
LINK_FLAGS += -Bdynamic
LINK_FLAGS += $(CRAY_UGNI_POST_LINK_OPTS) -lugni
LINK_FLAGS += $(CRAY_UDREG_POST_LINK_OPTS) -ludreg
endif
LINK_FLAGS += -L$(LEGION_DIR)/bindings/regent -lregent
ifdef HDF_ROOT
LINK_FLAGS += -L$(HDF_ROOT)/lib
endif
ifeq ($(USE_HDF), 1)
LINK_FLAGS += -l$(HDF_LIBNAME)
endif
LINK_FLAGS += -lm
.PHONY: default all clean
default: soleil.exec
all: soleil.exec dom_host.exec
clean:
$(RM) *.exec *.o *-desugared.rg config_schema.h
%-desugared.rg: %.rg
./desugar.py $< > $@
soleil.exec: soleil.o soleil_mapper.o config_schema.o json.o
$(CXX) -o $@ $^ $(LINK_FLAGS)
soleil.o: soleil-desugared.rg soleil_mapper.h config_schema.h hdf_helper.rg dom-desugared.rg util-desugared.rg
$(REGENT) soleil-desugared.rg $(REGENT_FLAGS)
dom_host.exec: dom_host.o config_schema.o json.o
$(CXX) -o $@ $^ $(LINK_FLAGS)
dom_host.o: dom_host.rg config_schema.h dom-desugared.rg util-desugared.rg
$(REGENT) dom_host.rg $(REGENT_FLAGS)
soleil_mapper.o: soleil_mapper.cc soleil_mapper.h config_schema.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
config_schema.o config_schema.h: process_schema.rg config_schema.lua json.h util-desugared.rg
$(REGENT) process_schema.rg config_schema.lua $(REGENT_FLAGS)
json.o: json.c json.h
$(CC) $(CFLAGS) -c -o $@ $<