source: proto/parabix2/src/Makefile @ 3456

Last change on this file since 3456 was 3456, checked in by linmengl, 6 years ago

add buffer_profiling for avx2 in Makefile

File size: 3.8 KB
Line 
1OUTFILE=xmlwf
2SRCFILE=xmlwf.cpp
3
4OUTFILEJ=xmlwfj
5SRCFILEJ=xmlwfj.cpp
6
7TEST=run_all.py
8PERF=perf_script.py
9
10ID_SRCFILE=id.cpp
11DIV2_SRCFILE=div2.cpp
12LOGBASE2_SRCFILE=logbase2.cpp
13DIV2_LOGBASE2_SRCFILE=div2_logbase2.cpp
14BIT_BYTE_SRCFILE=bit_byte.cpp
15
16CC= g++ $(CFLAGS)
17CFLAGS= $(SSE) -O3 -std=gnu++0x
18SSE=-msse2 #-msse4.1 -DUSE_PTEST #-mssse3 -msse4.1 -msse4.2
19INCLUDES=-I../util -I../lib -I../lib/cc-lib
20
21PAPI_DIR=/usr/local/papi
22
23ARCH=$(shell getconf LONG_BIT)
24ifeq ($(ARCH),32)
25    AFLAGS=-march=pentium4
26    PAPI=-I$(PAPI_DIR)/include -L$(PAPI_DIR)/lib -lpapi -DPAPI -Ilib/cclib
27else
28    AFLAGS=-march=nocona -m64
29    PAPI=-I$(PAPI_DIR)/include -L$(PAPI_DIR)/lib -lpapi -DPAPI -Ilib/cclib
30endif
31
32
33avx2:   $(SRCFILE)
34        $(CC) -DUSE_S2P_AVX -DBLOCK_SIZE=256 -o $(OUTFILE) $(SRCFILE) $(INCLUDES) -march=core-avx2 -m64 -mavx2 -fabi-version=6
35
36avx2_buffer_profiling:  $(SRCFILE)
37        $(CC) -DBUFFER_PROFILING -DUSE_S2P_AVX -DBLOCK_SIZE=256 -o $(OUTFILE) $(SRCFILE) $(INCLUDES) -march=core-avx2 -m64 -mavx2 -fabi-version=6       
38
39avx:    $(SRCFILE)
40        $(CC) -DBLOCK_SIZE=256 -DUSE_AVX -o $(OUTFILE) $(SRCFILE) $(INCLUDES) -march=nocona -m64 -mavx
41
42all:    $(SRCFILE)
43        $(CC) -o $(OUTFILE) $(SRCFILE) $(INCLUDES) $(AFLAGS) 
44
45xmlwfj: $(SRCFILEJ)
46        $(CC) -o $(OUTFILEJ) $(SRCFILEJ) $(INCLUDES) $(AFLAGS) 
47
48threads:        $(SRCFILE)
49        g++ -O3 -msse2 -o $(OUTFILE) $(SRCFILE) $(INCLUDES) $(AFLAGS) -lpthread -DBUFFER_PROFILING
50
51papi_profiling: $(SRCFILE)
52        $(CC) -o $(OUTFILE) $(SRCFILE) $(INCLUDES) $(AFLAGS) $(PAPI)
53
54buffer_profiling: $(SRCFILE)
55        $(CC) -o $(OUTFILE) $(SRCFILE) $(INCLUDES) $(AFLAGS) -DBUFFER_PROFILING
56       
57buffer_profilingj: $(SRCFILEJ)
58        $(CC) -o $(OUTFILEJ) $(SRCFILEJ) $(INCLUDES) $(AFLAGS) -DBUFFER_PROFILING
59
60as: $(OUTFILE).s
61        as $(OUTFILE).s -o $(OUTFILE).o
62       
63as.o: $(OUTFILE).o
64        $(CC) $(OUTFILE).o -o $(OUTFILE)       
65
66test: 
67        python $(TEST)
68       
69perf:
70        python $(PERF) 
71
72clean: 
73        rm -f $(OUTFILE) $(OUTFILE).s $(OUTFILE).o id div2 logbase2 div2_logbase2 bit_byte $(OUTFILEJ)
74
75asm:  $(SRCFILE)
76        $(CC) -o $(OUTFILE).s $(SRCFILE) $(INCLUDES) $(AFLAGS) -S -fverbose-asm
77
78# Symbol Table perf targets
79
80all_profiling_perf: buffer_profiling_perf id_profiling_perf div2_profiling_perf logbase2_profiling_perf div2_logbase2_profiling_perf bit_byte_profiling_perf
81
82buffer_profiling_perf: $(SRCFILE)
83        $(CC) -o $(OUTFILE) $(SRCFILE) $(INCLUDES) $(AFLAGS) -DBUFFER_PROFILING  -DPERF_SCRIPT
84
85id_profiling_perf: $(ID_SRCFILE)
86        $(CC) -o id $(ID_SRCFILE) $(INCLUDES) $(AFLAGS) -DID_STRATEGY -DBUFFER_PROFILING -DPERF_SCRIPT
87
88div2_profiling_perf: $(DIV2_SRCFILE)
89        $(CC) -o div2 $(DIV2_SRCFILE) $(INCLUDES) $(AFLAGS) -DDIV2_STRATEGY -DBUFFER_PROFILING -DPERF_SCRIPT
90
91logbase2_profiling_perf: $(LOGBASE2_SRCFILE)
92        $(CC) -o logbase2 $(LOGBASE2_SRCFILE) $(INCLUDES) $(AFLAGS) -DLOGBASE2_STRATEGY -DBUFFER_PROFILING -DPERF_SCRIPT
93
94div2_logbase2_profiling_perf: $(DIV2_LOGBASE2_SRCFILE)
95        $(CC) -o div2_logbase2 $(DIV2_LOGBASE2_SRCFILE) $(INCLUDES) $(AFLAGS) -DDIV2_LOGBASE2_STRATEGY -DBUFFER_PROFILING -DPERF_SCRIPT
96
97bit_byte_profiling_perf: $(BIT_BYTE_SRCFILE)
98        $(CC) -o bit_byte $(BIT_BYTE_SRCFILE) $(INCLUDES) $(AFLAGS) -DBIT_BYTE_STRATEGY -DBUFFER_PROFILING  -DPERF_SCRIPT
99
100# Symbol Table debug targets
101
102all_debug: id_debug div2_debug logbase2_debug div2_logbase2_debug bit_byte_debug
103
104id_debug: $(ID_SRCFILE)
105        $(CC) -o id $(ID_SRCFILE) $(INCLUDES) $(AFLAGS) -DID_STRATEGY  -DDUMP_SYMBOLS
106
107div2_debug: $(DIV2_SRCFILE)
108        $(CC) -o div2 $(DIV2_SRCFILE) $(INCLUDES) $(AFLAGS) -DDIV2_STRATEGY -DDUMP_SYMBOLS
109
110logbase2_debug: $(LOGBASE2_SRCFILE)
111        $(CC) -o logbase2 $(LOGBASE2_SRCFILE) $(INCLUDES) $(AFLAGS) -DLOGBASE2_STRATEGY -DDUMP_SYMBOLS
112
113div2_logbase2_debug: $(DIV2_LOGBASE2_SRCFILE)
114        $(CC) -o div2_logbase2 $(DIV2_LOGBASE2_SRCFILE) $(INCLUDES) $(AFLAGS) -DDIV2_LOGBASE2_STRATEGY -DDUMP_SYMBOLS
115
116bit_byte_debug: $(BIT_BYTE_SRCFILE)
117        $(CC) -o bit_byte $(BIT_BYTE_SRCFILE) $(INCLUDES) $(AFLAGS) -DBIT_BYTE_STRATEGY -DDUMP_SYMBOLS
118
Note: See TracBrowser for help on using the repository browser.