configure.ac 6 KB
Newer Older
1
AC_INIT([lalinspiral],[1.2.3.1],[lal-discuss@gravity.phys.uwm.edu])
2
AM_CONFIG_HEADER([include/config.h src/LALInspiralConfig.h])
3
AC_CONFIG_SRCDIR([src/LALInspiral.h])
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
AC_CONFIG_AUX_DIR([gnuscripts])
AC_CONFIG_MACRO_DIR([gnuscripts])
AC_CONFIG_FILES([ \
  lalinspiral.spec \
  lalinspiral.pc \
  Makefile \
  gnuscripts/Makefile \
  debian/Makefile \
  include/Makefile \
  include/lal/Makefile \
  src/Makefile \
  test/Makefile
])
AM_INIT_AUTOMAKE([foreign])

AC_CANONICAL_HOST

21
LALSUITE_ARG_VAR
22
LALSUITE_DISTCHECK_CONFIGURE_FLAGS
23

24 25 26 27 28 29 30 31 32 33 34 35 36 37
# 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.
38 39 40
AC_SUBST([LIBCURRENT],[3])
AC_SUBST([LIBREVISION],[0])
AC_SUBST([LIBAGE],[1])
41 42
AC_SUBST([LIBVERSION],[${LIBCURRENT}:${LIBREVISION}:${LIBAGE}])

43 44 45
# nightly build
LALSUITE_ENABLE_NIGHTLY

Adam Mercer's avatar
Adam Mercer committed
46 47 48
# debug
LALSUITE_ENABLE_DEBUG

49 50 51 52 53 54 55 56 57
# enable CUDA support
LALSUITE_WITH_CUDA

# enable strict gcc flags
LALSUITE_ENABLE_GCC_FLAGS

# optional lal libraries
LALSUITE_ENABLE_LALFRAME

58
# put version/configure info in config header
59 60 61 62 63 64
lalinspiral_version_major=`echo "$VERSION" | cut -d. -f1`
lalinspiral_version_minor=`echo "$VERSION" | cut -d. -f2`
lalinspiral_version_micro=`echo "$VERSION" | cut -d. -f3`
lalinspiral_version_devel=`echo "$VERSION" | cut -d. -f4-`
test -z "$lalinspiral_version_micro" && lalinspiral_version_micro=0
test -z "$lalinspiral_version_devel" && lalinspiral_version_devel=0
65 66
lalinspiral_configure_date=`date +"%Y-%m-%dT%H:%M:%S%z"`
AC_DEFINE_UNQUOTED([LALINSPIRAL_VERSION],["$VERSION"],[LALInspiral Version])
67 68 69 70 71 72 73 74
AC_DEFINE_UNQUOTED([LALINSPIRAL_VERSION_MAJOR],[$lalinspiral_version_major],
                   [LALInspiral Version Major Number])
AC_DEFINE_UNQUOTED([LALINSPIRAL_VERSION_MINOR],[$lalinspiral_version_minor],
                   [LALInspiral Version Minor Number])
AC_DEFINE_UNQUOTED([LALINSPIRAL_VERSION_MICRO],[$lalinspiral_version_micro],
                   [LALInspiral Version Micro Number])
AC_DEFINE_UNQUOTED([LALINSPIRAL_VERSION_DEVEL],[$lalinspiral_version_devel],
                   [LALInspiral Version Devel Number])
75 76 77 78 79
AC_DEFINE_UNQUOTED([LALINSPIRAL_CONFIGURE_ARGS],["$ac_configure_args"],
                   [LALInspiral Configure Arguments])
AC_DEFINE_UNQUOTED([LALINSPIRAL_CONFIGURE_DATE],["$lalinspiral_configure_date"],
                   [LALInspiral Configure Date])

80 81 82
# workaround broken libtool multilib support on sl6
LALSUITE_MULTILIB_LIBTOOL_HACK

83 84 85 86
# check for c compiler
m4_pattern_allow([AC_PROG_CC_C99])
m4_ifdef([AC_PROG_CC_C99],[AC_PROG_CC_C99],[LALSUITE_AC_PROG_CC_C99])

