-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
86 lines (63 loc) · 3.02 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
CC= mpicc
CFLAGS= -Wall -Wextra -O3
CFLAGS_LIB= #-ansi -pedantic -Wno-long-long # ANSI C does not have inline which affects performance a little bit
CPPFLAGS= -DHAVE_CBLAS #-D__VERIFY__
INCLUDES= -I. -DMKL_ILP64 -m64 -I${MKLROOT}/include
EXE= examples/mlp-mpi examples/mlp examples/mnist-cnn examples/mlp-mpi-allsplit examples/mnist-cnn-allsplit \
examples/vgg examples/recommender-mpi
LIBS= -lz -L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl
ifdef CBLAS
CPPFLAGS+=-DHAVE_CBLAS
INCLUDES+=-I$(CBLAS)/include
LIBS=-fopenmp -pthread -L$(CBLAS)/lib -lopenblas -lcblas -lz -lm
endif
.SUFFIXES:.c .o
.PHONY:all clean depend
.c.o:
$(CC) -c $(CFLAGS) $(INCLUDES) $(CPPFLAGS) $< -o $@
all:kautodiff.o kann.o kann_extra/kann_data.o $(EXE)
kautodiff.o:kautodiff.c
$(CC) -c $(CFLAGS) $(CFLAGS_LIB) $(INCLUDES) $(CPPFLAGS) -o $@ $<
kann.o:kann.c
$(CC) -c $(CFLAGS) $(CFLAGS_LIB) $(INCLUDES) $(CPPFLAGS) -o $@ $<
kann_extra/kann_data.o:kann_extra/kann_data.c
$(CC) -c $(CFLAGS) -DHAVE_ZLIB $< -o $@
examples/mlp:examples/mlp.o kautodiff.o kann.o kann_extra/kann_data.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
examples/vgg:examples/vgg.o kautodiff.o kann.o kann_extra/kann_data.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
examples/ae:examples/ae.o kautodiff.o kann.o kann_extra/kann_data.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
examples/vae:examples/vae.o kautodiff.o kann.o kann_extra/kann_data.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
examples/textgen:examples/textgen.o kautodiff.o kann.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
examples/rnn-bit:examples/rnn-bit.o kautodiff.o kann.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
examples/inspect:examples/inspect.o kautodiff.o kann.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
examples/mnist-cnn:examples/mnist-cnn.o kautodiff.o kann.o kann_extra/kann_data.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
examples/mnist-cnn-allsplit:examples/mnist-cnn-allsplit.o kautodiff.o kann.o kann_extra/kann_data.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
examples/mlp-mpi:examples/mlp-mpi.o kautodiff.o kann.o kann_extra/kann_data.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
examples/mlp-mpi-allsplit:examples/mlp-mpi-allsplit.o kautodiff.o kann.o kann_extra/kann_data.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
examples/recommender-mpi:examples/recommender-mpi.o kautodiff.o kann.o kann_extra/kann_data.o examples/to_onehot.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
clean:
rm -fr *.o */*.o a.out */a.out *.a *.dSYM */*.dSYM $(EXE)
depend:
(LC_ALL=C; export LC_ALL; makedepend -Y -- $(CFLAGS) $(DFLAGS) -- *.c kann_extra/*.c examples/*.c)
# DO NOT DELETE
kann.o: kann.h kautodiff.h
kautodiff.o: kautodiff.h
kann_extra/kann_data.o: kann_extra/kseq.h kann_extra/kann_data.h
examples/ae.o: kann.h kautodiff.h kann_extra/kann_data.h
examples/inspect.o: kann.h kautodiff.h
examples/mlp.o: kann.h kautodiff.h kann_extra/kann_data.h
examples/mnist-cnn.o: kann_extra/kann_data.h kann.h kautodiff.h
examples/rnn-bit.o: kann.h kautodiff.h
examples/textgen.o: kann.h kautodiff.h
examples/vae.o: kann.h kautodiff.h kann_extra/kann_data.h