configure.ac 5.67 KB
Newer Older
Adam Mercer's avatar
Adam Mercer committed
1
AC_PREREQ([2.63])
2
AC_INIT([LALBurst],[1.4.4.1],[lal-discuss@ligo.org])
Adam Mercer's avatar
Adam Mercer committed
3
AC_CONFIG_HEADERS([src/config.h src/LALBurstConfig.h])
4
AC_CONFIG_SRCDIR([src/EPSearch.c])
Adam Mercer's avatar
Adam Mercer committed
5
6
7
8
9
AC_CONFIG_AUX_DIR([gnuscripts])
AC_CONFIG_MACRO_DIR([gnuscripts])
AC_CONFIG_FILES([ \
  Makefile \
  debian/Makefile \
10
  debian/control \
11
12
  doxygen/Makefile \
  doxygen/doxygen.cfg \
Adam Mercer's avatar
Adam Mercer committed
13
14
  include/Makefile \
  include/lal/Makefile \
15
16
  lalburst.pc \
  lalburst.spec \
17
  python/Makefile \
18
19
  python/lalburst/Makefile \
  python/lalburst/__init__.py \
20
21
22
  src/LALBurstVCSInfo.c \
  src/LALBurstVCSInfo.h \
  src/Makefile \
23
  src/version.c \
Karl Wette's avatar
Karl Wette committed
24
  swig/Makefile \
25
  test/Makefile \
Adam Mercer's avatar
Adam Mercer committed
26
])
27
28
29
30
31
32
AM_INIT_AUTOMAKE([ \
  1.11 \
  foreign \
  subdir-objects \
  color-tests \
  parallel-tests \
Adam Mercer's avatar
Adam Mercer committed
33
  tar-ustar \
34
35
  dist-xz \
  no-dist-gzip \
36
])
Adam Mercer's avatar
Adam Mercer committed
37

38
# version requirements
Adam Mercer's avatar
Adam Mercer committed
39
40
41
MIN_LAL_VERSION="6.18.0"
MIN_LALMETAIO_VERSION="1.3.1"
MIN_LALSIMULATION_VERSION="1.7.0"
42
43
44
45
AC_SUBST([MIN_LAL_VERSION])
AC_SUBST([MIN_LALMETAIO_VERSION])
AC_SUBST([MIN_LALSIMULATION_VERSION])

Adam Mercer's avatar
Adam Mercer committed
46
47
AC_CANONICAL_HOST

48
49
LALSUITE_ARG_VAR

Karl Wette's avatar
Karl Wette committed
50
LALSUITE_CHECK_GIT_REPO
51
LALSUITE_DISTCHECK_CONFIGURE_FLAGS
52

Adam Mercer's avatar
Adam Mercer committed
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# set library api info
# 1. start with version information of "0:0:0" for each libtool library
# 2. update the version information only immediately before a public
#    release of your software. More frequent updates are unnecessary,
#    and only guarantee that the current interface number gets larger
#    faster.
# 3. if the library source code has changed at all since the last
#    update, then increment revision ("c:r:a" becomes "c:r+1:a").
# 4. if any interfaces have been added, removed, or changed since the
#    last update, increment current, and set revision to 0.
# 5. if any interfaces have been added since the last public release,
#    then increment age.
# 6. if any interfaces have been removed since the last public release,
#    then set age to 0.
67
AC_SUBST([LIBCURRENT],[5])
68
AC_SUBST([LIBREVISION],[2])
69
AC_SUBST([LIBAGE],[0])
Adam Mercer's avatar
Adam Mercer committed
70
71
AC_SUBST([LIBVERSION],[${LIBCURRENT}:${LIBREVISION}:${LIBAGE}])

72
73
74
# nightly build
LALSUITE_ENABLE_NIGHTLY

75
76
77
# enable strict gcc flags
LALSUITE_ENABLE_GCC_FLAGS

Karl Wette's avatar
Karl Wette committed
78
79
80
# enable SWIG wrapping modules
LALSUITE_ENABLE_SWIG

81
82
83
# enable Doxygen documentation
LALSUITE_ENABLE_DOXYGEN

84
85
# define version/configure info
LALSUITE_VERSION_CONFIGURE_INFO
Adam Mercer's avatar
Adam Mercer committed
86

87
88
89
# workaround broken libtool multilib support on sl6
LALSUITE_MULTILIB_LIBTOOL_HACK

90
91
# use silent build rules
AM_SILENT_RULES([yes])
Adam Mercer's avatar
Adam Mercer committed
92

93
94
# check for required compilers
LALSUITE_PROG_COMPILERS
95

Adam Mercer's avatar
Adam Mercer committed
96
# checks for programs
97
AC_PROG_INSTALL
Adam Mercer's avatar
Adam Mercer committed
98
AC_PROG_LN_S
99
AC_PROG_AWK
100
AC_PROG_SED
101
LALSUITE_CHECK_PYTHON([2.6])
Adam Mercer's avatar
Adam Mercer committed
102
103

# check for supported mac os x version
104
LALSUITE_OSX_VERSION_CHECK
Adam Mercer's avatar
Adam Mercer committed
105

106
107
108
# link tests using libtool
LALSUITE_USE_LIBTOOL

Adam Mercer's avatar
Adam Mercer committed
109
110
111
112
# check for header files
AC_HEADER_STDC

# check for required libraries
113
AC_CHECK_LIB([m],[main],,[AC_MSG_ERROR([could not find the math library])])
Adam Mercer's avatar
Adam Mercer committed
114

115
# check for Python
116
117
LALSUITE_CHECK_PYTHON([2.6])
AX_PYTHON_DEVEL()
118
119

