-
Notifications
You must be signed in to change notification settings - Fork 174
/
configure.ac
330 lines (273 loc) · 11.4 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
317
318
319
320
321
322
323
324
325
326
327
328
329
330
# -*- shell-script -*-
#
# Copyright © 2009 CNRS
# Copyright © 2009-2022 Inria. All rights reserved.
# Copyright © 2009, 2011-2012 Université Bordeaux
# Copyright © 2009-2020 Cisco Systems, Inc. All rights reserved.
#
# See COPYING in top-level directory.
#
# Additional copyrights may follow
#
# $HEADER$
#
####################################################################
# Autoconf, Automake, and Libtool bootstrapping
####################################################################
AC_INIT([hwloc],
[m4_normalize(esyscmd([sh config/hwloc_get_version.sh VERSION --version]))],
[https://github.com/open-mpi/hwloc/issues], [hwloc])
AC_PREREQ(2.63)
AC_CONFIG_AUX_DIR(./config)
# Note that this directory must *exactly* match what was specified via
# -I in ACLOCAL_AMFLAGS in the top-level Makefile.am.
AC_CONFIG_MACRO_DIR(./config)
cat <<EOF
###
### Configuring hwloc distribution tarball
### Startup tests
###
EOF
# This must be before AM_INIT_AUTOMAKE
AC_CANONICAL_TARGET
# Init automake
AM_INIT_AUTOMAKE([1.11 dist-bzip2 subdir-objects foreign tar-ustar parallel-tests -Wall -Werror])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_LANG([C])
AC_USE_SYSTEM_EXTENSIONS
####################################################################
# Setup the configure-results header file
####################################################################
AH_TOP([/* -*- c -*-
*
* Copyright © 2009, 2011, 2012 CNRS, inria., Université Bordeaux All rights reserved.
* Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved.
* Copyright © 2022 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*
* This file is automatically generated by configure. Edits will be lost
* the next time you run configure!
*/
#ifndef HWLOC_CONFIGURE_H
#define HWLOC_CONFIGURE_H
])
AH_BOTTOM([
#endif /* HWLOC_CONFIGURE_H */
])
####################################################################
# Setup Libtool
####################################################################
# We want new Libtool. None of that old stuff. Pfft.
m4_ifdef([LT_PREREQ], [],
[m4_fatal([libtool version 2.2.6 or higher is required], [63])])
LT_PREREQ([2.2.6])
# Setup libtool, but disable F77, Java and Windows Resource
# Compiler support -- we don't need that stuff.
AC_ENABLE_SHARED
AC_DISABLE_STATIC
# This did not exist pre AM 1.11.x (where x is somewhere >0 and <3),
# but it is necessary in AM 1.12.x.
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
LT_INIT([dlopen win32-dll])
LT_LANG([C])
LT_LANG([C++])
####################################################################
# Setup C, C++ compilers
####################################################################
CFLAGS_save=$CFLAGS
AC_PROG_CC
AM_PROG_CC_C_O
# AC_PROG_CC_C99 obsolete, detected inside AC_PROG_CC, since autoconf 2.70
m4_version_prereq([2.70], [], [AC_PROG_CC_C99])
CFLAGS=$CFLAGS_save
####################################################################
# CLI arguments
####################################################################
# Define hwloc's configure arguments
HWLOC_DEFINE_ARGS
# If debug mode, add -g
AS_IF([test "$hwloc_debug" = "1"],
[CFLAGS="$CFLAGS -g"])
# If the user didn't specifically ask for embedding mode, default to
# standalone mode
AS_IF([test "$enable_embedded_mode" != "yes"],
[AS_IF([test ! -d "$srcdir/doc"],
[AC_MSG_WARN([The hwloc source tree looks incomplete for a standalone])
AC_MSG_WARN([build. Perhaps this hwloc tree is intended for an embedded])
AC_MSG_WARN([build? Try using the --enable-embedded-mode switch.])
AC_MSG_ERROR([Cannot build standalone hwloc])],
[HWLOC_BUILD_STANDALONE])])
####################################################################
# Setup for the hwloc API
####################################################################
AC_SUBST([libhwloc_so_version])
AC_SUBST([libhwloc_so_name])
# Setup the hwloc core
HWLOC_SETUP_CORE([], [], [AC_MSG_ERROR([Cannot build hwloc core])], [1])
####################################################################
# Version information
####################################################################
# HWLOC_VERSION was setup by HWLOC_SETUP_CORE above.
# Make configure depend on the VERSION file, since it's used in AC_INIT
AC_SUBST([CONFIGURE_DEPENDENCIES], ['$(top_srcdir)/VERSION'])
# Override/fixup the version numbers set by AC_INIT, since on
# developer builds, there's no good way to know what the version is
# before running configure :(. We only use the base version number
# for the version set in AC_INIT. This will always match reality
# because we add the VERSION file (the only way to change the
# major.minor.release{greek}) into the configure dependencies.
PACKAGE_VERSION="$HWLOC_VERSION"
PACKAGE_STRING="${PACKAGE_NAME} ${PACKAGE_VERSION}"
VERSION="${PACKAGE_VERSION}"
# For standalone configurations, we also include a .so version number.
. $srcdir/VERSION
libhwloc_so_version_current=`echo $libhwloc_so_version | cut -d: -f1`
libhwloc_so_version_age=`echo $libhwloc_so_version | cut -d: -f3`
libhwloc_so_name=`expr $libhwloc_so_version_current - $libhwloc_so_version_age`
####################################################################
# Setup the rest of the infrastructure
####################################################################
# Setup hwloc's docs, utils, and tests
AS_IF([test "$hwloc_mode" = "standalone"],
[HWLOC_SETUP_DOCS
HWLOC_SETUP_UTILS
HWLOC_SETUP_TESTS])
cat <<EOF
###
### Performing final hwloc configuration
###
EOF
# Run the AM_CONDITIONALs
HWLOC_DO_AM_CONDITIONALS
####################################################################
# Final output
####################################################################
# Set the final flags
CFLAGS="$HWLOC_EMBEDDED_CFLAGS $CFLAGS"
CPPFLAGS="$HWLOC_EMBEDDED_CPPFLAGS $CPPFLAGS"
LIBS="$HWLOC_EMBEDDED_LIBS $LIBS"
# Party on
AC_OUTPUT
# Warn if we didn't have pkg-config
if test "x$PKG_CONFIG" = x; then
cat << EOF
************************************************************************
Could not detect/enable some features such as libxml2 and Cairo support
because pkg-config isn't available.
************************************************************************
EOF
fi
# Show which optional support we'll be building
hwloc_xml_status=basic
AS_IF([test "$hwloc_libxml2_happy" = "yes"], [hwloc_xml_status=full])
AS_IF([test "$enable_embedded_mode" = "yes"],
[hwloc_graphical_lstopo_status="no (disabled in embedded mode)"],
[AS_IF([test "$hwloc_windows" = "yes"],
[hwloc_graphical_lstopo_status="yes (Windows)"],
[AS_IF([test "$hwloc_cairo_happy" = "yes"],
[AS_IF([test "$lstopo_have_x11" = "yes"],
[hwloc_graphical_lstopo_status="yes (Cairo)"],
[hwloc_graphical_lstopo_status="partial (Cairo, without X11)"])],
[hwloc_graphical_lstopo_status="no"])
])
])
# Prepare the I/O summary
hwloc_probeio_list=
if test "x$hwloc_pciaccess_happy" = "xyes" -o "x$hwloc_linuxpci_happy" = "xyes"; then
test "x$hwloc_pciaccess_happy" = "xyes" && hwloc_probepci_list=pciaccess
test "x$hwloc_pciaccess_happy$hwloc_linuxpci_happy" = "xyesyes" && hwloc_probepci_list="${hwloc_probepci_list}+"
test "x$hwloc_linuxio_happy" = "xyes" && hwloc_probepci_list="${hwloc_probepci_list}linux"
hwloc_probeio_list="$hwloc_probeio_list PCI($hwloc_probepci_list)"
fi
test "x$hwloc_linuxio_happy" = "xyes" && hwloc_probeio_list="$hwloc_probeio_list LinuxIO"
test "x$hwloc_opencl_happy" = "xyes" && hwloc_probeio_list="$hwloc_probeio_list OpenCL"
test "x$hwloc_have_cudart" = "xyes" && hwloc_probeio_list="$hwloc_probeio_list CUDA"
if test "x$hwloc_nvml_happy" = "xyes" ; then
hwloc_probeio_list="$hwloc_probeio_list NVML"
fi
test "x$hwloc_rsmi_happy" = "xyes" && hwloc_probeio_list="$hwloc_probeio_list RSMI"
test "x$hwloc_levelzero_happy" = "xyes" && hwloc_probeio_list="$hwloc_probeio_list LevelZero"
test "x$hwloc_gl_happy" = "xyes" && hwloc_probeio_list="$hwloc_probeio_list GL"
# if nothing, say "no"
test "x$hwloc_probeio_list" = "x" && hwloc_probeio_list=" no"
if test "x$hwloc_nvml_happy" = "xyes" -a "x$hwloc_nvml_warning" = "xyes"; then
hwloc_nvml_status="yes, but not functional on this machine (see warning above)"
cat <<EOF
************************************************************************
WARNING: NVIDIA Management Library (NVML) was detected, but programs
linked against it cannot run on this machine. This situation often
indicates that this machine does not have the hardware necessary to run
the library.
Sometimes, the machine building hwloc differs from the machine where
hwloc will be running. As such, this warning can be ignored if you know
that the library is functional where you intend to run hwloc.
However, if that is not the situation, you may want to disable NVML
support in hwloc with the --disable-nvml option in configure.
************************************************************************
EOF
fi
if test "x$hwloc_have_cudart" = xyes -a "x$hwloc_cuda_warning" = xyes; then
hwloc_cuda_status="yes, but not in LD_LIBRARY_PATH or ld.so.conf (see warning above)"
cat <<EOF
************************************************************************
WARNING: The NVIDIA CUDA library was detected with link options
$HWLOC_CUDART_LIBS $HWLOC_CUDART_LDFLAGS
but programs linked against it cannot run.
This often indicates that the CUDA RT lib path is missing in
ld.so.conf and LD_LIBRARY_PATH. If unneeded, this dependency may
be removed from hwloc by passing --disable-cuda to configure.
************************************************************************
EOF
fi
if test "x$hwloc_rsmi_happy" = xyes -a "x$hwloc_rsmi_warning" = xyes; then
hwloc_rsmi_status="yes, but not in LD_LIBRARY_PATH or ld.so.conf (see warning above)"
cat <<EOF
************************************************************************
WARNING: The AMD ROCm SMI library was detected with link options
$HWLOC_RSMI_LIBS $HWLOC_RSMI_LDFLAGS
but programs linked against it cannot run.
This often indicates that the ROCm SMI lib path is missing in
ld.so.conf and LD_LIBRARY_PATH. If unneeded, this dependency may
be removed from hwloc by passing --disable-rsmi to configure.
************************************************************************
EOF
fi
# Beginning of generic support
cat <<EOF
-----------------------------------------------------------------------------
Hwloc optional build support status (more details can be found above):
Probe / display I/O devices:$hwloc_probeio_list
EOF
if test "x$hwloc_cuda_status" != x; then
cat <<EOF
CUDA status: $hwloc_cuda_status
EOF
fi
if test "x$hwloc_nvml_status" != x; then
cat <<EOF
NVML status: $hwloc_nvml_status
EOF
fi
if test "x$hwloc_rsmi_status" != x; then
cat <<EOF
ROCm SMI status: $hwloc_rsmi_status
EOF
fi
cat <<EOF
Graphical output: $hwloc_graphical_lstopo_status
XML input / output: $hwloc_xml_status
EOF
# Plugin support
hwloc_plugin_summary=$hwloc_have_plugins
test "x$hwloc_plugin_components" != "x" && hwloc_plugin_summary="$hwloc_plugins_load ("`echo $hwloc_plugin_components`")" # echo removes the starting space
cat <<EOF
Plugin support: $hwloc_plugin_summary
EOF
# End of generic support
cat <<EOF
-----------------------------------------------------------------------------
EOF