forked from opencollab/arpack-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
316 lines (284 loc) · 11 KB
/
configure.ac
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
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
AC_PREREQ(2.67)
AC_INIT([ARPACK-NG],[3.7.0],[https://github.com/opencollab/arpack-ng/issues/],[arpack-ng],[https://github.com/opencollab/arpack-ng/])
AC_CONFIG_SRCDIR([SRC/version.h])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign])
AM_MAINTAINER_MODE
dnl Checks for standard programs.
dnl Autoconf was designed with the fundamental fact that compiler (= language support) is NOT an option.
AC_PROG_FC
AC_PROG_CC
AC_PROG_CXX
PKG_PROG_PKG_CONFIG
AC_PROG_SED
dnl Check for BLAS libraries
AX_BLAS([], [AC_MSG_ERROR([cannot find BLAS libraries])])
dnl Check for LAPACK libraries
AX_LAPACK([], [AC_MSG_ERROR([cannot find LAPACK libraries])])
AC_ARG_VAR(INTERFACE64, [set to 1 to use the 64-bit integer interface (ILP64) for ARPACK, BLAS and LAPACK])
if test x"$INTERFACE64" == x"1"; then
AC_LANG_PUSH([Fortran 77])
AX_CHECK_COMPILE_FLAG(-fdefault-integer-8, FFLAGS="$FFLAGS -fdefault-integer-8",
AX_CHECK_COMPILE_FLAG(-i8, FFLAGS="$FFLAGS -i8",
AC_MSG_WARN([configure does not know how to make your Fortran compiler use 64-bit integers: set it manually via FFLAGS.])))
AC_LANG_POP([Fortran 77])
AC_LANG_PUSH([Fortran])
AX_CHECK_COMPILE_FLAG(-fdefault-integer-8, FCFLAGS="$FCFLAGS -fdefault-integer-8",
AX_CHECK_COMPILE_FLAG(-i8, FCFLAGS="$FCFLAGS -i8",
AC_MSG_WARN([configure does not know how to make your Fortran compiler use 64-bit integers: set it manually via FCFLAGS.])))
AC_LANG_POP([Fortran])
else
INTERFACE64=0
fi
AC_ARG_VAR(LIBSUFFIX, [suffix to add to ARPACK libraries names])
AC_ARG_VAR(SYMBOLSUFFIX, [suffix to add to ARPACK, BLAS and LAPACK function names])
ifdef([LT_INIT], [], [
errprint([error: you must have libtool 2.4.2 or a more recent version
])
m4exit([1])])
LT_PREREQ([2.4.2])
LT_INIT([win32-dll])
dnl See if compiling parpack
AC_ARG_ENABLE([mpi],
[AS_HELP_STRING(
[--enable-mpi],
[build parallel version of arpack with MPI])],
[],
[AS_VAR_SET([enable_mpi], [no])])
AS_IF([test x"$enable_mpi" != x"no"], [
AC_LANG_PUSH([Fortran 77])
AX_MPI([], AC_MSG_ERROR([could not compile a Fortran MPI test program]))
AC_SUBST([MPI_Fortran_LIBS], [$MPILIBS])
F77=$MPIF77
AC_LANG_POP([Fortran 77])
])
dnl See if compiling with ISO_C_BINDING support
AC_ARG_ENABLE([icb],
[AS_HELP_STRING([--enable-icb],
[build support for *[ae]upd_c with ISO_C_BINDING])],
[],
[AS_VAR_SET([enable_icb], [no])])
dnl See if compiling matrix market example based on ICB
AC_ARG_ENABLE([icb-exmm],
[AS_HELP_STRING([--enable-icb-exmm],
[matrix market example based on ISO_C_BINDING])],
[AS_VAR_SET([enable_icb], [$enableval])],
[AS_VAR_SET([enable_icb_exmm], [no])])
if test x"$enable_icb_exmm" != x"no"; then
PKG_CHECK_MODULES([EIGEN3], [eigen3 >= 3.2], [], [AC_MSG_ERROR([Eigen not found. Give hints with PKG_CONFIG_PATH. Disable the need of this dependency using --disable-icb-exmm])])
AC_LANG_PUSH([C++])
CPPFLAGS_SAVE=$CPPFLAGS
CPPFLAGS=$EIGEN3_CFLAGS
AC_CHECK_HEADER([Eigen/Sparse],
[],
[AC_MSG_ERROR([Eigen/Sparse not found])])
AC_CHECK_HEADER([Eigen/IterativeLinearSolvers],
[],
[AC_MSG_ERROR([Eigen/IterativeLinearSolvers not found])])
AC_CHECK_HEADER([Eigen/SparseLU],
[],
[AC_MSG_ERROR([Eigen/SparseLU not found])])
AC_CHECK_HEADER([Eigen/SparseQR],
[],
[AC_MSG_ERROR([Eigen/SparseQR not found])])
AC_CHECK_HEADER([Eigen/SparseCholesky],
[],
[AC_MSG_ERROR([Eigen/SparseCholesky not found])])
AC_CHECK_HEADER([Eigen/Dense],
[],
[AC_MSG_ERROR([Eigen/Dense not found])])
AC_CHECK_HEADER([Eigen/LU],
[],
[AC_MSG_ERROR([Eigen/LU not found])])
AC_CHECK_HEADER([Eigen/QR],
[],
[AC_MSG_ERROR([Eigen/QR not found])])
AC_CHECK_HEADER([Eigen/Cholesky],
[],
[AC_MSG_ERROR([Eigen/Cholesky not found])])
CPPFLAGS=$CPPFLAGS_SAVE
AC_LANG_POP([C++])
fi
if test x"$enable_icb" != x"no"; then
AC_LANG_PUSH([Fortran])
AC_MSG_CHECKING([for iso_c_binding module compilation])
AC_LINK_IFELSE(
[
AC_LANG_PROGRAM(
[],
[
USE iso_c_binding
IMPLICIT NONE
INTEGER(C_INT) :: a
a = 1
]
)
],
[AC_MSG_RESULT([yes])],
[
AC_MSG_RESULT([no])
AC_MSG_ERROR([Fortran compiler does not support iso_c_binding])
]
)
AC_LANG_POP([Fortran])
if test x"$enable_mpi" != x"no"; then
AC_LANG_PUSH([Fortran])
AX_MPI([], AC_MSG_ERROR([could not compile a Fortran MPI test program]))
FC=$MPIFC
AC_FC_LIBRARY_LDFLAGS dnl set FCLIBS
AC_SUBST([MPI_Fortran_LIBS], ["$MPILIBS $FCLIBS"])
AC_LANG_POP([Fortran])
AC_LANG_PUSH([C])
AX_MPI([], AC_MSG_ERROR([could not compile a C MPI test program]))
AC_SUBST([MPI_C_LIBS], ["$MPILIBS $FCLIBS"])
CC=$MPICC
AC_LANG_POP([C])
AC_LANG_PUSH([C++])
AX_MPI([], AC_MSG_ERROR([could not compile a C++ MPI test program]))
AC_SUBST([MPI_CXX_LIBS], ["$MPILIBS $FCLIBS"])
CXX=$MPICXX
AC_LANG_POP([C++])
AC_LANG_PUSH([C])
AC_MSG_CHECKING([for MPI_Comm_c2f function])
AC_LINK_IFELSE(
[
AC_LANG_PROGRAM(
[[#include <mpi.h>]],
[[MPI_Comm c_comm; MPI_Comm_c2f(c_comm)]]
)
],
[AC_MSG_RESULT([yes])],
[
AC_MSG_RESULT([no])
AC_MSG_ERROR([symbol MPI_Comm_c2f does not exist])
]
)
AC_LANG_POP([C])
fi
AX_CXX_COMPILE_STDCXX(11)
else
# ICB saves you from old-fashion-boring-cumbersome-fortran/C crap...
if test x"$SYMBOLSUFFIX" != x""; then
dnl Need to rely on non-F77 features
AC_FC_LINE_LENGTH(unlimited)
FFLAGS="$FFLAGS $ac_cv_fc_line_length"
AC_LANG_PUSH([Fortran 77])
AX_CHECK_COMPILE_FLAG(-cpp, FFLAGS="$FFLAGS -cpp",
AX_CHECK_COMPILE_FLAG(-fpp, FFLAGS="$FFLAGS -fpp",
AC_MSG_WARN([configure does not know how to enable your Fortran compiler's preprocessor: set it manually via FFLAGS.])))
AC_LANG_POP([Fortran 77])
SCALARFUNS="naitr napps naup2 naupd nconv neigh neupd ngets statn saitr sapps saup2 saupd sconv seigt seupd sgets stats getv0 sortc sortr sesrt stqrb"
COMPLEXFUNS="naitr napps naup2 naupd neigh neupd ngets statn getv0 sortc"
BLASFUNS1="axpy copy gemv geqr2 lacpy lae2 lahqr lanhs larnv lartg lascl laset lasrt scal trevc trmm trsen gbmv gbtrf gbtrs gttrf gttrs pttrf pttrs"
BLASFUNS2="dot ger labad laev2 lamch lanst lanv2 lapy2 larf larfg lasr nrm2 orm2r rot steqr swap"
BLASFUNS3="dotc geru unm2r"
BLASFUNS4="COPY LABAD LAMCH LANHS LANV2 LARFG ROT GEMV"
BLASFUNS5="scnrm2 dznrm2 csscal zdscal"
FUNS1="$SCALARFUNS $BLASFUNS1 $BLASFUNS2"
for f in $FUNS1
do
FFLAGS="$FFLAGS -Ds$f=s$f$SYMBOLSUFFIX -Dd$f=d$f$SYMBOLSUFFIX"
done
FUNS2="$COMPLEXFUNS $BLASFUNS1 $BLASFUNS3"
for f in $FUNS2
do
FFLAGS="$FFLAGS -Dc$f=c$f$SYMBOLSUFFIX -Dz$f=z$f$SYMBOLSUFFIX"
done
for f in $BLASFUNS4
do
FFLAGS="$FFLAGS -DS$f=S$f$SYMBOLSUFFIX -DD$f=D$f$SYMBOLSUFFIX"
done
for f in $BLASFUNS5
do
FFLAGS="$FFLAGS -D$f=$f$SYMBOLSUFFIX -D$f=$f$SYMBOLSUFFIX"
done
fi
dnl Both a lowercase and uppercase variable are needed
dnl since the macro changes the case of the whole expression
symbolsuffix=$SYMBOLSUFFIX
AC_F77_FUNC(sgemm$SYMBOLSUFFIX, sgemmsuff)
AC_F77_FUNC(snaupd$SYMBOLSUFFIX, snaupdsuff)
AC_F77_FUNC(sneupd$SYMBOLSUFFIX, sneupdsuff)
AC_F77_FUNC(dnaupd$SYMBOLSUFFIX, dnaupdsuff)
AC_F77_FUNC(dneupd$SYMBOLSUFFIX, dneupdsuff)
AC_F77_FUNC(cheev$SYMBOLSUFFIX, cheevsuff)
dnl Needed for BLAS check and for tests (even when suffix is empty)
CPPFLAGS="$CPPFLAGS -Dsgemm=$sgemmsuff -Dsnaupd=$snaupdsuff -Dsneupd=$sneupdsuff -Ddnaupd=$dnaupdsuff -Ddneupd=$dneupdsuff -Dcheev=$cheevsuff"
fi
AM_CONDITIONAL([MPI], [test x"$enable_mpi" != x"no"])
AM_CONDITIONAL([BLACS], [false])
AM_CONDITIONAL([ICB], [test x"$enable_icb" != x"no"])
AM_CONDITIONAL([ICBEXMM], [test x"$enable_icb_exmm" != x"no"])
m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], [AC_SUBST([pkgconfigdir], [${libdir}/pkgconfig])])
AC_CONFIG_FILES([arpack$LIBSUFFIX.pc:arpack.pc.in], [], [LIBSUFFIX="$LIBSUFFIX"])
AC_SUBST([CMAKE_INSTALL_FULL_LIBDIR], ["$libdir"]) # FIXME: need to recursively expand these
AC_SUBST([CMAKE_INSTALL_FULL_INCLUDEDIR], ["$includedir"])
AC_SUBST([BLAS_LIBRARIES], ["$BLAS_LIBS"]) # FIXME: need a filename, not a -l flag
AC_SUBST([LAPACK_LIBRARIES], ["$LAPACK_LIBS"])
AC_SUBST([EIGEN3_INCLUDE_DIR], [`echo "$EIGEN3_CFLAGS" | sed -e s/-I//`])
AC_CONFIG_FILES([arpack-ng-config.cmake])
AC_SUBST([arpack_ng_VERSION], ["$VERSION"])
AC_CONFIG_FILES([arpack-ng-config-version.cmake])
AC_CONFIG_FILES([
arpackdef.h
Makefile
ICB/Makefile
UTIL/Makefile
SRC/Makefile
TESTS/Makefile
EXAMPLES/Makefile
EXAMPLES/BAND/Makefile
EXAMPLES/COMPLEX/Makefile
EXAMPLES/NONSYM/Makefile
EXAMPLES/SIMPLE/Makefile
EXAMPLES/SVD/Makefile
EXAMPLES/SYM/Makefile
EXAMPLES/MATRIX_MARKET/Makefile
PARPACK/Makefile
PARPACK/SRC/MPI/Makefile
PARPACK/SRC/BLACS/Makefile
PARPACK/UTIL/MPI/Makefile
PARPACK/UTIL/BLACS/Makefile
PARPACK/TESTS/MPI/Makefile
PARPACK/EXAMPLES/MPI/Makefile
PARPACK/EXAMPLES/BLACS/Makefile
])
AC_CONFIG_LINKS([
TESTS/testA.mtx:TESTS/testA.mtx
EXAMPLES/MATRIX_MARKET/An.mtx:EXAMPLES/MATRIX_MARKET/An.mtx
EXAMPLES/MATRIX_MARKET/As.mtx:EXAMPLES/MATRIX_MARKET/As.mtx
EXAMPLES/MATRIX_MARKET/Az.mtx:EXAMPLES/MATRIX_MARKET/Az.mtx
EXAMPLES/MATRIX_MARKET/B.mtx:EXAMPLES/MATRIX_MARKET/B.mtx
EXAMPLES/MATRIX_MARKET/Bz.mtx:EXAMPLES/MATRIX_MARKET/Bz.mtx
])
AC_OUTPUT
AC_MSG_RESULT([
--------------------------------------------------
Configuration summary for $PACKAGE_STRING
--------------------------------------------------
Installation prefix : $prefix
MPI enabled : $enable_mpi
ICB enabled : $enable_icb
INTERFACE64 : $INTERFACE64
F77 : $F77
FFLAGS : $FFLAGS
FC : $FC
FCFLAGS : $FCFLAGS
CC : $CC
CFLAGS : $CFLAGS
CXX : $CXX
CXXFLAGS : $CXXFLAGS
CPPFLAGS : $CPPFLAGS
MPI_Fortran_LIBS : $MPI_Fortran_LIBS
MPI_C_LIBS : $MPI_C_LIBS
MPI_CXX_LIBS : $MPI_CXX_LIBS
BLAS : $BLAS_LIBS
LAPACK : $LAPACK_LIBS
EIGEN : $EIGEN3_CFLAGS
LIBS : $LIBS
LDADD : $LDADD
--------------------------------------------------
Configuration OK
--------------------------------------------------
])