summaryrefslogtreecommitdiff
blob: 21234cc3cfb3e18fbdfb5dea1a6390b00ee9561f (plain)
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
* Modernise Autoconf code
* Use pkg-config for finding GSL
* Use latest archvie macros to find Boost
* Compile tests only when running make check

--- a/configure.in
+++ b/configure.in
@@ -1,6 +1,6 @@
 AC_INIT(blossoc, 1.4.0, mailund@birc.au.dk)
 AM_INIT_AUTOMAKE
-AM_CONFIG_HEADER(config.hh)
+AC_CONFIG_HEADERS([config.hh])
 
 AC_PROG_CXX
 AC_PROG_INSTALL
@@ -12,74 +12,16 @@
 fi
 AC_DEFINE_UNQUOTED(PREFIX, "$thePREFIX", [Installation prefix])
 
-AC_CHECK_LIB(m, sin, dnl FOUND, DO NOTHING
-, dnl NOT FOUND
-AC_ERROR([[
-************************************************************************
-************************************************************************
-Didn't find the math library (-lm) -- I won't even guess about what is
-wrong on this machine...
-************************************************************************
-************************************************************************
-]])
-)
-
-AX_BOOST([1.33.1],,
-AC_ERROR([[
-************************************************************************
-************************************************************************
-The Boost library was not found on this system.  We use this library
-extensively, and cannot proceed without it.  You can obtain it from
-<http://www.boost.org>.
-************************************************************************
-************************************************************************
-]])
-)
-
-
-AC_CHECK_LIB(gslcblas, cblas_dsdot, dnl FOUND, DO NOTHING
-, dnl NOT FOUND
-AC_ERROR([[
-************************************************************************
-************************************************************************
-The GNU Scientific Library (GSL) was not found.  This library is
-needed for some of the numerical calculations used for scoring the
-significance of local genealogies and can be obtained at
-<http://www.gnu.org/software/gsl/>.
-************************************************************************
-************************************************************************
-]])
-)
-
-AC_CHECK_LIB(gsl, gsl_cdf_chisq_Q, dnl FOUND, DO NOTHING
-, dnl NOT FOUND
-AC_ERROR([[
-************************************************************************
-************************************************************************
-The GNU Scientific Library (GSL) was not found.  This library is
-needed for some of the numerical calculations used for scoring the
-significance of local genealogies and can be obtained at
-<http://www.gnu.org/software/gsl/>.
-************************************************************************
-************************************************************************
-]])
-)
-
-AC_CHECK_LIB(snpfile, main, dnl main isn't there, but this avoids namespaces
-dnl FOUND
-,
-dnl NOT FOUND
-AC_ERROR([[
-************************************************************************
-************************************************************************
-The SNPFile library was not found.  This library is needed for data
-representation and can be obtained at
-<http://www.birc.au.dk/~mailund/SNPFile/>.
-************************************************************************
-************************************************************************
-]])
-)
-
+AC_SEARCH_LIBS([sin], [m], [], [
+	AC_MSG_ERROR([unable to find the sin() function])
+])
+
+PKG_CHECK_MODULES([GSL], [gsl])
+
+AX_BOOST_BASE([1.33.1])
+AX_BOOST_PROGRAM_OPTIONS
+AX_BOOST_SERIALIZATION
+AX_BOOST_SIGNALS
 
 AC_OUTPUT([
 	Makefile
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,9 +3,6 @@
 AM_CXXFLAGS += -Wall
 AM_CXXFLAGS += $(BOOST_CPPFLAGS)
 
-# for testing
-AM_CXXFLAGS += -g -O0 #-lefence
-
 # for coverage testing
 #AM_CXXFLAGS += -O3 -fexpensive-optimizations -g -fprofile-arcs -ftest-coverage
 
@@ -15,11 +12,11 @@
 # for production
 #AM_CXXFLAGS += -O3 -fexpensive-optimizations -DNDEBUG
 
-noinst_PROGRAMS = 
+check_PROGRAMS =
+noinst_PROGRAMS =
 TESTS = 
 EXTRA_DIST =
 
-TESTS += first_test.sh
 EXTRA_DIST += first_test.sh
 
 man_MANS = blossoc.1 snpfile_blossoc.1 blossoc_regions.1 blossoc_trees.1
@@ -37,20 +34,20 @@
 noinst_PROGRAMS     += snpfile_iblossoc #ditto
 noinst_PROGRAMS     += fast_snpfile_iblossoc
 
-noinst_PROGRAMS += matrix_test
-TESTS +=           matrix_test
-noinst_PROGRAMS += incompatibility_test tree_test tree_builder_test
-TESTS +=           incompatibility_test tree_test tree_builder_test
+check_PROGRAMS += matrix_test
+TESTS +=          matrix_test
+check_PROGRAMS += incompatibility_test tree_test tree_builder_test
+TESTS +=          incompatibility_test tree_test tree_builder_test
 EXTRA_DIST += testdata/CF/cf-positions.txt
 EXTRA_DIST += testdata/CF/cf-haplotypes.txt
 EXTRA_DIST += testdata/interaction/positions.txt
 EXTRA_DIST += testdata/interaction/haplotypes.txt
-noinst_PROGRAMS += score_test io_test 
-TESTS +=           score_test io_test 
-noinst_PROGRAMS += incompatible_regress_test
-TESTS +=           incompatible_regress_test
-noinst_PROGRAMS += genotype_score_test
-TESTS +=           genotype_score_test.sh
+check_PROGRAMS += score_test io_test 
+TESTS +=          score_test io_test 
+check_PROGRAMS += incompatible_regress_test
+TESTS +=          incompatible_regress_test
+check_PROGRAMS += genotype_score_test
+TESTS +=          genotype_score_test.sh
 EXTRA_DIST += genotype_score_test.sh
 EXTRA_DIST += genotype_score_test.expected
 TESTS +=           interactions_regression_test.sh
@@ -120,6 +117,7 @@
 
 
 blossoc_regions_LDADD  =
+blossoc_regions_LDADD += -lsnpfile
 blossoc_regions_LDADD += $(BOOST_PROGRAM_OPTIONS_LIB)
 blossoc_regions_SOURCES  =
 blossoc_regions_SOURCES += incompatibility.hh incompatibility.cc
@@ -129,6 +127,7 @@
 blossoc_regions_SOURCES += regions.cc
 
 blossoc_trees_LDADD  =
+blossoc_trees_LDADD += -lsnpfile
 blossoc_trees_LDADD += $(BOOST_PROGRAM_OPTIONS_LIB)
 blossoc_trees_SOURCES  =
 blossoc_trees_SOURCES += matrix_utils.hh matrix_utils.cc 
@@ -142,6 +141,8 @@
 
 
 blossoc_LDADD  =
+blossoc_LDADD += -lsnpfile
+blossoc_LDADD += $(GSL_LIBS)
 blossoc_LDADD += $(BOOST_PROGRAM_OPTIONS_LIB)
 blossoc_SOURCES  =
 blossoc_SOURCES += tree.hh tree.cc
@@ -158,6 +159,8 @@
 blossoc_SOURCES += blossoc.cc
 
 snpfile_blossoc_LDADD  =
+snpfile_blossoc_LDADD += -lsnpfile
+snpfile_blossoc_LDADD += $(GSL_LIBS)
 snpfile_blossoc_LDADD += $(BOOST_PROGRAM_OPTIONS_LIB)
 snpfile_blossoc_LDADD += $(BOOST_SERIALIZATION_LIB)
 snpfile_blossoc_LDADD += $(BOOST_SIGNALS_LIB)
@@ -176,6 +179,8 @@
 snpfile_blossoc_SOURCES += snpfile_blossoc.cc
 
 iblossoc_LDADD  =
+iblossoc_LDADD += -lsnpfile
+iblossoc_LDADD += $(GSL_LIBS)
 iblossoc_LDADD += $(BOOST_PROGRAM_OPTIONS_LIB)
 iblossoc_SOURCES  =
 iblossoc_SOURCES += tree.hh tree.cc
@@ -191,6 +196,8 @@
 iblossoc_SOURCES += interactions.cc
 
 low_mem_iblossoc_LDADD  =
+low_mem_iblossoc_LDADD += -lsnpfile
+low_mem_iblossoc_LDADD += $(GSL_LIBS)
 low_mem_iblossoc_LDADD += $(BOOST_PROGRAM_OPTIONS_LIB)
 low_mem_iblossoc_SOURCES  =
 low_mem_iblossoc_SOURCES += tree.hh tree.cc
@@ -206,6 +213,8 @@
 low_mem_iblossoc_SOURCES += low_mem_interactions.cc
 
 snpfile_iblossoc_LDADD  =
+snpfile_iblossoc_LDADD += -lsnpfile
+snpfile_iblossoc_LDADD += $(GSL_LIBS)
 snpfile_iblossoc_LDADD += $(BOOST_PROGRAM_OPTIONS_LIB)
 snpfile_iblossoc_LDADD += $(BOOST_SERIALIZATION_LIB)
 snpfile_iblossoc_LDADD += $(BOOST_SIGNALS_LIB)
@@ -223,6 +232,8 @@
 snpfile_iblossoc_SOURCES += snpfile_interactions.cc
 
 fast_snpfile_iblossoc_LDADD  =
+fast_snpfile_iblossoc_LDADD += -lsnpfile
+fast_snpfile_iblossoc_LDADD += $(GSL_LIBS)
 fast_snpfile_iblossoc_LDADD += $(BOOST_PROGRAM_OPTIONS_LIB)
 fast_snpfile_iblossoc_LDADD += $(BOOST_SERIALIZATION_LIB)
 fast_snpfile_iblossoc_LDADD += $(BOOST_SIGNALS_LIB)
@@ -239,6 +250,28 @@
 fast_snpfile_iblossoc_SOURCES += io.hh io.cc
 fast_snpfile_iblossoc_SOURCES += fast_snpfile_interactions.cc
 
+matrix_test_LDADD  =
+matrix_test_LDADD += -lsnpfile
+
+incompatibility_test_LDADD  =
+incompatibility_test_LDADD += -lsnpfile
+
+tree_builder_test_LDADD  =
+tree_builder_test_LDADD += -lsnpfile
+
+score_test_LDADD  =
+score_test_LDADD += -lsnpfile
+score_test_LDADD += $(GSL_LIBS)
+
+io_test_LDADD  =
+io_test_LDADD += -lsnpfile
+
+incompatible_regress_test_LDADD  =
+incompatible_regress_test_LDADD += -lsnpfile
+
+genotype_score_test_LDADD  =
+genotype_score_test_LDADD += -lsnpfile
+genotype_score_test_LDADD += $(GSL_LIBS)
 
 
 # include GUI in source distributions...