-
Notifications
You must be signed in to change notification settings - Fork 20
/
configure.ac
228 lines (201 loc) · 8.89 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
# https://www.gnu.org/software/autoconf-archive/The-Macros.html#The-Macros
AC_INIT([exaFMM], [2.0])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_FILES([Makefile examples/Makefile wrappers/Makefile hss/Makefile])
AC_CONFIG_HEADER(config.h)
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([examples/fmm.cxx])
AM_INIT_AUTOMAKE([foreign subdir-objects -Wall -Werror])
AM_MAINTAINER_MODE
AC_LANG([C++])
${CXXFLAGS=""}
${FCFLAGS=""}
AC_PROG_CXX([xlC_r xlC FCCpx FCC sxc++ CC icpc g++])
AC_PROG_FC([xlf90_r xlf90 frtpx frt sxf90 ftn ifort gfortran])
AC_PROG_RANLIB
AM_PROG_AR
# OpenMP
AC_ARG_ENABLE(openmp, [AC_HELP_STRING([--enable-openmp],[use OpenMP])], enable_openmp=$enableval, enable_openmp=no)
if test "$enable_openmp" = "yes"; then
AC_DEFINE(EXAFMM_HAVE_OPENMP,1,[Use OpenMP])
AX_OPENMP([], [AC_MSG_ERROR([don't know how to enable OpenMP for C++])])
fi
AM_CONDITIONAL(EXAFMM_HAVE_OPENMP, test "$enable_openmp" = "yes")
# Intel TBB
AC_ARG_WITH(tbb, [AC_HELP_STRING([--with-tbb],[use Intel TBB])], with_tbb=$withval, with_tbb=no)
if test "$with_tbb" = "yes"; then
AC_DEFINE(EXAFMM_WITH_TBB,1,[Use Intel TBB])
fi
AM_CONDITIONAL(EXAFMM_WITH_TBB, test "$with_tbb" = "yes")
# MassiveThreads
AC_ARG_WITH(mthread, [AC_HELP_STRING([--with-mthread],[use MassiveThreads])], with_mthread=$withval, with_mthread=no)
if test "$with_mthread" = "yes"; then
AC_DEFINE(EXAFMM_WITH_MTHREAD,1,[Use MassiveThreads])
fi
AM_CONDITIONAL(EXAFMM_WITH_MTHREAD, test "$with_mthread" = "yes")
# Strumpack
AC_ARG_WITH(strumpack, [AC_HELP_STRING([--with-strumpack],[use Strumpack])], with_strumpack=$withval, with_strumpack=no)
if test "$with_strumpack" = "yes"; then
AC_DEFINE(EXAFMM_WITH_STRUMPACK,1,[Use Strumpack])
fi
AM_CONDITIONAL(EXAFMM_WITH_STRUMPACK, test "$with_strumpack" = "yes")
# Single precision
AC_ARG_ENABLE(single, [AC_HELP_STRING([--enable-single],[compile exaFMM in single precision])], ok=$enableval, ok=no)
AC_ARG_ENABLE(float, [AC_HELP_STRING([--enable-float],[synonym for --enable-single])], ok=$enableval)
if test "$ok" = "yes"; then
AC_DEFINE(EXAFMM_SINGLE,1,[Define to compile in single precision.])
PRECISION=s
else
PRECISION=d
fi
AM_CONDITIONAL(EXAFMM_SINGLE, test "$ok" = "yes")
AC_SUBST(PRECISION)
# MPI
AC_ARG_ENABLE(mpi, [AC_HELP_STRING([--enable-mpi],[compile exaFMM MPI library])], enable_mpi=$enableval, enable_mpi=no)
if test "$enable_mpi" = "yes"; then
AX_MPI([],[AC_MSG_ERROR([could not find mpi library for --enable-mpi])])
AC_CHECK_PROG(MPIRUN, mpirun, mpirun)
AC_SUBST(MPIRUN)
CXX=$MPICXX
fi
AM_CONDITIONAL(EXAFMM_HAVE_MPI, test "$enable_mpi" = "yes")
# SSE3 (always defined)
AC_DEFINE(EXAFMM_HAVE_SSE3,1,[Define to enable SSE/SSE3 optimizations.])
if test "$PRECISION" != "d" -a "$PRECISION" != "s"; then
AC_MSG_ERROR([SSE3 requires single or double precision])
fi
SSE3_CXXFLAGS=-msse3
AC_SUBST(SSE3_CXXFLAGS)
# AVX
AC_ARG_ENABLE(avx, [AC_HELP_STRING([--enable-avx],[enable AVX optimizations])], have_avx=$enableval, have_avx=no)
if test "$have_avx" = "yes"; then
AC_DEFINE(EXAFMM_HAVE_AVX,1,[Define to enable AVX optimizations.])
if test "$PRECISION" != "d" -a "$PRECISION" != "s"; then
AC_MSG_ERROR([AVX requires single or double precision])
fi
AVX_CXXFLAGS=-mavx
fi
AM_CONDITIONAL(EXAFMM_HAVE_AVX, test "$have_avx" = "yes")
AC_SUBST(AVX_CXXFLAGS)
# AVX2
AC_ARG_ENABLE(avx2, [AC_HELP_STRING([--enable-avx2],[enable AVX2 optimizations])], have_avx2=$enableval, have_avx2=no)
if test "$have_avx2" = "yes"; then
AC_DEFINE(EXAFMM_HAVE_AVX2,1,[Define to enable AVX2 optimizations.])
if test "$PRECISION" != "d" -a "$PRECISION" != "s"; then
AC_MSG_ERROR([AVX2 requires single or double precision])
fi
AVX2_CXXFLAGS=-mavx2
fi
AM_CONDITIONAL(EXAFMM_HAVE_AVX2, test "$have_avx2" = "yes")
AC_SUBST(AVX2_CXXFLAGS)
# MIC
AC_ARG_ENABLE(mic, [AC_HELP_STRING([--enable-mic],[enable MIC optimizations])], have_mic=$enableval, have_mic=no)
if test "$have_mic" = "yes"; then
AC_DEFINE(EXAFMM_HAVE_MIC,1,[Define to enable MIC optimizations.])
if test "$PRECISION" != "d" -a "$PRECISION" != "s"; then
AC_MSG_ERROR([MIC requires single or double precision])
fi
MIC_CXXFLAGS=-mmic
fi
AM_CONDITIONAL(EXAFMM_HAVE_MIC, test "$have_mic" = "yes")
AC_SUBST(MIC_CXXFLAGS)
# AVX512
AC_ARG_ENABLE(avx512, [AC_HELP_STRING([--enable-avx512],[enable AVX512 optimizations])], have_avx512=$enableval, have_avx512=no)
if test "$have_avx512" = "yes"; then
AC_DEFINE(EXAFMM_HAVE_AVX512,1,[Define to enable AVX512 optimizations.])
if test "$PRECISION" != "d" -a "$PRECISION" != "s"; then
AC_MSG_ERROR([AVX512 requires single or double precision])
fi
AVX512_CXXFLAGS=-xMIC-AVX512
fi
AM_CONDITIONAL(EXAFMM_HAVE_AVX512, test "$have_avx512" = "yes")
AC_SUBST(AVX512_CXXFLAGS)
# Neon
AC_ARG_ENABLE(neon, [AC_HELP_STRING([--enable-neon],[enable ARM NEON optimizations])], have_neon=$enableval, have_n\
eon=no)
if test "$have_neon" = "yes"; then
AC_DEFINE(EXAFMM_HAVE_NEON,1,[Define to enable ARM NEON optimizations.])
if test "$PRECISION" != "s"; then
AC_MSG_ERROR([NEON requires single precision])
fi
NEON_CXXFLAGS=-mneon
fi
AM_CONDITIONAL(EXAFMM_HAVE_NEON, test "$have_neon" = "yes")
AC_SUBST(NEON_CXXFLAGS)
# Disable SIMD
AC_ARG_ENABLE(simd, [AC_HELP_STRING([--disable-simd],[disable SIMD optimizations])], use_simd=$enableval, use_simd=yes)
if test "$use_simd" = "no"; then
AC_DEFINE(EXAFMM_USE_SIMD,0,[Disable SIMD optimizations.])
fi
AM_CONDITIONAL(EXAFMM_USE_SIMD, test "$use_simd" = "yes")
# Weights for partitioning
AC_ARG_ENABLE(weight, [AC_HELP_STRING([--enable-weight],[enable weight for partitioning])], use_weight=$enableval, use_weight=no)
if test "$use_weight" = "yes"; then
AC_DEFINE(EXAFMM_USE_WEIGHT,1,[Enable weight for partitioning.])
fi
AM_CONDITIONAL(EXAFMM_USE_WEIGHT, test "$use_weight" = "yes")
# Kahan summation
AC_ARG_ENABLE(kahan, [AC_HELP_STRING([--enable-kahan],[enable Kahan summation])], use_kahan=$enableval, use_kahan=no)
if test "$use_kahan" = "yes"; then
AC_DEFINE(EXAFMM_USE_KAHAN,1,[Enable Kahan summation.])
fi
AM_CONDITIONAL(EXAFMM_USE_KAHAN, test "$use_kahan" = "yes")
# PAPI
AC_ARG_ENABLE(papi, [AC_HELP_STRING([--enable-papi],[enable PAPI performance counter])], use_papi=$enableval, use_papi=no)
if test "$use_papi" = "yes"; then
AC_DEFINE(EXAFMM_USE_PAPI,1,[Enable PAPI performance counter.])
fi
AM_CONDITIONAL(EXAFMM_USE_PAPI, test "$use_papi" = "yes")
# Trace
AC_ARG_ENABLE(trace, [AC_HELP_STRING([--enable-trace],[enable thread tracing])], use_trace=$enableval, use_trace=no)
if test "$use_trace" = "yes"; then
AC_DEFINE(EXAFMM_USE_TRACE,1,[Enable thread tracing.])
fi
AM_CONDITIONAL(EXAFMM_USE_TRACE, test "$use_trace" = "yes")
# DAG recorder
AC_ARG_ENABLE(dag, [AC_HELP_STRING([--enable-dag],[enable DAG recorder])], use_dag=$enableval, use_dag=no)
if test "$use_dag" = "yes"; then
AC_DEFINE(EXAFMM_USE_DAG,1,[Enable DAG recorder.])
fi
AM_CONDITIONAL(EXAFMM_USE_DAG, test "$use_dag" = "yes")
# Count number of M2L and P2P kernel calls
AC_ARG_ENABLE(count-kernel, [AC_HELP_STRING([--enable-count-kernel],[count number of M2L and P2P kernel calls])], use_count_kernel=$enableval, use_count_kernel=no)
if test "$use_count_kernel" = "yes"; then
AC_DEFINE(EXAFMM_COUNT_KERNEL,1,[Count number of M2L and P2P kernel calls.])
fi
AM_CONDITIONAL(EXAFMM_COUNT_KERNEL, test "$use_count_kernel" = "yes")
# Count interaction list
AC_ARG_ENABLE(count-list, [AC_HELP_STRING([--enable-count-list],[count interaction list per cell])], use_count_list=$enableval, use_count_list=no)
if test "$use_count_list" = "yes"; then
AC_DEFINE(EXAFMM_COUNT_LIST,1,[Count interaction list per cell.])
fi
AM_CONDITIONAL(EXAFMM_COUNT_LIST, test "$use_count_list" = "yes")
# Assertion
AC_ARG_ENABLE(assert, [AC_HELP_STRING([--enable-assert],[enable assertion])], use_assert=$enableval, use_assert=no)
if test "$use_assert" = "yes"; then
AC_DEFINE(EXAFMM_ASSERT,1,[Enable assertion.])
fi
AM_CONDITIONAL(EXAFMM_ASSERT, test "$use_assert" = "yes")
# Debug
AC_ARG_ENABLE(debug, [AC_HELP_STRING([--enable-debug],[compile with extra runtime checks for debugging])], enable_debug=$enableval, enable_debug=no)
if test "$enable_debug" = "yes"; then
AC_DEFINE(EXAFMM_DEBUG,1,[Define to enable extra debugging options.])
fi
AM_CONDITIONAL(EXAFMM_DEBUG, test "$enable_debug" = "yes")
AX_COMPILER_VENDOR()
AX_COMPILER_FLAGS()
AC_LANG_PUSH([Fortran])
AX_COMPILER_FLAGS()
AC_LANG_POP([Fortran])
AC_MSG_NOTICE([Vendor : $ax_cv_cxx_compiler_vendor])
AC_MSG_NOTICE([CXX : $CXX])
AC_MSG_NOTICE([CXXFLAGS : $COMPILER_CXXFLAGS])
AC_MSG_NOTICE([FC : $FC])
AC_MSG_NOTICE([FCFLAGS : $COMPILER_FCFLAGS])
AM_CONDITIONAL(EXAFMM_HAVE_BG, test "$ax_cv_cxx_compiler_vendor" = "ibm")
AM_CONDITIONAL(EXAFMM_HAVE_FX, test "$ax_cv_cxx_compiler_vendor" = "fujitsu")
AM_CONDITIONAL(EXAFMM_HAVE_CRAY, test "$CXX" = "CC")
AM_CONDITIONAL(EXAFMM_HAVE_INTEL, test "$ax_cv_cxx_compiler_vendor" = "intel")
AM_CONDITIONAL(EXAFMM_HAVE_CLANG, test "$ax_cv_cxx_compiler_vendor" = "clang")
AM_CONDITIONAL(EXAFMM_HAVE_GNU, test "$ax_cv_cxx_compiler_vendor" = "gnu")
AC_OUTPUT