-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
54 lines (38 loc) · 1.46 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
# get arch name
ARCH = $(shell uname -m)
# add Intel specific compiler flags
ifeq ($(ARCH), x86_64)
CFLAGS += -mavx2 -mfma
endif
TARGET = mnist
OBJS = ann.o tensor.o
DEPS = ann.h tensor.h ann_config.h
# use cblas
#CFLAGS += -g -O2 -DUSE_BLAS -DCBLAS -I"/opt/include"
#LFLAGS += -L"/opt/lib" -lcblas -lm
# CFLAGS += -g -O2 -DUSE_BLAS -DCBLAS -I.
# LFLAGS += -L. -lcblas
# use openblas
CFLAGS += -g -O2 -DUSE_BLAS -I"/opt/OpenBLAS/include"
LFLAGS += -L/opt/OpenBLAS/lib/ -lopenblas
#-DMKL_ILP64 -m64 -I"${MKLROOT}/include"
#LFLAGS = ${MKLROOT}/lib/libmkl_intel_ilp64.a ${MKLROOT}/lib/libmkl_tbb_thread.a ${MKLROOT}/lib/libmkl_core.a -L${TBBROOT}/lib -ltbb -lc++ -lpthread -lm -ldl
# -DMKL_ILP64 -m64 -I"${MKLROOT}/include"
# ${MKLROOT}/lib/libmkl_intel_ilp64.a ${MKLROOT}/lib/libmkl_tbb_thread.a ${MKLROOT}/lib/libmkl_core.a -L${TBBROOT}/lib -ltbb -lc++ -lpthread -lm -ldl
all: mnist logic digit5x7 save_test save_test_binary blas_perf
$(TARGET): $(OBJS) mnist.o
$(CC) -o $@ $^ $(LFLAGS)
logic: $(OBJS) logic.o
$(CC) -o $@ $^ $(LFLAGS)
digit5x7: $(OBJS) digit5x7.o
$(CC) -o $@ $^ $(LFLAGS)
save_test: $(OBJS) save_test.o
$(CC) -o $@ $^ $(LFLAGS)
save_test_binary: $(OBJS) save_test_binary.o
$(CC) -o $@ $^ $(LFLAGS)
blas_perf: $(OBJS) blas_perf.o
$(CC) -o $@ $^ $(LFLAGS)
%.o: %.c $(DEPS)
$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
clean:
rm $(TARGET) $(OBJS) logic digit5x7 logic.o digit5x7.o mnist.o save_test.o save_test save_test_binary save_test_binary.o blas_perf.o