forked from bcgsc/abyss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
206 lines (185 loc) · 5.49 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
AC_PREREQ(2.59)
AC_INIT(ABySS, 1.3.5, [email protected], abyss,
http://www.bcgsc.ca/platform/bioinfo/software/abyss)
AM_INIT_AUTOMAKE(foreign)
AC_CONFIG_SRCDIR([ABYSS/Abyss.cpp])
AC_CONFIG_HEADER([config.h])
# Checks for programs.
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_CHECK_TOOL(GHC, ghc)
AM_CONDITIONAL([HAVE_GHC], [test "$GHC"])
# Checks for header files.
AC_CHECK_HEADERS([dlfcn.h fcntl.h float.h limits.h \
stddef.h stdint.h stdlib.h sys/param.h])
AC_HEADER_STDBOOL
AC_HEADER_STDC
# Checks for typedefs, structures, and compiler characteristics.
AC_C_BIGENDIAN
AC_C_CONST
AC_C_INLINE
AC_CHECK_TYPES([ptrdiff_t])
AC_TYPE_MODE_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_INT64_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
# Checks for library functions.
AC_CHECK_FUNCS([dup2 gethostname getopt_long getpagesize \
memset strdup strerror strtoul])
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_REALLOC
AC_FUNC_SETVBUF_REVERSED
AC_FUNC_VPRINTF
# Checks for library constants.
AC_CHECK_DECL(HOST_NAME_MAX, [],
AC_DEFINE(HOST_NAME_MAX, [_POSIX_HOST_NAME_MAX],
[Define if the system does not provide HOST_NAME_MAX]),
[#include <limits.h>])
# Options to configure.
# Boost
AC_ARG_WITH(boost, AS_HELP_STRING([--with-boost=PATH],
[specify directory for the boost header files]))
if test "$with_boost" -a -d "$with_boost"; then
boost_cppflags="-I$with_boost"
fi
# MPI
AC_ARG_WITH(mpi, AS_HELP_STRING([--with-mpi=PATH],
[specify prefix directory for the installed MPI parallel
computing library]))
if test "$with_mpi" -a -d "$with_mpi"; then
mpi_cppflags="-I$with_mpi/include"
mpi_ldflags="-L$with_mpi/lib"
fi
AC_ARG_ENABLE(mpich, AS_HELP_STRING([--enable-mpich],
[use MPICH (default is to use Open MPI)]))
AC_ARG_ENABLE(lammpi, AS_HELP_STRING([--enable-lammpi],
[use LAM/MPI (default is to use Open MPI)]))
AC_ARG_ENABLE(fm, AS_HELP_STRING([--enable-fm],
[specify the width of the FM-index in bits (default is 64-bit)]),
[], [enable_fm=64])
AC_DEFINE_UNQUOTED(FMBITS, $enable_fm,
[Width of bits of the FM-index in bits])
AC_ARG_ENABLE(maxk, AS_HELP_STRING([--enable-maxk=N],
[set the maximum k-mer length (default is 64)]),
[], [enable_maxk=64])
AC_DEFINE_UNQUOTED(MAX_KMER, [$enable_maxk], [maximum k-mer length])
AC_ARG_ENABLE(popcnt, AS_HELP_STRING([--disable-popcnt],
[do not use the popcnt instruction]))
if test "$enable_popcnt" != no; then
AC_DEFINE(ENABLE_POPCNT, 1, [Define to use the popcnt instruction])
fi
AC_ARG_ENABLE(samseqqual,
AS_HELP_STRING([--enable-samseqqual],
[enable SAM sequence and quality fields]),
AC_DEFINE_UNQUOTED(SAM_SEQ_QUAL, 1,
[Define to use SAM sequence and quality fields]))
# Set compiler flags.
AC_SUBST(CPPFLAGS,
"-I$srcdir $boost_cppflags $mpi_cppflags $CPPFLAGS")
AC_SUBST(LDFLAGS, "$mpi_ldflags $LDFLAGS")
# Check for the MPI parallel computing library.
libs="$LIBS"
AC_DEFINE(MPICH_SKIP_MPICXX, 1,
[Define to disable MPICH C++ bindings])
AC_DEFINE(OMPI_SKIP_MPICXX, 1,
[Define to disable OpenMPI C++ bindings])
AC_CHECK_HEADERS([mpi.h])
if test "$enable_mpich"; then
AC_CHECK_LIB([pthread], [pthread_create])
AC_CHECK_LIB([mpich], [MPI_Init])
ac_cv_lib_mpi_MPI_Init=$ac_cv_lib_mpich_MPI_Init
elif test "$enable_lammpi"; then
AC_CHECK_LIB([pthread], [pthread_create])
AC_CHECK_LIB([dl], [dlopen])
AC_CHECK_LIB([lam], [lam_mutex_lock])
AC_CHECK_LIB([mpi], [MPI_Init])
AC_LANG_PUSH([C++])
AC_CHECK_LIB([lammpi++], [main])
AC_LANG_POP([C++])
else
AC_CHECK_LIB([mpi], [MPI_Init])
fi
AM_CONDITIONAL([HAVE_LIBMPI],
[test $ac_cv_header_mpi_h = yes -a $ac_cv_lib_mpi_MPI_Init = yes])
AC_SUBST(MPI_LIBS, "$LIBS")
# Check for the math library.
LIBS="$libs"
AC_CHECK_LIB([m], [sqrt])
AC_CHECK_FUNCS([pow sqrt])
AC_CHECK_FUNC(ceilf, [], AC_DEFINE(ceilf, [ceil],
[Define if the system does not provide ceilf]))
# Check for the dynamic linking library.
AC_CHECK_LIB([dl], [dlsym])
# Check for the hash table implementation.
AC_LANG([C++])
AC_CHECK_HEADERS([ \
boost/property_map/property_map.hpp \
google/sparse_hash_map \
unordered_map tr1/unordered_map \
])
# Check for Boost.
if test $ac_cv_header_boost_property_map_property_map_hpp != yes; then
AC_MSG_ERROR([ABySS requires the Boost C++ libraries, which may
be downloaded from here: http://www.boost.org/users/download/
It is not necessary to compile Boost before installing it. The
following commands will download and install Boost for ABySS:
wget http://downloads.sourceforge.net/project/boost/boost/1.50.0/boost_1_50_0.tar.bz2
tar jxf boost_1_50_0.tar.bz2
ln -s boost_1_50_0/boost boost
])
fi
# Check for OpenMP.
AC_OPENMP
if test -z $OPENMP_CXXFLAGS; then
OPENMP_CXXFLAGS=-Wno-unknown-pragmas
fi
# Set compiler flags.
AC_SUBST(AM_CXXFLAGS, '-Wall -Wextra -Werror')
AC_CONFIG_FILES([
Makefile
ABYSS/Makefile
Align/Makefile
Assembly/Makefile
Common/Makefile
DataLayer/Makefile
FMIndex/Makefile
Graph/Makefile
Parallel/Makefile
bin/Makefile
doc/Makefile
dialign/Makefile
kmerprint/Makefile
AdjList/Makefile
DAssembler/Makefile
DistanceEst/Makefile
Layout/Makefile
Map/Makefile
Misc/Makefile
Overlap/Makefile
PopBubbles/Makefile
Scaffold/Makefile
SimpleGraph/Makefile
MergePaths/Makefile
KAligner/Makefile
ParseAligns/Makefile
PathOverlap/Makefile
Consensus/Makefile
FilterGraph/Makefile
])
AC_OUTPUT
if test $ac_cv_header_google_sparse_hash_map != yes; then
AC_MSG_WARN([ABySS should be compiled with Google sparsehash to
reduce memory usage. It may be downloaded here:
http://code.google.com/p/google-sparsehash])
fi