configure.ac 8.23 KB
Newer Older
Adam Mercer's avatar
Adam Mercer committed
1
AC_PREREQ([2.63])
2
AC_INIT([LALInference],[1.10.1],[lal-discuss@ligo.org])
3
AC_CONFIG_HEADERS([src/config.h src/LALInferenceConfig.h])
4 5 6 7 8 9
AC_CONFIG_SRCDIR([src/LALInference.h])
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 \
13 14
  include/Makefile \
  include/lal/Makefile \
15 16
  lalinference.pc \
  lalinference.spec \
17
  python/Makefile \
18 19 20
  python/lalinference/Makefile \
  python/lalinference/__init__.py \
  python/lalinference/bayestar/Makefile \
21
  python/lalinference/imrtgr/Makefile \
22
  python/lalinference/io/Makefile \
23
  python/lalinference/io/events/Makefile \
24
  python/lalinference/plot/Makefile \
25
  python/lalinference/popprior/Makefile \
26 27
  python/lalinference/rapid_pe/Makefile \
  python/lalinference/tiger/Makefile \
28
  python/lalinference/util/Makefile \
29 30 31
  src/LALInferenceVCSInfo.c \
  src/LALInferenceVCSInfo.h \
  src/Makefile \
32
  src/version.c \
33
  swig/Makefile \
34
  test/Makefile
35
])
36
AC_USE_SYSTEM_EXTENSIONS
37 38 39 40 41 42
AM_INIT_AUTOMAKE([ \
  1.11 \
  foreign \
  subdir-objects \
  color-tests \
  parallel-tests \
43
  tar-ustar \
44 45
  dist-xz \
  no-dist-gzip \
46
])
47

48
# version requirements
49
MIN_GLUE_VERSION="1.54.1"
50 51 52 53 54 55 56
MIN_LAL_VERSION="6.19.0"
MIN_LALMETAIO_VERSION="1.4.0"
MIN_LALFRAME_VERSION="1.4.0"
MIN_LALSIMULATION_VERSION="1.8.0"
MIN_LALBURST_VERSION="1.5.0"
MIN_LALINSPIRAL_VERSION="1.8.0"
MIN_LALPULSAR_VERSION="1.17.0"
57
AC_SUBST([MIN_GLUE_VERSION])
58 59 60 61
AC_SUBST([MIN_LAL_VERSION])
AC_SUBST([MIN_LALMETAIO_VERSION])
AC_SUBST([MIN_LALFRAME_VERSION])
AC_SUBST([MIN_LALSIMULATION_VERSION])
62
AC_SUBST([MIN_LALBURST_VERSION])
63 64 65
AC_SUBST([MIN_LALINSPIRAL_VERSION])
AC_SUBST([MIN_LALPULSAR_VERSION])

66 67
AC_CANONICAL_HOST

68 69
LALSUITE_ARG_VAR

Karl Wette's avatar
Karl Wette committed
70
LALSUITE_CHECK_GIT_REPO
71
LALSUITE_DISTCHECK_CONFIGURE_FLAGS
72

73 74 75 76 77 78 79 80 81 82 83 84 85 86
# 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.
87
AC_SUBST([LIBCURRENT],[15])
88
AC_SUBST([LIBREVISION],[0])
89
AC_SUBST([LIBAGE],[0])
90 91 92 93 94
AC_SUBST([LIBVERSION],[${LIBCURRENT}:${LIBREVISION}:${LIBAGE}])

# nightly build
LALSUITE_ENABLE_NIGHTLY

95 96 97 98 99 100 101 102
# enable strict gcc flags
LALSUITE_ENABLE_GCC_FLAGS

# optional lal libraries
LALSUITE_ENABLE_LALFRAME
LALSUITE_ENABLE_LALMETAIO
LALSUITE_ENABLE_LALINSPIRAL
LALSUITE_ENABLE_LALPULSAR
103
LALSUITE_ENABLE_LALBURST
104

