-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
executable file
·446 lines (371 loc) · 12.7 KB
/
configure.ac
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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
#
AC_PREREQ(2.59)
AC_INIT([LatPack],[1.9.1-15], [http://www.bioinf.uni-freiburg.de/Software/LatPack/])
AC_CONFIG_SRCDIR([src/latFit.cc])
AC_CONFIG_AUX_DIR([.])
# minimal reqired version of the BIU library
BIU_REQUIRED_VERSION=2.3.7
ELL_REQUIRED_VERSION=3.2.4
# biu version distributed with this package
LOCAL_BIU_FOLDER="biu-2.3.7"
AC_CONFIG_SUBDIRS([biu-2.3.7])
# Checks for programs.
AC_PROG_CXX
AC_CHECK_PROG([HAVE_PKG_CONFIG], [pkg-config], [yes],[no])
AC_MSG_CHECKING(whether to build in debug mode with assertions)
debuger=no
AC_ARG_ENABLE(debug,
AC_HELP_STRING(
[--enable-debug],
[enable debug mode with assertions (def=no)]
),
debuger="$enableval"
)
AC_MSG_RESULT($debuger)
if test x"$debuger" = x"yes"; then
AC_DEFINE(DEBUG)
CXXFLAGS="$CXXFLAGS -std=c++0x -g -Wall -Wno-uninitialized -O0 -pedantic -maes"
else
AC_DEFINE(NDEBUG)
CXXFLAGS="$CXXFLAGS -std=c++0x -O2 -maes"
fi
AM_INIT_AUTOMAKE([subdir-objects])
AC_LANG_CPLUSPLUS
###############################################################################
# BEGIN DOCUMENTATION BUILD CHECK
###############################################################################
dnl Find latex and friends
AC_MSG_CHECKING([whether to build docs])
AC_ARG_WITH(docs,
AS_HELP_STRING([--without-docs],
[do not try to build docs]),
,with_docs=yes)
AC_MSG_RESULT($with_docs)
if test "$with_docs" = "yes"; then
AC_CHECK_PROG(PDFLATEX, pdflatex, pdflatex)
if test -z "$PDFLATEX"; then
AC_MSG_WARN([Cannot find pdflatex in your path!])
fi
if test ! '(' -z "$PDFLATEX" ')'; then
BUILDDOC="yes"
fi
else
BUILDDOC="no"
fi
AM_CONDITIONAL(build_docs, [test "$BUILDDOC" = "yes"])
###############################################################################
# END DOCUMENTATION BUILD CHECK
###############################################################################
###############################################################################
# BEGIN STATIC LINKING CHECK
###############################################################################
AC_ARG_ENABLE(static-linking,
AC_HELP_STRING(
[--enable-static-linking],
[enables static linking of executables (default=disabled)]
),
[enable_static_linking=$enableval],
[enable_static_linking=no]
)
if test "$enable_static_linking" = "yes"; then
LDFLAGS="-static $LDFLAGS"
fi
AC_MSG_CHECKING([whether to link only with static libraries])
AC_MSG_RESULT($enable_static_linking)
###############################################################################
# END STATIC LINKING CHECK
###############################################################################
###############################################################################
# BEGIN BIU LIBRARY PATH SUPPORT
###############################################################################
LIBS="-lbiu $LIBS"
# BIU library path support, if not installed in usual directories
AC_ARG_WITH(BIU,
AC_HELP_STRING(
[--with-BIU=prefix],
[try this for the BIU-library prefix install directory]
),
BIUPATHSET=1,
BIUPATHSET=0
)
if test $BIUPATHSET = 1 ; then
CXXFLAGS="$CXXFLAGS -I$with_BIU/include"
LDFLAGS="-L$with_BIU/lib $LDFLAGS"
export PKG_CONFIG_PATH="$with_BIU/lib/pkgconfig/:$PKG_CONFIG_PATH"
LOCAL_BIU_FOLDER=""
else
# biu version distributed with this package
AC_SUBST(LOCAL_BIU_FOLDER)
LOCAL_BIU_ROOT=`pwd`/$LOCAL_BIU_FOLDER;
CXXFLAGS="-I$LOCAL_BIU_ROOT/src/ $CXXFLAGS"
LDFLAGS="-L$LOCAL_BIU_ROOT/src/ $LDFLAGS"
fi
AM_CONDITIONAL(build_local_biu, [test "$BIUPATHSET" = 0])
###############################################################################
# END BIU LIBRARY PATH SUPPORT
###############################################################################
###############################################################################
# BEGIN ELL LIBRARY PATH SUPPORT
###############################################################################
# ELL library path support, if not installed in usual directories
AC_ARG_WITH(ELL,
AC_HELP_STRING(
[--with-ELL=prefix],
[try this for the ELL-library prefix install directory. Mandatory for latFold program.]
),
ELLPATHSET=1,
ELLPATHSET=0
)
if test $ELLPATHSET = 1 ; then
CXXFLAGS="$CXXFLAGS -I$with_ELL/include"
LDFLAGS="-L$with_ELL/lib $LDFLAGS"
export PKG_CONFIG_PATH="$with_ELL/lib/pkgconfig/:$PKG_CONFIG_PATH"
fi
###############################################################################
# END ELL LIBRARY PATH SUPPORT
###############################################################################
###############################################################################
# BEGIN GSL LIBRARY PATH SUPPORT
###############################################################################
# GSL library path support, if not installed in usual directories
AC_ARG_WITH(GSL,
AC_HELP_STRING(
[--with-GSL=prefix],
[try this for a non-standard GNU scientific library (GSL) install prefix. Mandatory for latFit program.]
),
GSLPATHSET=1,
GSLPATHSET=0
)
if test $GSLPATHSET = 1 ; then
CXXFLAGS="-I$with_GSL/include $CXXFLAGS"
LDFLAGS="-L$with_GSL/lib $LDFLAGS"
fi
###############################################################################
# END GSL LIBRARY PATH SUPPORT
###############################################################################
###############################################################################
# BEGIN HDF5 LIBRARY PATH SUPPORT
###############################################################################
# GSL library path support, if not installed in usual directories
AC_ARG_WITH(HDF5,
AC_HELP_STRING(
[--with-HDF5=prefix],
[try this for a HDF5 install prefix. Mandatory for latFold & latFoldVec program.]
),
HDF5PATHSET=1,
HDF5PATHSET=0
)
if test $HDF5PATHSET = 1 ; then
CXXFLAGS="-I$with_HDF5/include $CXXFLAGS"
LDFLAGS="-L$with_HDF5/lib64 -Wl,-rpath=$with_HDF5/lib64 $LDFLAGS"
fi
###############################################################################
# END HDF5 LIBRARY PATH SUPPORT
###############################################################################
###############################################################################
# BEGIN FOLDING MODULE CHECK
###############################################################################
AC_ARG_ENABLE(latFold,
AC_HELP_STRING(
[--enable-latFold],
[enable compilation of latFold program (default=disabled)]
),
[enable_latfold=$enableval],
[enable_latfold=no]
)
AM_CONDITIONAL(with_latfold,
[test "$enable_latfold" = "yes"])
if test "$enable_latfold" = "yes"; then
LIBS="-lell -lhdf5 $LIBS"
fi
###############################################################################
# END FOLDING MODULE CHECK
###############################################################################
# Checks for libraries and header files.
# check for stl headers
AC_CHECK_HEADERS([vector])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
###############################################################################
# BEGIN DEPENDENCY CHECK
###############################################################################
###############################################################################
# BEGIN BIU CHECK
###############################################################################
# check for biu headers
AC_MSG_CHECKING([for the BIU C++ library])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <biu/VirtualList.hh>]])],
[
AC_MSG_RESULT(yes)
BIUNOTFOUND=0;
],
[
AC_MSG_RESULT(no)
BIUNOTFOUND=1;
]
)
if test "$enable_latfold" = "yes"; then
# check for ELL headers
AC_MSG_CHECKING([for the ELL C++ library headers])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[ #include <ell/State.hh> ]])],
[
AC_MSG_RESULT(yes)
ELLNOTFOUND=0;
],
[
AC_MSG_RESULT(no)
ELLNOTFOUND=1;
]
)
else
ELLNOTFOUND=0;
fi
if test "$enable_latfold" = "yes"; then
# check for HDF5 headers
AC_MSG_CHECKING([for the HDF5 C library headers])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[ #include <hdf5.h> ]])],
[
AC_MSG_RESULT(yes)
HDF5NOTFOUND=0;
],
[
AC_MSG_RESULT(no)
HDF5NOTFOUND=1;
]
)
else
HDF5NOTFOUND=0;
fi
# store current *FLAGS and merge with AM_*FLAGS for compilation and linker check
OLD_CXXFLAGS=$CXXFLAGS;
OLD_CPPFLAGS=$CPPFLAGS;
OLD_LDFLAGS=$LDFLAGS;
CXXFLAGS="$AM_CXXFLAGS $CXXFLAGS"
CPPFLAGS="$AM_CXXFLAGS $CPPFLAGS"
LDFLAGS="$AM_LDFLAGS $LDFLAGS"
# ensure the library to check for is covered by the LIBS variable
OLD_LIBS=$LIBS
LIBS="$LIBS -lgsl -lgslcblas -lm"
AC_MSG_NOTICE([])
AC_MSG_NOTICE([current CXXFLAGS = $CXXFLAGS])
AC_MSG_NOTICE([current LDFLAGS = $LDFLAGS])
AC_MSG_NOTICE([current LIBS = $LIBS])
AC_MSG_NOTICE([])
# try to link a function of GSL library
AC_MSG_CHECKING([for the GSL C++ library headers])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[ #include <gsl/gsl_matrix_double.h> ]])],
[
AC_MSG_RESULT(yes)
FOUND_GSL_HEADER=1;
FOUND_GSL=1;
],
[
AC_MSG_RESULT(no)
FOUND_GSL_HEADER=0;
FOUND_GSL=0;
]
)
#AC_CHECK_LIB([m],[main])
#AC_CHECK_LIB([gslcblas],[main])
#AC_CHECK_LIB([gsl],[main])
#AC_MSG_CHECKING([whether the GNU scientific library (GSL) can be linked])
#AC_LINK_IFELSE(
# [AC_LANG_PROGRAM([[ #include <gsl/gsl_matrix_double.h> ]],
# [[ gsl_matrix_alloc(3, 3); ]])],
# [AC_MSG_RESULT([yes])
# FOUND_GSL=1;],
# [AC_MSG_RESULT([no])
# LIBS=$OLD_LIBS;
# FOUND_GSL=0;])
# reset original *FLAGS
CXXFLAGS=$OLD_CXXFLAGS
CPPFLAGS=$OLD_CPPFLAGS
LDFLAGS=$OLD_LDFLAGS
DEPENDENCYNOTFOUND=0;
# error output if BIU-headers not found
if test $BIUNOTFOUND = 1; then
AC_MSG_NOTICE([])
AC_MSG_NOTICE([the BIU C++ library is required for building the tools.])
AC_MSG_NOTICE([it can be obtained from http://www.bioinf.uni-freiburg.de/SW/BIU/.])
AC_MSG_NOTICE([])
if test $BIUPATHSET = 1; then
AC_MSG_NOTICE([cannot find BIU in given path '$with_BIU'.])
else
AC_MSG_NOTICE([if BIU is installed elsewhere use --with-BIU=prefix.])
fi
DEPENDENCYNOTFOUND=1;
fi
# error output if ELL-headers not found
if test $ELLNOTFOUND = 1; then
AC_MSG_NOTICE([])
AC_MSG_NOTICE([the ELL C++ library is required for building the tools.])
AC_MSG_NOTICE([it can be obtained from http://www.bioinf.uni-freiburg.de/SW/ELL/.])
AC_MSG_NOTICE([])
if test $ELLPATHSET = 1; then
AC_MSG_NOTICE([cannot find ELL in given path '$with_ELL'.])
else
AC_MSG_NOTICE([if ELL is installed elsewhere use --with-ELL=prefix.])
fi
DEPENDENCYNOTFOUND=1;
fi
# error output if HDF5-headers not found
if test $HDF5NOTFOUND = 1; then
AC_MSG_NOTICE([])
AC_MSG_NOTICE([the HDF5 C library is required for building the tools.])
AC_MSG_NOTICE([it can be obtained from the internet.])
AC_MSG_NOTICE([])
if test $HDF5PATHSET = 1; then
AC_MSG_NOTICE([cannot find HDF5 in given path '$with_HDF5'.])
else
AC_MSG_NOTICE([if HDF5 is installed elsewhere use --with-HDF5=prefix.])
fi
DEPENDENCYNOTFOUND=1;
fi
# error output if GSL-headers not found
if test $FOUND_GSL = 0; then
AC_MSG_NOTICE([])
AC_MSG_NOTICE([the GNU scientific library (GSL) is required for building the tools.])
AC_MSG_NOTICE([it can be obtained from www.gnu.org/software/gsl/])
AC_MSG_NOTICE([and is usually available for linux distributions.])
AC_MSG_NOTICE([])
if test $GSLPATHSET = 1; then
AC_MSG_NOTICE([cannot find GSL in given path '$with_GSL'.])
else
AC_MSG_NOTICE([if GSL is installed elsewhere use --with-GSL=prefix.])
fi
DEPENDENCYNOTFOUND=1;
fi
# error ABORT if one of the libraries was not found
if test $DEPENDENCYNOTFOUND = 1; then
AC_MSG_NOTICE([])
AC_MSG_NOTICE([current CXXFLAGS = $CXXFLAGS])
AC_MSG_NOTICE([current LDFLAGS = $LDFLAGS])
AC_MSG_NOTICE([])
AC_MSG_ERROR([library not found! Try './configure --help'.])
fi
if test "x$HAVE_PKG_CONFIG" = "xyes"; then
PKG_PROG_PKG_CONFIG
if test $BIUPATHSET = 1 ; then
AC_MSG_NOTICE([check if BIU version >= $BIU_REQUIRED_VERSION])
PKG_CHECK_MODULES([BIU], [biu >= $BIU_REQUIRED_VERSION])
fi
if test $ELLPATHSET = 1 ; then
AC_MSG_NOTICE([check if ELL version >= $ELL_REQUIRED_VERSION])
PKG_CHECK_MODULES([ELL], [ell >= $ELL_REQUIRED_VERSION])
fi
fi
###############################################################################
# END DEPENDENCY CHECK
###############################################################################
AC_CONFIG_FILES([ Makefile ])
AC_CONFIG_FILES([ src/version.hh ])
AC_CONFIG_FILES([ src/Makefile ])
AC_CONFIG_FILES([ doc/Makefile doc/version-info.tex ])
AC_CONFIG_FILES([ energy/Makefile ])
AC_OUTPUT