-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
59 lines (40 loc) · 1.53 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
################################################################################
#
# adder_example Makefile
#
# Created by TEJ
#
#
################################################################################
# intel compiler for serial version:
#CXX = icpc
# intel compiler for parallel version:
#CXX = mpicxx
# GNU compiler serial
CXX = g++
# GNU compiler parallel
#CXX = mpic++
# Linker flags:
LDFLAGS = -L -L/usr/lib -lm
# -L is directory with libraries, there exists a file libm.sl etc.
# Compiler flags
#CPPFLAGS = -I/usr/include/mpi -Wall -O0 -g -fopenmp
CPPFLAGS = -Wall -g -O3 -march=native -mtune=native -ftree-parallelize-loops=4
# -Wall all warnings on
# -O3 Optimization level 3 ( -O0 needed for debugging purposes )
# ad -g to compile for debugging purposes. Debug code using valgrind
# -fopenmp enable openMP features
# -march=native and -mtune=native perform processor-specific optimization
################################################################################
SOURCE = adder_example.cpp gates.cpp logic.cpp number_ops.cpp
OBJECTS = ${SOURCE:.cpp=.o}
################################################################################
ADDER_O = gates.o logic.o number_ops.o adder_example.o\
################################################################################
.c.o: ${SOURCE}
${CXX} -c ${CPPFLAGS} $<
adder: ${ADDER_O}
${CXX} -o $@ ${ADDER_O} ${LDFLAGS}
all: adder
clean:
rm -f *.o adder