-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
152 lines (113 loc) · 4.95 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# matt's mac
CC=/opt/local/bin/c++-mp-4.9
GSL=-lgsl
CF=-std=c++11
# mammouth cluster
#CC=c++
#GSL=-lgsl -lgslcblas
#CF=-std=c++11
# froggy
# remember: must source the environment FROM THE INTERACTIVE SHELL (not in makefile)
# must also load modules in shell
# source /applis/ciment/v2/env.bash
# module load ciment/devel_gcc-4.6.2
# module load gcc/4.9.3_gcc-4.6.2
# module load gsl/1.16_gcc-4.6.2
# enable these to compile on froggy
#CC=c++
#GSL=-lgsl -lgslcblas
#CF=-std=c++11 ${LDFLAGS} ${CFLAGS}
# for compiling with openMP, use the first
# otherwise, use the second
CO=$(CF) -fopenmp
#CO=$(CF)
twostate: bin/stm2_mcmc
fourstate: bin/stm4_mcmc
# executables
# two state
bin/stm2_mcmc: bin/main.o bin/engine.o bin/parameters.o bin/likelihood.o bin/output.o \
bin/input.o bin/model_2.o
$(CC) $(CO) -o bin/stm2_mcmc bin/main.o bin/engine.o bin/parameters.o \
bin/likelihood.o bin/output.o bin/input.o bin/model_2.o $(GSL)
# four state
bin/stm4_mcmc: bin/main.o bin/engine.o bin/parameters.o bin/likelihood.o bin/output.o \
bin/input.o bin/model_4.o
$(CC) $(CO) -o bin/stm4_mcmc bin/main.o bin/engine.o bin/parameters.o \
bin/likelihood.o bin/output.o bin/input.o bin/model_4.o $(GSL)
# object files
bin/main.o: src/main.cpp hdr/engine.hpp hdr/output.hpp hdr/parameters.hpp \
hdr/likelihood.hpp hdr/input.hpp hdr/model.hpp hdr/stmtypes.hpp
mkdir -p bin
$(CC) $(CO) -c -o bin/main.o src/main.cpp
bin/input.o: src/input.cpp hdr/input.hpp hdr/parameters.hpp hdr/likelihood.hpp \
hdr/model.hpp hdr/stmtypes.hpp
mkdir -p bin
$(CC) $(CO) -c -o bin/input.o src/input.cpp
bin/engine.o: src/engine.cpp hdr/engine.hpp hdr/parameters.hpp hdr/likelihood.hpp \
hdr/output.hpp hdr/stmtypes.hpp hdr/input.hpp
mkdir -p bin
$(CC) $(CO) -c -o bin/engine.o src/engine.cpp
bin/likelihood.o: src/likelihood.cpp hdr/likelihood.hpp hdr/model.hpp hdr/stmtypes.hpp \
hdr/parameters.hpp hdr/input.hpp
mkdir -p bin
$(CC) $(CO) -c -o bin/likelihood.o src/likelihood.cpp
bin/parameters.o: src/parameters.cpp hdr/parameters.hpp hdr/input.hpp hdr/stmtypes.hpp
mkdir -p bin
$(CC) $(CO) -c -o bin/parameters.o src/parameters.cpp
bin/output.o: src/output.cpp hdr/output.hpp hdr/stmtypes.hpp hdr/input.hpp
mkdir -p bin
$(CC) $(CO) -c -o bin/output.o src/output.cpp
# 4-state model
bin/model_4.o: src/four_state/model_4s.cpp hdr/model.hpp hdr/stmtypes.hpp
mkdir -p bin
$(CC) $(CO) -c -o bin/model_4.o src/four_state/model_4s.cpp
# 2-state model
bin/model_2.o: src/two_state/model_2s.cpp hdr/model.hpp hdr/stmtypes.hpp
mkdir -p bin
$(CC) $(CO) -c -o bin/model_2.o src/two_state/model_2s.cpp
# TESTS
test: test/bin/main_test
./test/bin/main_test
test/bin/main_test: test/bin/main_test.o bin/engine.o bin/input.o bin/likelihood.o \
bin/parameters.o bin/output.o
$(CC) $(CO) $(GSL) -o test/bin/main_test test/bin/main_test.o bin/engine.o \
bin/likelihood.o bin/input.o bin/parameters.o bin/output.o
test/bin/main_test.o: test/main_test.cpp hdr/engine.hpp hdr/likelihood.hpp \
hdr/input.hpp hdr/parameters.hpp hdr/output.hpp
$(CC) $(CO) -c -o test/bin/main_test.o test/main_test.cpp
test/bin/engine_test: test/bin/engine_test.o bin/engine.o bin/input.o bin/likelihood.o \
bin/parameters.o bin/output.o
$(CC) $(CO) $(GSL) -o test/bin/engine_test test/bin/engine_test.o bin/engine.o \
bin/likelihood.o bin/input.o bin/parameters.o bin/output.o
test/bin/engine_test.o: test/engine_test.cpp hdr/engine.hpp hdr/likelihood.hpp \
hdr/input.hpp hdr/parameters.hpp hdr/output.hpp
$(CC) $(CO) -c -o test/bin/engine_test.o test/engine_test.cpp
test/bin/like_test: test/bin/like_test.o bin/input.o bin/likelihood.o bin/parameters.o
$(CC) $(CO) -o test/bin/like_test test/bin/like_test.o bin/likelihood.o bin/input.o \
bin/parameters.o $(GSL)
test/bin/like_test.o: test/like_test.cpp hdr/likelihood.hpp hdr/input.hpp \
hdr/parameters.hpp
$(CC) $(CO) -c -o test/bin/like_test.o test/like_test.cpp
test/bin/param_test: test/bin/param_test.o bin/input.o bin/parameters.o
$(CC) $(CO) -o test/bin/param_test test/bin/param_test.o bin/parameters.o bin/input.o
test/bin/param_test.o: test/param_test.cpp hdr/parameters.hpp hdr/input.hpp
$(CC) $(CO) -c -o test/bin/param_test.o test/param_test.cpp
test/bin/input_test: test/bin/input_test.o bin/parameters.o bin/likelihood.o bin/input.o
$(CC) $(CO) -o test/bin/input_test test/bin/input_test.o bin/parameters.o \
bin/likelihood.o bin/input.o $(GSL)
test/bin/input_test.o: test/input_test.cpp hdr/parameters.hpp hdr/likelihood.hpp \
hdr/input.hpp
mkdir -p test/bin
$(CC) $(CO) -c -o test/bin/input_test.o test/input_test.cpp
test/bin/output_test: test/output_test.cpp src/output.cpp hdr/output.hpp
mkdir -p test/bin
$(CC) $(CO) -o test/bin/output_test test/output_test.cpp
# tests not run by default
done_tests: test/bin/input_test test/bin/param_test test/bin/like_test test/bin/engine_test
./test/bin/input_test
./test/bin/param_test
./test/bin/like_test
./test/bin/engine_test
####### DATA
data: inp/GenSA_initForFit_rf_0.05.txt inp/initForFit_rf_0.05.rdata prep_data.r
Rscript prep_data.r