-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
45 lines (35 loc) · 1.97 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
HALIDE_ROOT=$(error Set your Halide path)
#Macbook: /Users/b/Documents/src/MIT/halide/halide_src
#Salike: /afs/csail.mit.edu/u/b/baghdadi/src/MIT/halide/halide_src
#Cori: /global/homes/b/baghdadi/src/MIT/halide/distributed-halide
OPENCV_LIBS=-lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_videoio
HOST=$(shell hostname -s)
MPICXX=
CXXFLAGS := -std=c++11 $(CXXFLAGS)
ifneq (,$(findstring lanka,$(HOST)))
MPICXX=mpicxx
endif
ifneq (,$(findstring salike,$(HOST)))
MPICXX=mpicxx
endif
ifneq (,$(findstring cori,$(HOST)))
MPICXX=CC
CXXFLAGS := $(CXXFLAGS) -dynamic
endif
ifneq (,$(findstring edison,$(HOST)))
MPICXX=CC
CXXFLAGS := $(CXXFLAGS) -dynamic
endif
livedemo: halide_pipeline_aot livedemo.cpp
g++ -std=c++11 livedemo.cpp halide_pipeline_aot.o $(HALIDE_ROOT)/lib/libHalide.a $(OPENCV_LIBS) -I$(HALIDE_ROOT)/include -I$(HALIDE_ROOT)/include/tools/ -I$(HALIDE_ROOT)/include/apps/support/ -msse2 -Wall -O3 -ldl -lpthread -lz -L/opt/X11/lib -lpng15 -I/opt/X11/include/libpng15 -o livedemo
halide_pipeline_aot: halide_pipeline_aot.cpp
$(CXX) $(CXXFLAGS) halide_pipeline_aot.cpp $(HALIDE_ROOT)/lib/libHalide.a -I$(HALIDE_ROOT)/include -I$(HALIDE_ROOT)/include/tools/ -I$(HALIDE_ROOT)/include/apps/support/ -ldl -lpthread -lz -L/opt/X11/lib -lpng15 -I/opt/X11/include/libpng15 -o halide_pipeline_aot
./halide_pipeline_aot
distributed: halide_pipeline_jit.cpp
$(MPICXX) $(CXXFLAGS) $< -o $@ -O3 -ffast-math -Wall -I $(HALIDE_ROOT)/include $(HALIDE_ROOT)/bin/libHalide.a -lpthread -ldl -lz $(LDFLAGS) -DDEMO_DISTRIBUTED
cpu: halide_pipeline_jit.cpp
$(CXX) $(CXXFLAGS) $< -o $@ -O3 -ffast-math -Wall -I $(HALIDE_ROOT)/include $(HALIDE_ROOT)/lib/libHalide.a -lpthread -ldl -lz $(LDFLAGS) -DDEMO_CPU
gpu: halide_pipeline_jit.cpp
$(CXX) $(CXXFLAGS) $< -o $@ -O3 -ffast-math -Wall -I $(HALIDE_ROOT)/include $(HALIDE_ROOT)/lib/libHalide.a -lpthread -ldl -lz $(LDFLAGS) -DDEMO_GPU
clean:
rm -rf livedemo halide_pipeline_aot.h halide_pipeline_aot.o halide_pipeline_aot distributed cpu gpu *~