configure.ac 5.19 KB
Newer Older
Adam Mercer's avatar
Adam Mercer committed
1
AC_PREREQ([2.63])
2
AC_INIT([LALSimulation],[1.7.0.1],[lal-discuss@ligo.org])
3
AC_CONFIG_HEADERS([src/config.h src/LALSimulationConfig.h])
Adam Mercer's avatar
Adam Mercer committed
4
5
6
7
8
9
AC_CONFIG_SRCDIR([src/LALSimulation.c])
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
  lalsimulation.pc \
  lalsimulation.spec \
17
  python/Makefile \
18
19
  python/lalsimulation/Makefile \
  python/lalsimulation/__init__.py \
20
21
22
  src/LALSimulationVCSInfo.c \
  src/LALSimulationVCSInfo.h \
  src/Makefile \
23
  src/mathematica_codes/Makefile \
24
  src/mathematica_codes/SEOBNRv3_opt/Makefile \
25
  src/version.c \
26
  swig/Makefile \
27
  test/Makefile \
Adam Mercer's avatar
Adam Mercer committed
28
])
29
30
31
32
33
34
AM_INIT_AUTOMAKE([ \
  1.11 \
  foreign \
  subdir-objects \
  color-tests \
  parallel-tests \
Adam Mercer's avatar
Adam Mercer committed
35
  tar-ustar \
36
37
  dist-xz \
  no-dist-gzip \
38
])
Adam Mercer's avatar
Adam Mercer committed
39

40
# version requirements
41
MIN_LAL_VERSION="6.18.0"
42
43
AC_SUBST([MIN_LAL_VERSION])

Adam Mercer's avatar
Adam Mercer committed
44
45
AC_CANONICAL_HOST

46
47
LALSUITE_ARG_VAR

Karl Wette's avatar
Karl Wette committed
48
LALSUITE_CHECK_GIT_REPO
49
LALSUITE_DISTCHECK_CONFIGURE_FLAGS
Adam Mercer's avatar
Adam Mercer committed
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64

# 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.
65
AC_SUBST([LIBCURRENT],[16])
66
AC_SUBST([LIBREVISION],[0])
67
AC_SUBST([LIBAGE],[0])
Adam Mercer's avatar
Adam Mercer committed
68
69
70
71
72
AC_SUBST([LIBVERSION],[${LIBCURRENT}:${LIBREVISION}:${LIBAGE}])

# nightly build
LALSUITE_ENABLE_NIGHTLY

73
74
75
# enable strict gcc flags
LALSUITE_ENABLE_GCC_FLAGS

76
77
# enable SWIG wrapping modules
LALSUITE_ENABLE_SWIG
78

79
80
81
# enable Doxygen documentation
LALSUITE_ENABLE_DOXYGEN

82
83
84
# enable help2man documentation
LALSUITE_ENABLE_HELP2MAN

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

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

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

94
95
# check for required compilers
LALSUITE_PROG_COMPILERS
Adam Mercer's avatar
Adam Mercer committed
96
97

# checks for programs
98
AC_PROG_INSTALL
Adam Mercer's avatar
Adam Mercer committed
99
AC_PROG_LN_S
100
AC_PROG_AWK
101
AC_PROG_SED
102
LALSUITE_CHECK_PYTHON([2.6])
Adam Mercer's avatar
Adam Mercer committed
103
104
105
106
107
108
109
110
111

# 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
112
AC_CHECK_HEADERS([unistd.h])
Adam Mercer's avatar
Adam Mercer committed
113
114
115
116
117
118
119
120
121
122
123

# 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
AC_CHECK_LIB([m],[main],,[AC_MSG_ERROR([could not find the math library])])

124
# check for OpenMP
125
LALSUITE_ENABLE_OPENMP
126

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

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

# check for lal libraries and headers
139
LALSUITE_CHECK_LIB([LAL],[${MIN_LAL_VERSION}],[XLALPerror],[lal/XLALError.h])
140
LALSUITE_CHECK_LIB([LALSupport],[${MIN_LAL_VERSION}],[XLALCacheImport],[lal/LALCache.h])
Adam Mercer's avatar
Adam Mercer committed
141

142
# configure SWIG wrapping modules
Karl Wette's avatar
Karl Wette committed
143
LALSUITE_USE_SWIG
144

145
146
147
# configure Doxygen documentation
LALSUITE_USE_DOXYGEN

Adam Mercer's avatar
Adam Mercer committed
148
# add gcc specific flags
149
LALSUITE_ADD_GCC_FLAGS
Adam Mercer's avatar
Adam Mercer committed
150

151
152
153
# link any executables against LALSimulation library
AC_SUBST([LDADD], ["\$(top_builddir)/src/liblalsimulation.la"])

154
155
156
157
# add extra preprocessor flags
AM_CPPFLAGS="-DPKG_DATA_DIR='\"\$(pkgdatadir)/\"' ${AM_CPPFLAGS}"
AM_CPPFLAGS="-I\$(top_builddir)/include ${AM_CPPFLAGS}"

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

161
162
163
164
165
# 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}"])

166
# output
Adam Mercer's avatar
Adam Mercer committed
167
AC_OUTPUT
168
AC_MSG_NOTICE([
169
170
==================================================
LALSimulation has now been successfully configured:
Adam Mercer's avatar
Adam Mercer committed
171

172
* Python support is $PYTHON_ENABLE_VAL
Karl Wette's avatar
Karl Wette committed
173
174
* SWIG bindings for Octave are $SWIG_BUILD_OCTAVE_ENABLE_VAL
* SWIG bindings for Python are $SWIG_BUILD_PYTHON_ENABLE_VAL
175
* OpenMP acceleration is $OPENMP_ENABLE_VAL
176
* Doxygen documentation is $DOXYGEN_ENABLE_VAL
177
* help2man documentation is $HELP2MAN_ENABLE_VAL
178

179
and will be installed under the directory:
180

181
${prefix}
Adam Mercer's avatar
Adam Mercer committed
182

183
184
185
Now run 'make' to build LALSimulation,
and run 'make install' to install LALSimulation.
==================================================
186
])