Maintenance will be performed on git.ligo.org, chat.ligo.org, containers.ligo.org, and docs.ligo.org on the morning of Tuesday 11th August 2020, starting at approximately 9am PDT. It is expected to take around 20 minutes and there will be a short period of downtime (less than five minutes) towards the end of the maintenance window. Please direct any comments, questions, or concerns to computing-help@ligo.org.

configure.ac 6.47 KB
Newer Older
Adam Mercer's avatar
Adam Mercer committed
1
AC_PREREQ([2.63])
2
AC_INIT([LALFrame],[1.5.1.1],[lal-discuss@ligo.org])
3 4
AC_CONFIG_HEADERS([lib/config.h lib/LALFrameConfig.h])
AC_CONFIG_SRCDIR([lib/LALFrameIO.c])
5 6 7 8
AC_CONFIG_AUX_DIR([gnuscripts])
AC_CONFIG_MACRO_DIR([gnuscripts])
AC_CONFIG_FILES([ \
  Makefile \
9 10
  conda/Makefile \
  conda/meta.yaml.in \
11
  debian/Makefile \
12
  debian/control \
13 14
  doxygen/Makefile \
  doxygen/doxygen.cfg \
15 16
  include/Makefile \
  include/lal/Makefile \
17 18
  lalframe.pc \
  lalframe.spec \
19
  python/Makefile \
20 21 22
  python/lalframe/Makefile \
  python/lalframe/__init__.py \
  python/lalframe/utils/Makefile \
23 24 25
  lib/LALFrameVCSInfo.c \
  lib/LALFrameVCSInfo.h \
  lib/Makefile \
26 27
  bin/Makefile \
  bin/version.c \
28
  swig/Makefile \
29
  test/Makefile \
30
  test/python/Makefile \
31
  test/python/test_python_imports.py \
32
  test/python/test_python_scripts.py \
33
])
34 35 36 37 38 39
AM_INIT_AUTOMAKE([ \
  1.11 \
  foreign \
  subdir-objects \
  color-tests \
  parallel-tests \
40
  tar-pax \
41 42
  dist-xz \
  no-dist-gzip \
43
])
44

45
# version requirements
46
MIN_LAL_VERSION="7.0.0"
47
MIN_FRAMECPPC_VERSION="2.5.5"
48
MIN_FRAMEL_VERSION="8.39.2"
49
AC_SUBST([MIN_LAL_VERSION])
50
AC_SUBST([MIN_FRAMECPPC_VERSION])
51
AC_SUBST([MIN_FRAMEL_VERSION])
52

53 54
AC_CANONICAL_HOST

55 56
LALSUITE_ARG_VAR

Karl Wette's avatar
Karl Wette committed
57
LALSUITE_CHECK_GIT_REPO
58
LALSUITE_DISTCHECK_CONFIGURE_FLAGS
59

60 61 62 63 64 65 66 67 68 69 70 71 72 73
# 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.
74
AC_SUBST([LIBCURRENT],[11])
75
AC_SUBST([LIBREVISION],[1])
76
AC_SUBST([LIBAGE],[0])
77 78
AC_SUBST([LIBVERSION],[${LIBCURRENT}:${LIBREVISION}:${LIBAGE}])

79 80 81
# nightly build
LALSUITE_ENABLE_NIGHTLY

82 83 84 85 86 87
# enable check for framec
LALFRAME_ENABLE_FRAMEC

# enable check for framel
LALFRAME_ENABLE_FRAMEL

88 89 90
# enable strict gcc flags
LALSUITE_ENABLE_GCC_FLAGS

91 92
# enable SWIG wrapping modules
LALSUITE_ENABLE_SWIG
93

94 95 96
# enable Doxygen documentation
LALSUITE_ENABLE_DOXYGEN

97 98
# define version/configure info
LALSUITE_VERSION_CONFIGURE_INFO
Adam Mercer's avatar
Adam Mercer committed
99

100 101
# use silent build rules
AM_SILENT_RULES([yes])
102

103 104
# check for required compilers
LALSUITE_PROG_COMPILERS
105

106
# check for pthread, needed for low latency data test codes
107 108 109
AX_PTHREAD([lalframe_pthread=true],[lalframe_pthread=false])
AM_CONDITIONAL([PTHREAD],[test x$lalframe_pthread = xtrue])

110
# checks for programs
111
AC_PROG_INSTALL
112
AC_PROG_LN_S
113
AC_PROG_AWK
114
AC_PROG_SED
115
LALSUITE_CHECK_PYTHON([2.6])
116 117

# check for supported mac os x version
118
LALSUITE_OSX_VERSION_CHECK
119

120 121 122
# link tests using libtool
LALSUITE_USE_LIBTOOL

123 124
# check for header files
AC_HEADER_STDC
125
AC_CHECK_HEADERS([unistd.h])
126 127 128 129 130 131 132 133 134

