forked from VowpalWabbit/vowpal_wabbit
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
70 lines (45 loc) · 2 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
COMPILER = g++
LIBS = -l boost_program_options -l pthread
BOOST_INCLUDE = /usr/local/boost/include/boost-1_34_1
BOOST_LIBRARY = /usr/local/boost/lib
ARCH = -march=nocona
# for normal fast execution.
FLAGS = -Wall $(ARCH) -ffast-math -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -I $(BOOST_INCLUDE) -O3
# for parallelization
#FLAGS = -Wall $(ARCH) -ffast-math -Wno-strict-aliasing -D_FILE_OFFSET_BITS=64 -I $(BOOST_INCLUDE) -O3 -fopenmp
# for profiling
#FLAGS = -Wall $(ARCH) -ffast-math -D_FILE_OFFSET_BITS=64 -I $(BOOST_INCLUDE) -pg -g
# for valgrind
#FLAGS = -Wall $(ARCH) -ffast-math -D_FILE_OFFSET_BITS=64 -I $(BOOST_INCLUDE) -g -O0
BINARIES = vw
all: $(BINARIES)
vw.o: parse_example.h parse_regressor.h parse_args.h parser.h
offset_tree.o: parse_example.h parse_regressor.h parse_args.h parser.h
parse_args.o: parse_regressor.h parse_example.h io.h gd.h
parse_example.o: io.h parse_example.cc parser.h
sender.o: parse_example.h
cache.o: parser.h
sparse_dense.o: parse_example.h
gd.o: parse_example.h
%.o: %.cc %.h
$(COMPILER) $(FLAGS) -c $< -o $@
%.o: %.cc
$(COMPILER) $(FLAGS) -c $< -o $@
vw: hash.o global_data.o delay_ring.o message_relay.o io.o parse_regressor.o parse_primitives.o unique_sort.o cache.o simple_label.o parse_example.o multisource.o sparse_dense.o network.o parse_args.o gd.o noop.o parser.o vw.o loss_functions.o sender.o main.o
$(COMPILER) $(FLAGS) -L$(BOOST_LIBRARY) -o $@ $+ $(LIBS)
offset_tree: hash.o io.o parse_regressor.o parse_primitives.o cache.o sparse_dense.o parse_example.o parse_args.o gd.o parser.o offset_tree.o loss_functions.o
$(COMPILER) $(FLAGS) -L$(BOOST_LIBRARY) -o $@ $+ $(LIBS)
test: vw vw-train vw-test
@echo $(UNAME)
vw-train: vw
@echo "TEST: vw training ..."
@cat test/train.dat | ./vw -b 24 -l 20 --initial_t 128000 \
--power_t 1 -f test/t_r_temp
vw-test: vw-train
@echo
@echo "TEST: vw test only ..."
@cat test/test.dat | ./vw -t -i test/t_r_temp -p test/t_p_out
install: vw
cp $(BINARIES) ~/bin
clean:
rm -f *.o $(BINARIES) *~