3 # Copyright © 2009 CNRS
4 # Copyright © 2009-2018 Inria. All rights reserved.
5 # Copyright © 2009, 2011-2012 Université Bordeaux
6 # Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved.
8 # See COPYING in top-level directory.
10 # Additional copyrights may follow
15 ####################################################################
16 # Autoconf, Automake, and Libtool bootstrapping
17 ####################################################################
20 [m4_normalize(esyscmd([config/hwloc_get_version.sh VERSION --version]))],
21 [http://github.com/open-mpi/hwloc/issues], [hwloc])
23 AC_CONFIG_AUX_DIR(./config)
24 # Note that this directory must *exactly* match what was specified via
25 # -I in ACLOCAL_AMFLAGS in the top-level Makefile.am.
26 AC_CONFIG_MACRO_DIR(./config)
31 ### Configuring hwloc distribution tarball
36 # This must be before AM_INIT_AUTOMAKE
40 AM_INIT_AUTOMAKE([1.11 dist-bzip2 subdir-objects foreign tar-ustar parallel-tests -Wall -Werror])
41 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
43 # We want new Libtool. None of that old stuff. Pfft.
44 m4_ifdef([LT_PREREQ], [],
45 [m4_fatal([libtool version 2.2.6 or higher is required], [63])])
49 AC_USE_SYSTEM_EXTENSIONS
51 ####################################################################
52 # Setup the configure-results header file
53 ####################################################################
57 * Copyright © 2009, 2011, 2012 CNRS, inria., Université Bordeaux All rights reserved.
58 * Copyright © 2009 Cisco Systems, Inc. All rights reserved.
61 * Additional copyrights may follow
65 * This file is automatically generated by configure. Edits will be lost
66 * the next time you run configure!
69 #ifndef HWLOC_CONFIGURE_H
70 #define HWLOC_CONFIGURE_H
73 #endif /* HWLOC_CONFIGURE_H */
76 ####################################################################
78 ####################################################################
85 # This did not exist pre AM 1.11.x (where x is somewhere >0 and <3),
86 # but it is necessary in AM 1.12.x.
87 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
89 AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
90 AS_IF([test -z "$CC_FOR_BUILD"],[
91 AC_SUBST([CC_FOR_BUILD], [$CC])
94 ####################################################################
96 ####################################################################
98 # Define hwloc's configure arguments
101 # If debug mode, add -g
102 AS_IF([test "$hwloc_debug" = "1"],
103 [CFLAGS="$CFLAGS -g"])
105 # If the user didn't specifically ask for embedding mode, default to
107 AS_IF([test "$enable_embedded_mode" != "yes"],
108 [AS_IF([test ! -d "$srcdir/doc"],
109 [AC_MSG_WARN([The hwloc source tree looks incomplete for a standalone])
110 AC_MSG_WARN([build. Perhaps this hwloc tree is intended for an embedded])
111 AC_MSG_WARN([build? Try using the --enable-embedded-mode switch.])
112 AC_MSG_ERROR([Cannot build standalone hwloc])],
113 [HWLOC_BUILD_STANDALONE])])
115 ####################################################################
116 # Setup for the hwloc API
117 ####################################################################
119 # Setup the hwloc core
120 HWLOC_SETUP_CORE([], [], [AC_MSG_ERROR([Cannot build hwloc core])], [1])
122 # Setup hwloc's docs, utils, and tests
123 AS_IF([test "$hwloc_mode" = "standalone"],
131 ### Performing final hwloc configuration
135 # Run the AM_CONDITIONALs
136 HWLOC_DO_AM_CONDITIONALS
138 ####################################################################
139 # Version information
140 ####################################################################
142 # HWLOC_VERSION was setup by HWLOC_SETUP_CORE above.
144 # Make configure depend on the VERSION file, since it's used in AC_INIT
145 AC_SUBST([CONFIGURE_DEPENDENCIES], ['$(top_srcdir)/VERSION'])
147 # Override/fixup the version numbers set by AC_INIT, since on
148 # developer builds, there's no good way to know what the version is
149 # before running configure :(. We only use the base version number
150 # for the version set in AC_INIT. This will always match reality
151 # because we add the VERSION file (the only way to change the
152 # major.minor.release{greek}) into the configure dependencies.
154 PACKAGE_VERSION="$HWLOC_VERSION"
155 PACKAGE_STRING="${PACKAGE_NAME} ${PACKAGE_VERSION}"
156 VERSION="${PACKAGE_VERSION}"
158 # For standalone configurations, we also include a .so version number.
161 AC_SUBST([libhwloc_so_version])
163 ####################################################################
165 ####################################################################
167 # Set the final flags
168 CFLAGS="$HWLOC_EMBEDDED_CFLAGS $CFLAGS"
169 CPPFLAGS="$HWLOC_EMBEDDED_CPPFLAGS $CPPFLAGS"
170 LIBS="$HWLOC_EMBEDDED_LIBS $LIBS"
172 # Setup libtool, but disable C++, F77, Java and Windows Resource
173 # Compiler support -- we don't need that stuff.
176 AM_PROG_LIBTOOL([dlopen win32-dll])
182 # Warn if we didn't have pkg-config
183 if test "x$PKG_CONFIG" = x; then
186 ************************************************************************
187 Could not detect/enable some features such as libxml2 and Cairo support
188 because pkg-config isn't available.
189 ************************************************************************
193 # Show which optional support we'll be building
194 hwloc_xml_status=basic
195 AS_IF([test "$hwloc_libxml2_happy" = "yes"], [hwloc_xml_status=full])
196 hwloc_cairo_status=$hwloc_cairo_happy
197 AS_IF([test "$enable_embedded_mode" = "yes"], [hwloc_cairo_status="no (disabled in embedded mode)"])
199 # Prepare the I/O summary
201 if test "x$hwloc_pci_happy" = "xyes" -o "x$hwloc_linuxpci_happy" = "xyes"; then
202 test "x$hwloc_pci_happy" = "xyes" && hwloc_probepci_list="$hwloc_pci_lib"
203 test "x$hwloc_pci_happy$hwloc_linuxpci_happy" = "xyesyes" && hwloc_probepci_list="${hwloc_probepci_list}+"
204 test "x$hwloc_linuxpci_happy" = "xyes" && hwloc_probepci_list="${hwloc_probepci_list}linux"
205 hwloc_probeio_list="$hwloc_probeio_list PCI($hwloc_probepci_list)"
207 test "x$hwloc_opencl_happy" = "xyes" && hwloc_probeio_list="$hwloc_probeio_list OpenCL"
208 test "x$hwloc_have_cudart" = "xyes" && hwloc_probeio_list="$hwloc_probeio_list CUDA"
209 test "x$hwloc_nvml_happy" = "xyes" && hwloc_probeio_list="$hwloc_probeio_list NVML"
210 test "x$hwloc_gl_happy" = "xyes" && hwloc_probeio_list="$hwloc_probeio_list GL"
211 # if anything but PCI, that anything will be useless
212 test "x$hwloc_pci_happy" != "xyes" && test "x$hwloc_linuxpci_happy" != "xyes" \
213 && test "x$hwloc_probeio_list" != "x" && hwloc_probeio_list="$hwloc_probeio_list (cannot work without PCI)"
214 # if nothing, say "no"
215 test "x$hwloc_probeio_list" = "x" && hwloc_probeio_list=" no"
217 # Beginning of generic support
220 -----------------------------------------------------------------------------
221 Hwloc optional build support status (more details can be found above):
223 Probe / display I/O devices:$hwloc_probeio_list
224 Graphical output (Cairo): $hwloc_cairo_status
225 XML input / output: $hwloc_xml_status
228 # Linux specific support
229 AS_IF([test "$hwloc_linux" = "yes"], [cat <<EOF
230 libnuma memory support: $hwloc_linux_libnuma_happy
234 hwloc_plugin_summary=$hwloc_have_plugins
235 test "x$hwloc_plugin_components" != "x" && hwloc_plugin_summary="yes ("`echo $hwloc_plugin_components`")" # echo removes the starting space
237 Plugin support: $hwloc_plugin_summary
240 # End of generic support
242 -----------------------------------------------------------------------------