forked from ExtremeFLOW/neko
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
212 lines (182 loc) · 5.29 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
AC_INIT([neko],[0.3.99])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AM_MAINTAINER_MODE
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST
AC_LANG(Fortran)
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_ARG_ENABLE(contrib,
AC_HELP_STRING([--enable-contrib],
[Compile various tools]),
[enable_contrib=${enableval}], [enable_contrib=yes])
AC_ARG_ENABLE(real,
AC_HELP_STRING([--enable-real=Xp Specify working precision of REAL types:
sp -- REAL(kind=4)
dp -- REAL(kind=8) (default)
qp -- REAL(kind=16)]),
[enable_real=${enableval}], [enable_real=dp])
AC_ARG_ENABLE(blk_size,
AC_HELP_STRING([--enable-blk_size=number of values Specify size of fast memory]),
[blk_size=${enableval}], [blk_size="10000"])
# Test for a sane fortran environment (^-^)
AC_LANG(Fortran)
AC_PROG_FC(,90)
AX_COARRAY
AX_DTYPE_IO
# Test for a working MPI compiler
AX_MPI([have_mpi=yes], [have_mpi=no])
if test "x${have_mpi}" != xno; then
FC="$MPIFC"
LIBS="$MPILIBS $LIBS"
AC_LANG(C)
AX_MPI([have_mpi=yes],[have_mpi=no])
if test "x${have_mpi}" != xno; then
CC="$MPICC"
else
AC_MSG_ERROR([Can't find a suitable C MPI compiler])
fi
AC_LANG(Fortran)
else
AC_MSG_ERROR([Can't find a suitable MPI compiler])
fi
AX_MPIF08
AX_MPI_DTYPE
AC_FC_PP_SRCEXT([F90])
AX_COMPILER_VENDOR
# Store build information (date, host, FC)
AC_SUBST(NEKO_BUILD_INFO,
["(build: $(date +%Y-%m-%d) on $host using $ax_cv_fc_compiler_vendor)"], [])
# Checks for Doxygen
AC_CHECK_PROGS([DOXYGEN], [doxygen])
if test -n "$DOXYGEN"; then
AC_CHECK_PROGS([DOXYGEN_DEPS], [dot])
fi
AM_CONDITIONAL([ENABLE_DOXYGEN], [test -n "$DOXYGEN_DEPS"])
# Checks for makedepf90
AC_CHECK_PROGS([MAKEDEPF90], [makedepf90])
AM_CONDITIONAL([ENABLE_MAKEDEPF90], [test -n "$MAKEDEPF90"])
# Checks for flinter
AC_CHECK_PROGS([FLINT], [flint])
AM_CONDITIONAL([ENABLE_FLINT], [test -n "$FLINT"])
# Checks for various platforms
AX_CRAY
AX_HPE_CRAY
AX_SX
# Checks for pFUnit
AX_PFUNIT
# Check for blas and lapack
AS_IF([test "x${is_cray}" = xyes || test "x${is_hpe_cray}" = xyes],
AX_CRAY_LIBSCI
if test "x${have_cray_libsci}" = xyes; then
have_blas_lapack="yes"
else
have_blas_lapack="no"
fi, have_blas_lapack="no")
if test "x${have_blas_lapack}" != xyes; then
AX_LAPACK
if test "x${ax_lapack_ok}" != xno; then
LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS"
have_blas_lapack=yes
else
have_blas_lapack=no
fi
fi
if test "x${have_blas_lapack}" != xyes; then
AC_MSG_ERROR([Can't find a suitable BLAS/LAPACK library])
fi
found_domain_decomp="no"
# Checks for ParMetis
if test "x${is_cray}" = xyes; then
AX_CRAY_PARMETIS
if test "x${have_cray_parmetis}" = xyes; then
found_domain_decomp="yes"
fi
fi
if test "x${found_domain_decomp}" != xyes; then
AX_PARMETIS
if test "${PARMETIS_LIBS}"; then
LIBS="$PARMETIS_LIBS $LIBS"
found_domain_decomp="yes"
fi
fi
# Select Working precision of REAL
if test "x$enable_real" = xsp; then
AC_SUBST(NEKO_REAL_TYPE, "sp")
AC_SUBST(NEKO_C_REAL_TYPE, "c_float")
AC_SUBST(NEKO_MPI_REAL_TYPE, "MPI_REAL")
AC_SUBST(NEKO_DEV_REAL_TYPE, "float")
elif test "x$enable_real" = xdp; then
AC_SUBST(NEKO_REAL_TYPE, "dp")
AC_SUBST(NEKO_C_REAL_TYPE, "c_double")
AC_SUBST(NEKO_MPI_REAL_TYPE, "MPI_DOUBLE_PRECISION")
AC_SUBST(NEKO_DEV_REAL_TYPE, "double")
elif test "x$enable_real" = xqp; then
AC_SUBST(NEKO_REAL_TYPE, "qp")
AC_SUBST(NEKO_C_REAL_TYPE, "c_long_double")
AC_SUBST(NEKO_MPI_REAL_TYPE, "MPI_REAL16")
AC_SUBST(NEKO_DEV_REAL_TYPE, "long double")
else
AC_MSG_ERROR([Invalid working precision])
fi
AC_SUBST(blk_size, ${blk_size})
# Checks for libxsmm backend
AX_LIBXSMM
# Checks for HIP backend
AX_HIP
# Checks for CUDA backend
if test "x${is_cray}" = xyes; then
AX_CRAY_CUDATOOLKIT
else
AX_CUDA
fi
# Checks for OpenCL backend
AX_OPENCL
AM_CONDITIONAL([ENABLE_PARMETIS], [test "x$found_domain_decomp" = xyes])
AM_CONDITIONAL([ENABLE_CUDA], [test "x${have_cuda}" = xyes])
AM_CONDITIONAL([ENABLE_HIP], [test "x${have_hip}" = xyes])
AM_CONDITIONAL([ENABLE_OPENCL], [test "x${have_opencl}" = xyes])
AC_CONFIG_FILES([Makefile\
src/Makefile\
tests/Makefile\
src/comm/comm.F90\
src/config/neko_config.f90\
src/config/num_types.f90\
src/device/device_config.h\
src/scripts/cltostring.sh\
makeneko\
neko.pc])
# Config tests
AC_CONFIG_FILES([tests/stack/Makefile\
tests/tuple/Makefile\
tests/point/Makefile\
tests/htable/Makefile\
tests/uset/Makefile\
tests/quad/Makefile\
tests/hex/Makefile\
tests/tet/Makefile\
tests/tri/Makefile\
tests/math/Makefile\
tests/mesh/Makefile\
tests/space/Makefile\
tests/dofmap/Makefile\
tests/field/Makefile\
tests/mean_field/Makefile\
tests/mean_sqr_field/Makefile\
tests/gather_scatter/Makefile\
tests/krylov/Makefile\
tests/bc/Makefile\
tests/signal/Makefile\
tests/jobctrl/Makefile\
tests/device/Makefile\
tests/device_math/Makefile\
tests/mathops/Makefile\
tests/device_mathops/Makefile])
if test "x${enable_contrib}" = xyes; then
AC_CONFIG_FILES([contrib/Makefile\
contrib/rea2nbin/Makefile\
contrib/prepart/Makefile])
fi
# Doxygen
AC_CONFIG_FILES([doc/Doxyfile doc/Makefile])
AC_OUTPUT