# check for gethostname in unistd.h
AC_MSG_CHECKING([for gethostname prototype in unistd.h])
AC_EGREP_HEADER([gethostname],[unistd.h],[AC_MSG_RESULT([yes])]
AC_DEFINE([HAVE_GETHOSTNAME_PROTOTYPE],[1],
          [Define if gethostname prototype is in unistd.h]),
          [AC_MSG_RESULT]([no]))

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

137 138 139
# checks for library functions
AC_CHECK_FUNCS([gmtime_r localtime_r])

140 141
# check for framec or libframe libraries and headers
PKG_PROG_PKG_CONFIG
142 143 144 145
FRAMEC_AVAILABLE="no"
FRAMEL_AVAILABLE="no"

AS_IF([test "${framec}" = "true"], [
146
       FRAMEC_AVAILABLE="yes"
147
       PKG_CHECK_MODULES([FRAMECPPC],[framecppc >= ${MIN_FRAMECPPC_VERSION}],[true],[false])
148 149 150
       LALSUITE_ADD_FLAGS([C],[${FRAMECPPC_CFLAGS}],[${FRAMECPPC_LIBS}])
       AC_CHECK_LIB([framecppc],[FrameCFileOpen],,[FRAMEC_AVAILABLE="no"])
       AC_CHECK_HEADERS([framecppc/FrameC.h],,[FRAMEC_AVAILABLE="no"])
151 152 153
])

AS_IF([test "${framel}" = "true"], [
154
       FRAMEL_AVAILABLE="yes"
155 156 157
       PKG_CHECK_MODULES([FRAMEL],[framel],[true],[false])
       LALSUITE_ADD_FLAGS([C],[${FRAMEL_CFLAGS}],[${FRAMEL_LIBS}])
       AC_CHECK_LIB([framel],[FrLibIni],,[FRAMEL_AVAILABLE="no"])
158
       AC_CHECK_HEADERS([FrameL.h],,[FRAMEL_AVAILABLE="no"])
159
])
160 161 162

# make sure a frame library was found
AS_IF([test "${FRAMEC_AVAILABLE}" = "no" -a "${FRAMEL_AVAILABLE}" = "no"], [
163
       AC_MSG_ERROR([no frame library available])
164
])
165

166
AS_IF([test "${FRAMEC_AVAILABLE}" = "yes"],
167
      [AC_SUBST([PC_REQUIRES_FRAMEC], [", framecppc >= ${MIN_FRAMECPPC_VERSION}"])],
168 169 170 171
      [AC_SUBST([PC_REQUIRES_FRAMEC], [""])]
)

AS_IF([test "${FRAMEL_AVAILABLE}" = "yes"],
172
      [AC_SUBST([PC_REQUIRES_FRAMEL], [", framel"])],
173 174 175
      [AC_SUBST([PC_REQUIRES_FRAMEL], [""])]
)

176 177
AM_CONDITIONAL([FRAMEC],[test "${FRAMEC_AVAILABLE}" = "yes"])
AM_CONDITIONAL([FRAMEL],[test "${FRAMEL_AVAILABLE}" = "yes"])
Adam Mercer's avatar
Adam Mercer committed
178

179
# check for lal libraries and headers
180
LALSUITE_CHECK_LIB([LAL],[${MIN_LAL_VERSION}],[XLALPerror],[lal/XLALError.h])
181
LALSUITE_CHECK_LIB([LALSupport],[${MIN_LAL_VERSION}],[XLALCacheImport],[lal/LALCache.h])
182

183
# configure SWIG wrapping modules
Karl Wette's avatar
Karl Wette committed
184
LALSUITE_USE_SWIG
185

186 187 188
# configure Doxygen documentation
LALSUITE_USE_DOXYGEN

189
# add gcc specific flags
190
LALSUITE_ADD_GCC_FLAGS
191

192
# link any executables against LALFrame library
193
AC_SUBST([LDADD], ["\$(top_builddir)/lib/liblalframe.la"])
194

195 196 197 198
# add extra preprocessor flags
AM_CPPFLAGS="-DPKG_DATA_DIR='\"\$(pkgdatadir)/\"' ${AM_CPPFLAGS}"
AM_CPPFLAGS="-I\$(top_builddir)/include ${AM_CPPFLAGS}"

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

202 203 204 205 206
# 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}"])

207
# output
208
AC_OUTPUT
209
AC_MSG_NOTICE([
210 211
==================================================
LALFrame has now been successfully configured:
212

213
* Python support is $PYTHON_ENABLE_VAL
214 215
* FrameC availability... ${FRAMEC_AVAILABLE}
* FrameL availability... ${FRAMEL_AVAILABLE}
Karl Wette's avatar
Karl Wette committed
216 217
* SWIG bindings for Octave are $SWIG_BUILD_OCTAVE_ENABLE_VAL
* SWIG bindings for Python are $SWIG_BUILD_PYTHON_ENABLE_VAL
218
* Doxygen documentation is $DOXYGEN_ENABLE_VAL
219

220
and will be installed under the directory:
221

222
${prefix}
223

224 225 226
Now run 'make' to build LALFrame,
and run 'make install' to install LALFrame.
==================================================
227
])