-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathconfigure.ac
More file actions
284 lines (211 loc) · 7.08 KB
/
Copy pathconfigure.ac
File metadata and controls
284 lines (211 loc) · 7.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
AC_INIT([Tempo2],[2025.01.2],[mkeith@pulsarastronomy.net],[],[http://www.bitbucket.org/psrsoft/tempo2])
AC_ARG_VAR([TEMPO2], [Default TEMPO2 installation directory])
AC_PREFIX_DEFAULT([${TEMPO2:-"/usr/local"}])
if test -n "${CXXFLAGS}"; then
user_set_cxxflags=yes
fi
AC_CONFIG_MACRO_DIR([autoconf])
AC_CONFIG_AUX_DIR([config])
# Enable large-file support
AC_SYS_LARGEFILE
# Determine the machine endian
AC_C_BIGENDIAN
AC_LANG([C++])
# Checks for compilers
AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_CC
AC_PROG_CPP
AM_PROG_CC_C_O
AC_PROG_F77
AC_PROG_F77_C_O
AC_F77_LIBRARY_LDFLAGS
AC_PROG_FC
if test -n "${CXXFLAGS}"; then
user_set_cxxflags=yes
fi
AC_PROG_CXX
if test X$user_set_cxxflags != Xyes; then
CXXFLAGS="-O2"
fi
AC_PROG_INSTALL
AC_PROG_LIBTOOL
if test $can_build_shared == no ; then
AC_WARN("Libtool cannot build shared libraries - ")
fi
# Check whether the 'cos' function can be found in library 'm'
# (standard C math library).
# Math library is required for the tempo2 predictor library
AC_CHECK_LIB(m, cos)
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wno-error"
ACX_PTHREAD
CFLAGS="$save_CFLAGS"
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(PTHREAD_CFLAGS)
AC_ARG_ENABLE([float128], AS_HELP_STRING([--enable-float128], [Enable __float128 support]),[],[enable_float128=no])
AS_IF([test "x$enable_float128" != "xno"], [
AC_MSG_CHECKING(if compiler knows __float128)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[__float128 x = 1.0Q;]])],
have_float128=yes,
have_float128=no)
AC_MSG_RESULT($have_float128)
AS_IF([test "x$have_float128" != "xno"], [
AC_CHECK_LIB(quadmath, cosq,[LDFLAGS="$LDFLAGS -lquadmath"],have_float128=no)
])
])
if test X$have_float128 != Xyes; then
AC_WARN("may be limited to 1ns precision from lack of 128bit floats")
fi
AM_CONDITIONAL(HAVE_FLOAT128,[test "$have_float128" = yes])
rm -f TKlongdouble.h
# look for third-party packages in various places (or not)
SWIN_LOCAL
AC_MSG_CHECKING([for \$TEMPO2])
if test -n "$TEMPO2" ; then
TEMPO2_DIR=$TEMPO2
AC_SUBST(TEMPO2_DIR)
have_tempo2_dir=yes
else
have_tempo2_dir=no
fi
AC_MSG_RESULT($have_tempo2_dir)
if test X$have_tempo2_dir != Xyes; then
AC_WARN("You must set the $TEMPO2 variable before configuring.")
fi
AC_ARG_WITH([tempo2-plug-dir],
AC_HELP_STRING([--with-tempo2-plug-dir=DIR],
[Specify DIR to install plugins]))
AC_MSG_CHECKING([for plugin install path])
if test -z "$with_tempo2_plug_dir" ; then
TEMPO2_PLUG_INSTALL=$TEMPO2/plugins/
else
TEMPO2_PLUG_INSTALL=$with_tempo2_plug_dir
AC_DEFINE_UNQUOTED([TEMPO2_CONFIGURE_PLUG], "$with_tempo2_plug_dir",["Tempo2 plugin path"])
fi
AC_SUBST(TEMPO2_PLUG_INSTALL)
AC_MSG_RESULT($TEMPO2_PLUG_INSTALL)
MJK_FORTRAN_TEST
if test X$fortran_c_links != Xyes ; then
AC_MSG_ERROR(Your C and F77 compilers do not cross link (\$CC=$CC \$F77=$F77))
fi
LT_LIB_DLLOAD
SWIN_LIB_PGPLOT
SWIN_LIB_FFTW
SWIN_LIB_CFITSIO
# Check for openmp (optional package)
AX_OPENMP([have_openmp=yes],[have_openmp=no])
if test X$have_openmp == Xyes; then
CFLAGS="$CFLAGS $OPENMP_CFLAGS -DHAVE_OPENMP"
CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS -DHAVE_OPENMP"
LDFLAGS="$LDFLAGS $OPENMP_CXXFLAGS"
fi
#GSL basic stuff
AX_PATH_GSL(1.11.0, have_gsl=yes,have_gsl=no)
AM_CONDITIONAL(HAVE_GSL, [test x"$have_gsl" = xyes])
AC_F77_WRAPPERS
ACX_BLAS(have_blas=yes,have_blas=no)
AC_MSG_CHECKING([for BLAS])
AC_MSG_RESULT($have_blas)
AM_CONDITIONAL(HAVE_BLAS, [test x$have_blas = xyes])
# Test for calceph
ACX_CALCEPH(have_calceph=yes, have_calceph=no)
AC_MSG_CHECKING([for CALCEPH])
AC_MSG_RESULT($have_calceph)
AM_CONDITIONAL(HAVE_CALCEPH, [test x"$have_calceph" = xyes])
# test for LAPACK acceleration
ACX_LAPACK(have_lapack=yes, have_lapack=no)
AC_MSG_CHECKING([for LAPACK])
AC_MSG_RESULT($have_lapack)
AM_CONDITIONAL(HAVE_LAPACK, [test x"$have_lapack" = xyes])
SWIN_LIB_QDINSTALL
AC_MSG_CHECKING([for LOGIN_ARCH variable])
if test -n "$LOGIN_ARCH" ; then
t2arch=$LOGIN_ARCH
else
if test -n "$OSTYPE" ; then
AC_MSG_RESULT(no)
AC_MSG_CHECKING([for OSTYPE variable])
t2arch=$OSTYPE
else
if test -n $OSTYPE ; then
AC_MSG_RESULT(no)
AC_MSG_CHECKING([for uname])
t2arch=`uname`
fi
fi
fi
AC_MSG_RESULT($t2arch)
AC_DEFINE_UNQUOTED([TEMPO2_ARCH], "$t2arch",["Tempo2 ARCH variable"])
T2ARCH=$t2arch
AC_SUBST(T2ARCH)
#doxygen
AC_CHECK_PROG(have_doxygen,[doxygen], [yes],[no])
AM_CONDITIONAL(HAVE_DOXYGEN, [test x"$have_doxygen" = xyes])
AC_ARG_ENABLE([default-qrfit],AS_HELP_STRING([--enable-default-qrfit],[Use QR fit by default]))
AS_IF([test "x$enable_default_qrfit" = "xyes"], [
AC_MSG_NOTICE([Use QR fitter by default if avaliable])
AC_DEFINE([QR_DEFAULT],[],[Use QR fitting by default])
],[
AC_MSG_NOTICE([Use SVD fitter by default])
])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile plugin/Makefile sofa/Makefile
unsupported_plugins/Makefile
unsupported_plugins/toasim/Makefile
unsupported_plugins/splug/Makefile
unsupported_plugins/glast/Makefile
tests/Makefile
])
AC_OUTPUT
AC_MSG_NOTICE(Fortran compiler is $F77 $FFLAGS)
AC_MSG_NOTICE(C compiler is $CC $CFLAGS)
AC_MSG_NOTICE(C++ compiler is $CXX $CXXFLAGS)
AC_MSG_NOTICE(Global linking flags are $LDFLAGS)
# User warnings
if test X$have_pgplot != Xyes; then
AC_MSG_NOTICE(Plugins: PGPLOT was not detected - plugins requiring pgplot will not be compiled)
else
AC_MSG_NOTICE(PGPLOT compile flags are "$PGPLOT_CFLAGS")
AC_MSG_NOTICE(PGPLOT linking flags are "$PGPLOT_LIBS")
fi
if test X$have_gsl != Xyes; then
AC_MSG_NOTICE(Plugins: GSL was not found - plugins requiring GSL will not be compiled)
fi
if test X$have_fftw3 != Xyes; then
AC_MSG_NOTICE(Plugins: FFTW3 was not found - plugins requiring fftw will not be compiled)
fi
if test X$have_cfitsio != Xyes; then
AC_MSG_NOTICE(Plugins: cfitsio was not found - plugins requiring cfitsio will not be compiled)
fi
if test X$have_lapack = Xyes; then
AC_MSG_NOTICE(Using LAPACK library for Cholesky decomposition)
fi
if test X$have_blas = Xyes; then
AC_MSG_NOTICE(Using BLAS library for matrix multiplication)
fi
if test X$have_openmp == Xyes; then
AC_MSG_NOTICE(Using OpenMP for multithreading)
fi
if test X$have_calceph = Xyes; then
AC_MSG_NOTICE(Able to use calceph library for ephemeris reading)
else
AC_MSG_NOTICE(Calceph library was not found)
fi
if test $can_build_shared == no ; then
echo ""
AC_WARN("Libtool cannot build shared libraries - no plugins can be built!")
echo ""
else
echo ""
echo "NOTICE: plugins can be built with 'make plugins && make plugins-install'"
echo "temponest is now installed separately. Try ./update --temponest"
fi
echo ""
echo "****"
echo "Ok! Good to start compiling... try make && make install'"
echo "****"