# check for NumPy
120
121
122
123
124
125
126
127
128
AX_PYTHON_MODULE(numpy, fatal)
NUMPY_CFLAGS=-I`$PYTHON -c "import numpy;print (numpy.get_include());"`
old_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS ${PYTHON_CPPFLAGS} ${NUMPY_CFLAGS}"
AC_CHECK_HEADER([numpy/arrayobject.h],
  [PYTHON_CPPFLAGS="${PYTHON_CPPFLAGS} ${NUMPY_CFLAGS}"],
  [AC_MSG_ERROR([Numpy extension header not found])],
  [#include "Python.h"])
CFLAGS="$old_CFLAGS"
129

Adam Mercer's avatar
Adam Mercer committed
130
131
# check for gsl
PKG_CHECK_MODULES([GSL],[gsl],[true],[false])
132
LALSUITE_ADD_FLAGS([C],[${GSL_CFLAGS}],[${GSL_LIBS}])
133
AC_CHECK_LIB([gslcblas],[main],,[AC_MSG_ERROR([could not find the gsl library])])
Karl Wette's avatar
Karl Wette committed
134
AC_CHECK_LIB([gsl],[gsl_version],,[AC_MSG_ERROR([could not find the gsl library])])
135
LALSUITE_CHECK_GSL_VERSION([1.13])
136
LALSUITE_ENABLE_FAST_GSL
Adam Mercer's avatar
Adam Mercer committed
137

Adam Mercer's avatar
Adam Mercer committed
138
# check for gsl headers
139
AC_CHECK_HEADERS([gsl/gsl_errno.h],,[AC_MSG_ERROR([could not find the gsl/gsl_errno.h header])])
Adam Mercer's avatar
Adam Mercer committed
140

Adam Mercer's avatar
Adam Mercer committed
141
142
# metaio
PKG_CHECK_MODULES([METAIO],[libmetaio],[true],[false])
143
LALSUITE_ADD_FLAGS([C],[${METAIO_CFLAGS}],[${METAIO_LIBS}])
Adam Mercer's avatar
Adam Mercer committed
144
145
146
147
148
AC_CHECK_LIB([metaio],[MetaioOpen],,[AC_MSG_ERROR([could not find the metaio library])])

# check for libmetaio headers
AC_CHECK_HEADERS([metaio.h],,[AC_MSG_ERROR([could not find the metaio.h header])])

149
# check for lal libraries and headers
150
LALSUITE_CHECK_LIB([LAL],[${MIN_LAL_VERSION}],[XLALPerror],[lal/XLALError.h])
151
152
153
LALSUITE_CHECK_LIB([LALSupport],[${MIN_LAL_VERSION}],[XLALCacheImport],[lal/LALCache.h])
LALSUITE_CHECK_LIB([LALMetaIO],[${MIN_LALMETAIO_VERSION}],[XLALCreateMetaTableDir],[lal/LIGOLwXMLRead.h])
LALSUITE_CHECK_LIB([LALSimulation],[${MIN_LALSIMULATION_VERSION}],[XLALSimDetectorStrainREAL8TimeSeries],[lal/LALSimulation.h])
Adam Mercer's avatar
Adam Mercer committed
154

Karl Wette's avatar
Karl Wette committed
155
# configure SWIG wrapping modules
Karl Wette's avatar
Karl Wette committed
156
LALSUITE_USE_SWIG
Karl Wette's avatar
Karl Wette committed
157

158
159
160
# configure Doxygen documentation
LALSUITE_USE_DOXYGEN

Adam Mercer's avatar
Adam Mercer committed
161
# add gcc specific flags
162
LALSUITE_ADD_GCC_FLAGS
Adam Mercer's avatar
Adam Mercer committed
163

164
165
166
# link any executables against LALBurst library
AC_SUBST([LDADD], ["\$(top_builddir)/src/liblalburst.la"])

167
168
169
170
# add extra preprocessor flags
AM_CPPFLAGS="-DPKG_DATA_DIR='\"\$(pkgdatadir)/\"' ${AM_CPPFLAGS}"
AM_CPPFLAGS="-I\$(top_builddir)/include ${AM_CPPFLAGS}"

171
172
173
# force headers to be installed in ${includedir}/lal, ignoring library name
AC_SUBST([pkgincludedir], ["\${includedir}/lal"])

174
175
176
177
178
# force all python modules into the exec dir to prevent mixed C and
# pure-python library code from being split across lib and lib64 on
# RedHat-derived systems.
AC_SUBST([pkgpythondir], ["\${pkgpyexecdir}"])

179
# output
Adam Mercer's avatar
Adam Mercer committed
180
AC_OUTPUT
181
AC_MSG_NOTICE([
182
==================================================
Karl Wette's avatar
Karl Wette committed
183
184
LALBurst has now been successfully configured:

185
* Python support is $PYTHON_ENABLE_VAL
Karl Wette's avatar
Karl Wette committed
186
187
* SWIG bindings for Octave are $SWIG_BUILD_OCTAVE_ENABLE_VAL
* SWIG bindings for Python are $SWIG_BUILD_PYTHON_ENABLE_VAL
188
* Doxygen documentation is $DOXYGEN_ENABLE_VAL
Karl Wette's avatar
Karl Wette committed
189

190
and will be installed under the directory:
Adam Mercer's avatar
Adam Mercer committed
191

192
${prefix}
Adam Mercer's avatar
Adam Mercer committed
193

194
195
196
Now run 'make' to build LALBurst,
and run 'make install' to install LALBurst.
==================================================
197
])