-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathconfigure.ac
257 lines (217 loc) · 7.15 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
AC_PREREQ([2.61])
AC_INIT([PVFMM],[1.0.0],[[email protected]])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([-Wall no-define])
AC_CONFIG_SRCDIR([src/tree_node.cpp])
AM_CONFIG_HEADER([config.h]) # prep config.h from config.h.in
AX_PREFIX_CONFIG_H([include/pvfmm_config.h]) # prep include/pvfmm_config.h from it..
# Set language to C++
AC_LANG([C++])
# Checks for programs.
AX_PROG_CXX_MPI(,[CXX=$MPICXX],[])
AX_MPI([CXX=$MPICXX; CC=$MPICC; CFLAGS=$CFLAGS],
[AC_MSG_ERROR([Cannot find mpicxx. Make sure that MPI is installed and location of compiler is in PATH.])])
AX_COMPILER_VENDOR
AC_PROG_AWK
AC_PROG_F77
AC_PROG_INSTALL
AC_PROG_MKDIR_P
AC_PROG_LN_S
AC_PROG_MAKE_SET
#AC_PROG_RANLIB
##AM_PROG_AR
# Check for CUDA
AX_CHECK_CUDA
# automake 1.12 seems to require AM_PROG_AR, but automake 1.11 doesn't
# recognize it
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
if test "x${ac_compile_nvcc}" = xyes; then
CC_save=$CC
CC=$NVCC
fi
LT_INIT
AC_PROG_LIBTOOL
if test "x${ac_compile_nvcc}" = xyes; then
CC=$CC_save
fi
# Checks for documentation build tools
AC_CHECK_PROG([doxygen_ok], [doxygen], [yes], [no])
AC_CHECK_PROG([pdflatex_ok], [pdflatex], [yes], [no])
AC_CHECK_PROG([latex_ok], [latex], [yes], [no])
AC_CHECK_PROG([dvips_ok], [dvips], [yes], [no])
AC_CHECK_PROG([gs_ok], [gs], [yes], [no])
if test "x$enable_html_doc" != xno; then
test "x$doxygen_ok" != xyes && enable_html_doc=no
test "x$latex_ok" != xyes && enable_html_doc=no
test "x$dvips_ok" != xyes && enable_html_doc=no
test "x$gs_ok" != xyes && enable_html_doc=no
AC_PATH_PROG([PERL], [perl], [])
fi
AM_CONDITIONAL([LATEX_OK], [test "x$latex_ok" = xyes])
AM_CONDITIONAL([PDFLATEX_OK], [test "x$pdflatex_ok" = xyes])
AM_CONDITIONAL([HTML_DOC], [test "x$enable_html_doc" = xyes])
AM_CONDITIONAL([DOXYGEN_OK], [test "x$doxygen_ok" = xyes])
DX_HTML_FEATURE(ON)
DX_CHM_FEATURE(OFF)
DX_CHI_FEATURE(OFF)
DX_MAN_FEATURE(OFF)
DX_RTF_FEATURE(OFF)
DX_XML_FEATURE(OFF)
DX_PDF_FEATURE(OFF)
DX_PS_FEATURE(OFF)
DX_INIT_DOXYGEN($PACKAGE_NAME, Doxyfile, doc/doxygen)
AX_CXX_DEF_TEMPLATE_ARG
CHECK_QUAD_PRECISION
# Check for math libs
AC_CHECK_LIB([m],[cos])
AC_CHECK_LIB([imf],[cos])
# Check for X11
AC_PATH_X
if test "$no_x" = yes; then
AC_MSG_WARN([Cannot find X Window System include files and libraries.
Please specify their location using --x-includes=dir and --x-libraries=dir])
else
if test "$x_includes" != ""; then
X_INCLUDES="-I$x_includes"
fi
if test "$x_libraries" != ""; then
X_LIBS="-L$x_libraries"
fi
X_LIBS="$X_LIBS -lX11"
AC_SUBST(X_INCLUDES)
AC_SUBST(X_LIBS)
fi
# Check for libstdc++, libdl
AC_CHECK_LIB(stdc++,main)
AC_CHECK_LIB(dl,dlopen)
# Check for OpenMP
AC_LANG_WERROR([on])
if $USE_OPENMP; then
AC_ARG_WITH(openmp_flag,
[AS_HELP_STRING([--with-openmp-flag="FLAGS"],
[FLAGS to enable OpenMP])],
[OPENMP_FLAG="-$withval"],
[OPENMP_FLAG=""])
# Check if OpenMP flag is already specified.
CHECK_OPENMP($OPENMP_FLAG)
# Check for all common OpenMP flags.
if test "$cv_openmp" = no; then
case "$ax_cv_cxx_compiler_vendor" in
gnu)
CHECK_OPENMP(-fopenmp)
;;
clang)
CHECK_OPENMP(-fopenmp)
;;
intel)
CHECK_OPENMP(-openmp)
CHECK_OPENMP(-qopenmp)
;;
pgi)
CHECK_OPENMP(-mp)
;;
msdosmsvc)
## FIXME is this the right flag for MSVC?
CHECK_OPENMP(-openmp)
;;
## Add other compilers supporting OpenMP here
esac
fi
# Error: OpenMP not available.
if test "$cv_openmp" = no; then
AC_MSG_ERROR([Don't know how to enable OpenMP.
Please specify the OpenMP flag using: --with-openmp-flag=<flag>.]);
fi
fi
AC_LANG_WERROR([off])
# Check for Intel Xeon Phi
#CHECK_INTEL_OFFLOAD
DISABLE_INTEL_OFFLOAD(-no-offload)
DISABLE_INTEL_OFFLOAD(-qno-offload)
# Check for FFTW
AC_CHECK_FFTW
AC_CHECK_FFTWF
#Check for BLAS LAPACK
#AM_CONDITIONAL(BLAS_EQ_MKL, test "$BLAS" = "MKL")
#AM_CONDITIONAL(BLAS_EQ_GSL, test "$BLAS" = "GSL")
#if (test -r $PETSC_DIR/$PETSC_ARCH/conf/petscvariables) ; then
# PETSC_BLASLAPACK_LIB=`grep "BLASLAPACK_LIB" $PETSC_DIR/$PETSC_ARCH/conf/petscvariables | sed -e 's/.*BLASLAPACK_LIB = //'`
# if test "x$PETSC_BLASLAPACK_LIB" != x ; then
# if test "x$with_blas" != "x" -a "$with_blas" != "$PETSC_BLASLAPACK_LIB" ; then
# AC_MSG_WARN([BLAS flags specified by --with-blas appear to disagree with PETSc BLAS/LAPACK flags; using PETSc settings])
# fi
# if test "x$with_lapack" != "x" -a "$with_lapack" != "$PETSC_BLASLAPACK_LIB" ; then
# AC_MSG_WARN([LAPACK flags specified by --with-lapack appear to disagree with PETSc BLAS/LAPACK flags; using PETSc settings])
# fi
# echo "using PETSc BLAS/LAPACK library flags: $PETSC_BLASLAPACK_LIB"
# with_blas="$PETSC_BLASLAPACK_LIB"
# with_lapack=""
# fi
# PETSC_BLASLAPACK_INCLUDE=`grep "BLASLAPACK_INCLUDE" $PETSC_DIR/$PETSC_ARCH/conf/petscvariables | sed -e 's/.*BLASLAPACK_INCLUDE = //'`
# if test "x$PETSC_BLASLAPACK_INCLUDE" != x ; then
# CPPFLAGS="${PETSC_BLASLAPACK_INCLUDE} $CPPFLAGS"
# fi
#fi
CFLAGS_save=$CFLAGS
CXXFLAGS_save=$CXXFLAGS
CFLAGS=""
CXXFLAGS=""
AX_BLAS(acx_blas_ok=yes, AC_MSG_ERROR([Cannot find BLAS library.
Please specify the location of the library using: --with-blas=LIB]))
AX_LAPACK(acx_lapack_ok=yes, AC_MSG_ERROR([Cannot find LAPACK library.
Please specify the location of the library using: --with-lapack=LIB]))
CFLAGS=$CFLAGS_save
CXXFLAGS=$CXXFLAGS_save
AC_SUBST(LAPACK_LIBS)
AC_SUBST(BLAS_LIBS)
AC_SUBST(FLIBS)
# Checks for header files.
AC_CHECK_HEADERS([stdint.h cstdlib cstddef])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_HEADER_STAT
AC_C_INLINE
AC_TYPE_INT32_T
AC_TYPE_UINT16_T
AC_TYPE_UINT8_T
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_MALLOC
AC_FUNC_STRTOD
AC_CHECK_FUNCS([floor memset pow sqrt strtol strtoul])
AX_CHECK_SVML
# Path for precomputed data files.
AC_ARG_WITH(precomp-dir,
[AS_HELP_STRING([--with-precomp-dir=DIR], [set directory for precomputed data files to DIR])],
[PRECOMP_DIR="$withval"; AX_NORMALIZE_PATH([PRECOMP_DIR], ["/"]) ])
AC_DEFINE_UNQUOTED(PRECOMP_DATA_PATH,"$PRECOMP_DIR",[Path for precomputed data files.])
#AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([Makefile
MakeVariables])
AC_OUTPUT
echo "
------------------------------------------------------------------------------
$PACKAGE-$VERSION library configuration:
------------------------------------------------------------------------------
External libs:
- BLAS ........... : ${acx_blas_ok}
- LAPACK ......... : ${acx_lapack_ok}
- FFTW ........... : ${acx_fftw_ok}
- CUDA ........... : ${ac_compile_nvcc}
Compiler/linker flags/libs/defs:
- MPICXX ......... : ${MPICXX}
- CXXFLAGS ....... : ${CXXFLAGS}
- LDFLAGS ........ : ${LDFLAGS}
- LIBS ........... : ${LIBS}
- BLAS ......... : ${BLAS_LIBS}
- LAPACK ....... : ${LAPACK_LIBS}
- FFTW ......... : ${FFTW_LIB} ${FFTWF_LIB}
- X11 .......... : ${X_LIBS}
Documentation tools:
- doxygen ........ : ${doxygen_ok}
- latex .......... : ${latex_ok}
- dvips .......... : ${dvips_ok}
- ghostscript .... : ${gs_ok}
"