105 106 107
# enable SWIG wrapping modules
LALSUITE_ENABLE_SWIG

108 109 110
# enable Doxygen documentation
LALSUITE_ENABLE_DOXYGEN

111 112 113
# enable help2man documentation
LALSUITE_ENABLE_HELP2MAN

114 115
# define version/configure info
LALSUITE_VERSION_CONFIGURE_INFO
116

117 118 119
# workaround broken libtool multilib support on sl6
LALSUITE_MULTILIB_LIBTOOL_HACK

120 121
# use silent build rules
AM_SILENT_RULES([yes])
122

123 124
# check for required compilers
LALSUITE_PROG_COMPILERS
125

126
# checks for programs
127
AC_PROG_INSTALL
128
AC_PROG_LN_S
129
AC_PROG_AWK
130
AC_PROG_SED
131
LALSUITE_CHECK_PYTHON([2.6])
132 133 134 135 136 137 138 139 140

# check for supported mac os x version
LALSUITE_OSX_VERSION_CHECK

# link tests using libtool
LALSUITE_USE_LIBTOOL

# check for header files
AC_HEADER_STDC
141
AC_CHECK_HEADERS([unistd.h])
142

143 144
# check for specific functions
AC_FUNC_STRNLEN
145
AC_CHECK_FUNC([strdup], [], [AC_MSG_ERROR([could not find the strdup function])])
146

147 148 149
# check for required libraries
AC_CHECK_LIB([m],[main],,[AC_MSG_ERROR([could not find the math library])])

150
# check for OpenMP
151
LALSUITE_ENABLE_OPENMP
152 153

# check for HEALPix
154
PKG_CHECK_MODULES([CHEALPIX],[chealpix >= 3.30.0],[true],[false])
155
LALSUITE_ADD_FLAGS([C],[${CHEALPIX_CFLAGS}],[${CHEALPIX_LIBS}])
156 157
HEALPIX_ENABLE_VAL=ENABLED
AC_CHECK_LIB([chealpix],[nside2npix],,[HEALPIX_ENABLE_VAL=DISABLED])
158 159
AM_CONDITIONAL([HAVE_CHEALPIX],[test "x$HEALPIX_ENABLE_VAL" = "xENABLED"])

160 161
# check for gsl
PKG_CHECK_MODULES([GSL],[gsl],[true],[false])
162
LALSUITE_ADD_FLAGS([C],[${GSL_CFLAGS}],[${GSL_LIBS}])
Karl Wette's avatar
Karl Wette committed
163
AC_CHECK_LIB([gsl],[gsl_version],,[AC_MSG_ERROR([could not find the gsl library])])
164
LALSUITE_CHECK_GSL_VERSION([1.15])
165
LALSUITE_ENABLE_FAST_GSL
166 167 168 169 170 171

# check for gsl headers
AC_CHECK_HEADERS([gsl/gsl_errno.h],,[AC_MSG_ERROR([could not find the gsl/gsl_errno.h header])])

# metaio
PKG_CHECK_MODULES([METAIO],[libmetaio],[true],[false])
172
LALSUITE_ADD_FLAGS([C],[${METAIO_CFLAGS}],[${METAIO_LIBS}])
173 174 175 176 177
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])])

178 179 180 181 182 183 184 185 186 187 188 189 190 191
# check for hdf5 support
HDF5_ENABLE_VAL="DISABLED"
# Note that AX_LIB_HDF5 uses h5cc to determine compiler for configure tests.
# Make sure that it uses the same compiler as we are using.
# Otherwise the configure tests may fail if we are using icc.
HDF5_CC="${CC}"; export HDF5_CC
HDF5_CLINKER="${CC}"; export HDF5_CLINKER
AX_LIB_HDF5()
unset HDF5_CC
unset HDF5_CLINKER
if test "${with_hdf5}" != "yes"; then
  AC_MSG_ERROR([could not find the HDF5 library])