87 88 89
# CUDA requires a c++ compiler
AC_PROG_CXX

90 91 92
# use silent build rules if available
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)

93 94 95
# check for c++ compiler
AC_PROG_CXX

96 97 98 99
# checks for programs
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
100
AC_PROG_AWK
101
AC_PROG_SED
102 103 104 105
LT_INIT
AM_PATH_PYTHON([2.4],,[AC_MSG_ERROR([Python-2.4, or higher, is required])])

# check for supported mac os x version
106
LALSUITE_OSX_VERSION_CHECK
107

108 109 110
# link tests using libtool
LALSUITE_USE_LIBTOOL

111 112 113
# check complex number types
LALSUITE_CHECK_COMPLEX_NUMBER_TYPES

114 115 116 117 118 119 120 121 122 123 124 125
# check for header files
AC_HEADER_STDC

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

# check for gsl
PKG_CHECK_MODULES([GSL],[gsl],[true],[false])
CPPFLAGS="$CPPFLAGS $GSL_CFLAGS"
LIBS="$LIBS $GSL_LIBS"
AC_CHECK_LIB([gslcblas],[main],,[AC_MSG_ERROR([could not find the gsl library])])
AC_CHECK_LIB([gsl],[gsl_strerror],,[AC_MSG_ERROR([could not find the gsl library])])
126
LALSUITE_ENABLE_FAST_GSL
127 128 129 130

# check for gsl headers
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
131 132 133 134 135 136 137 138 139
# metaio
PKG_CHECK_MODULES([METAIO],[libmetaio],[true],[false])
CPPFLAGS="$CPPFLAGS $METAIO_CFLAGS"
LIBS="$LIBS $METAIO_LIBS"
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])])

140
# check for lal libraries and headers
141 142 143 144 145
LALSUITE_CHECK_LIB([LAL],[6.6.0],[LALVersion],[lal/LALStdio.h])
LALSUITE_CHECK_LIB([LALSupport],[6.6.0],[LALOpenDataFile],[lal/FileIO.h])
LALSUITE_CHECK_LIB([LALMetaIO],[1.0.2],[XLALCreateMetaTableDir],[lal/LIGOLwXMLRead.h])
LALSUITE_CHECK_LIB([LALSimulation],[0.1.0],[XLALSimDetectorStrainREAL8TimeSeries],[lal/LALSimulation.h])
LALSUITE_CHECK_OPT_LIB([LALFrame],[1.0.3],[LALFrOpen],[lal/LALFrameL.h])
146 147 148

# add gcc specific flags
if test "$GCC" = yes; then
149 150 151 152 153 154
  # don't use gcc flags when cuda is enabled
  if test "${cuda}" != "true"; then
    CFLAGS="$CFLAGS $lal_gcc_flags"
  else
    AC_MSG_NOTICE([CUDA support is enabled, disabling GCC flags])
  fi
155 156 157 158 159 160 161

  # add mac os x specific flags
  if test "x$MACOSX_VERSION" != "x"; then
    CFLAGS="$CFLAGS -mmacosx-version-min=10.4"
  fi
fi

162 163 164 165 166
# define if CUDA is enabled
if test "${cuda}" = "true"; then
  AC_DEFINE([LALINSPIRAL_CUDA_ENABLED],[1],[Define if using cuda library])
fi

167 168 169 170 171 172
# output
LAL_HEADER_LINK=${ac_aux_dir}/header-link.mk
AC_SUBST_FILE([LAL_HEADER_LINK])
AC_PROG_MAKE_SET
AC_OUTPUT
echo "
173 174 175 176 177
=================================================================

        LALInspiral has now been successfully configured:

            CUDA support is $CUDA_ENABLE_VAL
178 179 180

        and will be installed under the directory:

181
            ${prefix}
182

Adam Mercer's avatar
Adam Mercer committed
183 184
        Now run 'make' to build LALInspiral
        and run 'make install' to install LALInspiral
185 186

================================================================="