-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
311 lines (266 loc) · 16.9 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
dnl
dnl This file is part of the Score-P software (http://www.score-p.org)
dnl
dnl Copyright (c) 2009-2013,
dnl RWTH Aachen University, Germany
dnl
dnl Copyright (c) 2009-2013,
dnl Gesellschaft fuer numerische Simulation mbH Braunschweig, Germany
dnl
dnl Copyright (c) 2009-2014, 2017, 2019, 2021,
dnl Technische Universitaet Dresden, Germany
dnl
dnl Copyright (c) 2009-2013,
dnl University of Oregon, Eugene, USA
dnl
dnl Copyright (c) 2009-2019, 2021-2023,
dnl Forschungszentrum Juelich GmbH, Germany
dnl
dnl Copyright (c) 2009-2014,
dnl German Research School for Simulation Sciences GmbH, Juelich/Aachen, Germany
dnl
dnl Copyright (c) 2009-2013,
dnl Technische Universitaet Muenchen, Germany
dnl
dnl This software may be modified and distributed under the terms of
dnl a BSD-style license. See the COPYING file in the package base
dnl directory for details.
dnl
AC_PREREQ([2.69])
AC_INIT([Score-P], m4_esyscmd([build-config/common/generate-package-version.sh build-config/VERSION]), [support@score-p.org], [scorep])
AFS_PACKAGE_INIT
AFS_SUMMARY_INIT
AC_SCOREP_REVISION
SCOREP_TOPLEVEL_ARGS
## Packages that do manual configuration or use the install program might need
## to tell configure where to find some other shell scripts by calling
## AC_CONFIG_AUX_DIR, though the default places it looks are correct for most
## cases.
## Need to be called early on configure.ac because other macros search tools
## in this directory.
AC_CONFIG_AUX_DIR([build-config])
## See also ACLOCAL_AMFLAGS in Makefile.am.
AC_CONFIG_MACRO_DIRS([build-config/m4 build-config/common/m4])
## Set the default installation prefix to /opt/scorep instead of /usr/local
AC_PREFIX_DEFAULT([/opt/scorep])
AC_SCOREP_GIT_CONTROLLED
## Call not before AC_CONFIG_MACRO_DIR
AM_INIT_AUTOMAKE([foreign color-tests 1.13.4 -Wall tar-pax])
AM_SILENT_RULES([yes])
AFS_MAINTAINER_MODE
AC_SCOREP_DETECT_PLATFORMS
AFS_CROSSCOMPILING
AFS_SCOREP_MACHINE_NAME
AFS_SCOREP_PLATFORM_NAME
AC_SCOREP_PLATFORM_SETTINGS
# quote $afs_scorep_platform_name and $afs_scorep_default_machine_name for use as arguments to sub-configures
afs_scorep_default_machine_name_sq=$afs_scorep_default_machine_name
case $afs_scorep_default_machine_name_sq in
*\'*) afs_scorep_default_machine_name_sq="`AS_ECHO(["$afs_scorep_default_machine_name_sq"]) | sed "s/'/'\\\\\\\\''/g"`" ;;
esac
afs_scorep_platform_name_sq=$afs_scorep_platform_name
case $afs_scorep_platform_name_sq in
*\'*) afs_scorep_platform_name_sq="`AS_ECHO(["$afs_scorep_platform_name_sq"]) | sed "s/'/'\\\\\\\\''/g"`" ;;
esac
AC_ARG_ENABLE([experimental-platform],
[AS_HELP_STRING([--enable-experimental-platform],
[Enables builds on platforms that are not officially supported (currently macOS and MinGW).])],
[scorep_enable_experimental_platform=$enableval],
[scorep_enable_experimental_platform=no])
# don't detect and load defaults in nested configures (e.g. otf2)
AS_IF([test "x$ac_scorep_platform_data_provided" = "x" || \
test "${ac_scorep_platform_data_provided}" = "no"],
[AFS_CUSTOM_COMPILERS
AS_IF([test "x${afs_custom_compilers_given}" = "xno"],
[dnl AFS_COMPILER_BACKEND([CC, CXX, F77, FC])
AC_SCOREP_WITH_COMPILER_SUITE
AS_CASE([${ac_scorep_platform},${scorep_enable_experimental_platform}],
[*,yes],
[AC_MSG_WARN([Attempting an experimental build for platform '${afs_scorep_platform_name}'. Feel free to report bugs or issues to <AC_PACKAGE_BUGREPORT>, but note that this is not a supported platform yet. Namaste.])],
[mac,no|mingw,no],
[AC_MSG_ERROR([Platform '${afs_scorep_platform_name}' is not officially supported by ]AC_PACKAGE_NAME[. You can specify "--enable-experimental-platform" to enable an experimental build and report success to <AC_PACKAGE_BUGREPORT>. Thanks.])],
[unknown],
[AC_MSG_ERROR([Cannot detect platform to set suitable defaults. Please use --with-custom-compilers and provide settings and platform to <AC_PACKAGE_BUGREPORT> on success. Thanks.])
])
AC_SCOREP_WITH_MPI_COMPILER_SUITE
AFS_WITH_SHMEM_COMPILER_SUITE
],
[afs_compiler_mpi_save=${ac_scorep_compilers_mpi}
AC_SCOREP_WITH_MPI_COMPILER_SUITE
AS_IF([test "x${scorep_mpi_user_disabled}" = xno],
[ac_scorep_compilers_mpi=${afs_compiler_mpi_save}])
afs_compiler_shmem_save=${ac_scorep_compilers_shmem}
AFS_WITH_SHMEM_COMPILER_SUITE
AS_IF([test "x${scorep_shmem_user_disabled}" = xno],
[ac_scorep_compilers_shmem=${afs_compiler_shmem_save}])
])
# temporary workaround: prevent using libunwind together with
# Intel MPI as application results may show erroneous behavior.
# bt-mz's verification fails for some configurations, cp2k does
# not converge. Reason so far unclear but problem vanishes when
# not linking with libunwind.
AC_REQUIRE([AC_PROG_GREP])
AC_REQUIRE([AC_PROG_SED])
AS_CASE([${ac_scorep_compilers_mpi}],
[*intel|*intel[[23]]],
[GREP_OPTIONS= ${GREP} '^--with-libunwind' user_provided_configure_args > /dev/null
AS_IF([test $? -eq 0],
[# Remove any given --with-libunwind option
${SED} '/^--with-libunwind/d' user_provided_configure_args > user_provided_configure_args.nounw
mv user_provided_configure_args.nounw user_provided_configure_args])
echo "--without-libunwind" >> user_provided_configure_args
AFS_SUMMARY([Unwinding/Sampling support], [Disabled when used with Intel MPI as this combination shows erroneous behavior])])
# end of workaround
AS_IF([test -f ${ac_scorep_compilers_shmem}],
[# determine arguments for subdir configures with handling SHMEM compiler
args="`${AWK} -f ${srcdir}/build-config/common/process_arguments.awk \
${ac_scorep_compilers_mpi} \
${ac_scorep_compilers_shmem} \
${ac_scorep_compilers_frontend} \
${ac_scorep_compilers_backend} \
user_provided_configure_args`"],
[# determine arguments for subdir configures without handling SHMEM compiler
args="`${AWK} -f ${srcdir}/build-config/common/process_arguments.awk \
${ac_scorep_compilers_mpi} \
${ac_scorep_compilers_frontend} \
${ac_scorep_compilers_backend} \
user_provided_configure_args`"])
AS_IF([test $? -ne 0], [AC_MSG_ERROR([cannot process provided and/or autodetected arguments. Please contact <AC_PACKAGE_BUGREPORT> and provide the above output. Thanks.])])
],
[AC_MSG_NOTICE([platform data provided by toplevel configure.])
# determine arguments for subdir configures
args="`${AWK} -f $srcdir/build-config/common/process_arguments.awk \
user_provided_configure_args`"
AS_IF([test $? -ne 0], [AC_MSG_ERROR([cannot process provided arguments. Please contact <AC_PACKAGE_BUGREPORT> and provide the above output. Thanks.])])
])
AC_SCOREP_UNCRUSTIFY
AC_SCOREP_DOXYGEN
AS_IF([test "x${ac_scorep_git_controlled}" = xyes],
[AC_CONFIG_FILES([doc/doxygen-user.cfg:doc/doxygen-user/doxygen-user.cfg.in])
AC_CONFIG_FILES([doc/doxygen-dev.cfg:doc/doxygen-dev/doxygen-dev.cfg.in])])
AFS_DEBUG_OPTION
# Assume that all lockfile-progs are available if lockfile-create is.
AC_CHECK_PROG([ac_scorep_have_lockfile_progs], [lockfile-create], [yes], [no])
AM_CONDITIONAL([HAVE_LOCKFILE_PROGS],
[test "x${ac_scorep_have_lockfile_progs}" = "xyes"])
## Autoconf supports changing the names of programs when installing them. In
## order to use these transformations, configure.ac must call the macro
## AC_ARG_PROGRAM.
# implicitly called by ?
#AC_ARG_PROGRAM
# used for EXTRA_DIST in Makefile.am
AM_CONDITIONAL([CROSS_BUILD], [test "x${ac_scorep_cross_compiling}" = "xyes"])
AC_SCOREP_HAVE_CONFIG_TOOL([otf2], [10], [0])
AS_IF([test -n "${scorep_otf2_config_bin}" && \
test "x${ac_scorep_platform}" = "xmic"],
[scorep_otf2_have_mic=no
for target in `${scorep_otf2_config_bin} --features=targets`
do
AS_CASE([${target}],
[mic], [scorep_otf2_have_mic=yes])
done
AS_IF([test "x${scorep_otf2_have_mic}" = "xno"],
[AC_MSG_ERROR([cannot detect MIC support for external OTF2 installation. Either provide a suitable OTF2 library or reconfigure ]AC_PACKAGE_NAME[ with the '--without-otf2' option to use the included OTF2 copy.])])
])
AC_SCOREP_HAVE_CONFIG_TOOL([opari2], [3], [0])
AC_SCOREP_HAVE_CONFIG_TOOL([cubew], [12], [2])
AS_IF([test -n "${scorep_cubew_config_bin}" && \
test "x${ac_scorep_platform}" = "xmic"],
[scorep_cubew_have_mic=no
for target in `${scorep_cubew_config_bin} --features=targets`
do
AS_CASE([${target}],
[mic], [scorep_cubew_have_mic=yes])
done
AS_IF([test "x${scorep_cubew_have_mic}" = "xno"],
[AC_MSG_ERROR([cannot detect MIC support for external Cube Writer installation. Either provide a suitable Cube library or reconfigure ]AC_PACKAGE_NAME[ with the '--without-cubew' option to use the included Cube Writer copy.])])
])
AC_SCOREP_HAVE_CONFIG_TOOL([cubelib], [12], [2])
# handle external package's subdir configures
PROHIBIT_MAKE_DIST=
user_args="`${AWK} -f ${srcdir}/build-config/common/process_arguments.awk user_provided_configure_args`"
AS_IF([test "x${scorep_have_cubew_config}" = "xyes"],
[AS_VAR_APPEND([PROHIBIT_MAKE_DIST], [" --without-cubew"])],
[test -x ${srcdir}/vendor/cubew/configure],
[AX_CONFIG_SUBDIR([vendor/cubew], [${user_args} afs_externally_triggered=yes ac_scorep_doxygen_distdir=${ac_scorep_doxygen_distdir}/vendor/cubew])],
[AC_MSG_ERROR([No CubeW component available. Either provide the internal package at '${srcdir}/vendor/cubew' or an external installation with '--with-cubew'.])])
AS_IF([test "x${scorep_have_cubelib_config}" = "xyes"],
[AS_VAR_APPEND([PROHIBIT_MAKE_DIST], [" --without-cubelib"])],
[test -x ${srcdir}/vendor/cubelib/configure],
[AX_CONFIG_SUBDIR([vendor/cubelib], [${user_args} afs_externally_triggered=yes ac_scorep_doxygen_distdir=${ac_scorep_doxygen_distdir}/vendor/cubelib])],
[AC_MSG_ERROR([No CubeLib component available. Either provide the internal package at '${srcdir}/vendor/cubelib' or an external installation with '--with-cubelib'.])])
AS_IF([test "x${scorep_have_opari2_config}" = "xyes"],
[AS_VAR_APPEND([PROHIBIT_MAKE_DIST], [" --without-opari2"])],
[test -x ${srcdir}/vendor/opari2/configure],
[AX_CONFIG_SUBDIR([vendor/opari2], [${args} ac_scorep_platform=${ac_scorep_platform} ac_scorep_platform_data_provided=yes ac_scorep_cross_compiling=${ac_scorep_cross_compiling} ac_scorep_doxygen_distdir=${ac_scorep_doxygen_distdir}/vendor/opari2])],
[AC_MSG_ERROR([No OPARI2 component available. Either provide the internal package at '${srcdir}/vendor/opari2' or an external installation with '--with-opari2'.])])
AS_IF([test "x${scorep_have_otf2_config}" = "xyes"],
[AS_VAR_APPEND([PROHIBIT_MAKE_DIST], [" --without-otf2"])],
[test -x ${srcdir}/vendor/otf2/configure],
[AX_CONFIG_SUBDIR([vendor/otf2], [${args} ac_scorep_platform=${ac_scorep_platform} ac_scorep_platform_data_provided=yes ac_scorep_cross_compiling=${ac_scorep_cross_compiling} ac_scorep_doxygen_distdir=${ac_scorep_doxygen_distdir}/vendor/otf2])],
[AC_MSG_ERROR([No OTF2 component available. Either provide the internal package at '${srcdir}/vendor/otf2' or an external installation with '--with-otf2'.])])
# handle own package's subdir configures
# Always build scorep-score as frontend tool. scorep-score uses cube
# libraries and compiler information, either from internal or external
# cube. Don't pass the usual ${args}; the compiler might get changed
# and then potentially chokes on FLAGS (see r5771, #849). But users
# expect that shared/static and --bindir and --libdir are passed, if
# given.
# We detect if --bin/libdir was given by comparing against the default
# values.
AC_PROG_EGREP
scorep_score_extra_arg="$(GREP_OPTIONS= ${EGREP} -e 'able-shared' -e 'able-static' user_provided_configure_args | tr "\n" " ")"
AS_IF([test "x${bindir}" != 'x${exec_prefix}/bin'],
[adl_RECURSIVE_EVAL([${bindir}], [BINDIR_EVALUATED])
scorep_score_extra_arg="--bindir=${BINDIR_EVALUATED} ${scorep_score_extra_arg}"])
AS_IF([test "x${libdir}" != 'x${exec_prefix}/lib'],
[adl_RECURSIVE_EVAL([${libdir}], [LIBDIR_EVALUATED])
scorep_score_extra_arg="--libdir=${LIBDIR_EVALUATED} ${scorep_score_extra_arg}"])
AX_CONFIG_SUBDIR([build-score], [${scorep_score_extra_arg} ac_scorep_platform=${ac_scorep_platform} ${scorep_cubelib_config_arg} ${scorep_otf2_config_arg} afs_cross_compiling=${ac_scorep_cross_compiling}])
AX_CONFIG_SUBDIR([build-gcc-plugin], [${args} ac_scorep_platform=${ac_scorep_platform} ac_scorep_cross_compiling=${ac_scorep_cross_compiling}])
AX_CONFIG_SUBDIR([build-llvm-plugin], [${args} ac_scorep_platform=${ac_scorep_platform} ac_scorep_cross_compiling=${ac_scorep_cross_compiling}])
# The XRay plugin must be configured after the llvm plugin as it checks for files created by llvm plugin
AX_CONFIG_SUBDIR([build-xray-plugin], [${args} ac_scorep_platform=${ac_scorep_platform} ac_scorep_cross_compiling=${ac_scorep_cross_compiling}])
AX_CONFIG_SUBDIR([build-libwrap], [${args} ac_scorep_platform=${ac_scorep_platform} afs_cross_compiling=${ac_scorep_cross_compiling}])
AM_CONDITIONAL([HAVE_SCOREP_MPI], [test "x${scorep_mpi_user_disabled}" != "xyes"])
AS_IF([test "x${scorep_mpi_user_disabled}" != "xyes"],
[AX_CONFIG_SUBDIR([build-mpi], [${args} ${backend_args} ac_scorep_platform=${ac_scorep_platform} ac_scorep_cross_compiling=${ac_scorep_cross_compiling} afs_scorep_platform_name='${afs_scorep_platform_name_sq}' afs_scorep_default_machine_name='${afs_scorep_default_machine_name_sq}' ${scorep_otf2_config_arg} ${scorep_opari2_config_arg}])
],
[AFS_SUMMARY([MPI support], [no, explicitly disabled via --without-mpi])
AC_CONFIG_FILES([src/scorep_config_tool_mpi.h:src/tools/config/scorep_config_tool_without_mpi.h.in])
AS_VAR_APPEND([PROHIBIT_MAKE_DIST], [" --with-mpi"])
])
AM_CONDITIONAL([HAVE_SCOREP_SHMEM],
[test "x${scorep_shmem_user_disabled}" != "xyes" && \
( test "x${ac_scorep_platform}" = "xlinux" || \
test -f "${srcdir}/build-config/common/platforms/platform-shmem-${ac_scorep_platform}" )])
AM_COND_IF([HAVE_SCOREP_SHMEM],
[AX_CONFIG_SUBDIR([build-shmem], [${args} ${backend_args} ac_scorep_platform=${ac_scorep_platform} ac_scorep_cross_compiling=${ac_scorep_cross_compiling} afs_scorep_platform_name='${afs_scorep_platform_name_sq}' afs_scorep_default_machine_name='${afs_scorep_default_machine_name_sq}' ${scorep_otf2_config_arg} ${scorep_opari2_config_arg}])
],
[AS_IF([test "x${scorep_shmem_user_disabled}" = "xyes"],
[AFS_SUMMARY([SHMEM support], [no, explicitly disabled via --without-shmem])],
[AFS_SUMMARY([SHMEM support], [no, platform not supported])])
AC_CONFIG_FILES([src/scorep_config_tool_shmem.h:src/tools/config/scorep_config_tool_without_shmem.h.in])
AS_VAR_APPEND([PROHIBIT_MAKE_DIST], [" --with-shmem"])
])
AC_SUBST([PROHIBIT_MAKE_DIST])
AX_CONFIG_SUBDIR([build-backend], [${args} ${backend_args} ac_scorep_platform=${ac_scorep_platform} ac_scorep_cross_compiling=${ac_scorep_cross_compiling} afs_scorep_platform_name='${afs_scorep_platform_name_sq}' afs_scorep_default_machine_name='${afs_scorep_default_machine_name_sq}' ${scorep_otf2_config_arg} ${scorep_opari2_config_arg} ${scorep_cubew_config_arg} ${scorep_cubelib_config_arg}])
if test "x${ac_scorep_cross_compiling}" = "xyes"; then
AX_CONFIG_SUBDIR([build-frontend], [${args} ac_scorep_platform=${ac_scorep_platform} afs_scorep_platform_name='${afs_scorep_platform_name_sq}' afs_scorep_default_machine_name='${afs_scorep_default_machine_name_sq}' ${scorep_opari2_config_arg} ${scorep_cubew_config_arg} ${scorep_otf2_config_arg}])
fi
adl_RECURSIVE_EVAL([${docdir}], [DOCDIR])
AC_SUBST([DOCDIR])
AC_CONFIG_FILES([
Makefile
src/config-common.h:build-config/common/config-common.h
])
# generate the Score-P error codes header
AC_CONFIG_FILES(
[src/utils/include/SCOREP_ErrorCodes.h:common/utils/src/exception/ErrorCodes.tmpl.h],
[$srcdir/common/utils/src/exception/finalize_error_codes.sh SCOREP $srcdir/share/scorep.errors src/utils/include/SCOREP_ErrorCodes.h src/utils/include/scorep_error_decls.gen.h])
# generate remapper specification file
AC_CONFIG_FILES([share/scorep.spec])
AC_OUTPUT
AS_IF([test "x$ac_scorep_platform_data_provided" != "xyes"], [
AFS_SUMMARY_COLLECT
])