fi

192
# check for lal libraries and headers
193
LALSUITE_CHECK_LIB([LAL],[${MIN_LAL_VERSION}],[XLALPerror],[lal/XLALError.h])
194 195 196 197 198 199 200 201
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([LALFrame],[${MIN_LALFRAME_VERSION}],[LALFrOpen],[lal/LALFrameL.h])
LALSUITE_CHECK_LIB([LALSimulation],[${MIN_LALSIMULATION_VERSION}],[XLALSimDetectorStrainREAL8TimeSeries],[lal/LALSimulation.h])
LALSUITE_CHECK_LIB([LALInspiral],[${MIN_LALINSPIRAL_VERSION}],[LALInspiralParameterCalc],[lal/LALInspiral.h])
LALSUITE_CHECK_LIB([LALPulsar],[${MIN_LALPULSAR_VERSION}],[XLALComputeFstat],[lal/ComputeFstat.h])
LALSUITE_CHECK_LIB([LALBurst],[${MIN_LALBURST_VERSION}],[XLALEPSearch],[lal/EPSearch.h])

202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224
dnl FIXME: This doesn't work in the top-level build, because it tries
dnl to compile and link against LAL itself, which will not have been built yet.
dnl
dnl AC_MSG_CHECKING([if LAL was built with HDF5 support])
dnl AC_RUN_IFELSE(
dnl   [AC_LANG_PROGRAM(
dnl     [
dnl       #include <lal/H5FileIO.h>
dnl       #include <lal/XLALError.h>
dnl     ],
dnl     [
dnl       int ret;
dnl       (void)XLALSetSilentErrorHandler();
dnl       (void)XLALH5FileOpen(NULL, NULL);
dnl       return xlalErrno != XLAL_EFAULT;
dnl     ]
dnl   )],
dnl   [AC_MSG_RESULT([yes])],
dnl   [
dnl     AC_MSG_RESULT([no])
dnl     AC_MSG_ERROR([LAL must be built with HDF5 support in order to build LALInference])
dnl   ]
dnl )
225

226
# configure SWIG wrapping modules
Karl Wette's avatar
Karl Wette committed
227
LALSUITE_USE_SWIG
228

229 230 231
# configure Doxygen documentation
LALSUITE_USE_DOXYGEN

232 233 234
# add gcc specific flags
LALSUITE_ADD_GCC_FLAGS

235 236 237
# link any executables against LALInference library
AC_SUBST([LDADD], ["\$(top_builddir)/src/liblalinference.la"])

238 239 240 241
# add extra preprocessor flags
AM_CPPFLAGS="-DPKG_DATA_DIR='\"\$(pkgdatadir)/\"' ${AM_CPPFLAGS}"
AM_CPPFLAGS="-I\$(top_builddir)/include ${AM_CPPFLAGS}"

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

245 246 247 248 249
# 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}"])

250
# output
251
AC_OUTPUT
252
AC_MSG_NOTICE([
253 254
==================================================
LALInference has now been successfully configured:
255

256
* Python support is $PYTHON_ENABLE_VAL
Karl Wette's avatar
Karl Wette committed
257 258
* SWIG bindings for Octave are $SWIG_BUILD_OCTAVE_ENABLE_VAL
* SWIG bindings for Python are $SWIG_BUILD_PYTHON_ENABLE_VAL
259 260
* HEALPix is $HEALPIX_ENABLE_VAL
* OpenMP acceleration is $OPENMP_ENABLE_VAL
261
* Doxygen documentation is $DOXYGEN_ENABLE_VAL
262
* help2man documentation is $HELP2MAN_ENABLE_VAL
263

264
and will be installed under the directory:
265

266
${prefix}
267

268 269 270
Now run 'make' to build LALInference,
and run 'make install' to install LALInference.
==================================================
271
])