Blame src/hwloc/configure.ac

Packit Service c5cf8c
# -*- shell-script -*-
Packit Service c5cf8c
#
Packit Service c5cf8c
# Copyright © 2009      CNRS
Packit Service c5cf8c
# Copyright © 2009-2018 Inria.  All rights reserved.
Packit Service c5cf8c
# Copyright © 2009, 2011-2012      Université Bordeaux
Packit Service c5cf8c
# Copyright © 2009-2014 Cisco Systems, Inc.  All rights reserved.
Packit Service c5cf8c
#
Packit Service c5cf8c
# See COPYING in top-level directory.
Packit Service c5cf8c
#
Packit Service c5cf8c
# Additional copyrights may follow
Packit Service c5cf8c
#
Packit Service c5cf8c
# $HEADER$
Packit Service c5cf8c
#
Packit Service c5cf8c
Packit Service c5cf8c
####################################################################
Packit Service c5cf8c
# Autoconf, Automake, and Libtool bootstrapping
Packit Service c5cf8c
####################################################################
Packit Service c5cf8c
Packit Service c5cf8c
AC_INIT([hwloc],
Packit Service c5cf8c
        [m4_normalize(esyscmd([config/hwloc_get_version.sh VERSION --version]))],
Packit Service c5cf8c
        [http://github.com/open-mpi/hwloc/issues], [hwloc])
Packit Service c5cf8c
AC_PREREQ(2.63)
Packit Service c5cf8c
AC_CONFIG_AUX_DIR(./config)
Packit Service c5cf8c
# Note that this directory must *exactly* match what was specified via
Packit Service c5cf8c
# -I in ACLOCAL_AMFLAGS in the top-level Makefile.am.
Packit Service c5cf8c
AC_CONFIG_MACRO_DIR(./config)
Packit Service c5cf8c
Packit Service c5cf8c
cat <
Packit Service c5cf8c
Packit Service c5cf8c
###
Packit Service c5cf8c
### Configuring hwloc distribution tarball
Packit Service c5cf8c
### Startup tests
Packit Service c5cf8c
###
Packit Service c5cf8c
EOF
Packit Service c5cf8c
Packit Service c5cf8c
# This must be before AM_INIT_AUTOMAKE
Packit Service c5cf8c
AC_CANONICAL_TARGET
Packit Service c5cf8c
Packit Service c5cf8c
# Init automake
Packit Service c5cf8c
AM_INIT_AUTOMAKE([1.11 dist-bzip2 subdir-objects foreign tar-ustar parallel-tests -Wall -Werror])
Packit Service c5cf8c
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
Packit Service c5cf8c
Packit Service c5cf8c
AC_LANG([C])
Packit Service c5cf8c
AC_USE_SYSTEM_EXTENSIONS
Packit Service c5cf8c
Packit Service c5cf8c
####################################################################
Packit Service c5cf8c
# Setup the configure-results header file
Packit Service c5cf8c
####################################################################
Packit Service c5cf8c
Packit Service c5cf8c
AH_TOP([/* -*- c -*-
Packit Service c5cf8c
 *
Packit Service c5cf8c
 * Copyright © 2009, 2011, 2012 CNRS, inria., Université Bordeaux  All rights reserved.
Packit Service c5cf8c
 * Copyright © 2009-2014 Cisco Systems, Inc.  All rights reserved.
Packit Service c5cf8c
 * $COPYRIGHT$
Packit Service c5cf8c
 *
Packit Service c5cf8c
 * Additional copyrights may follow
Packit Service c5cf8c
 *
Packit Service c5cf8c
 * $HEADER$
Packit Service c5cf8c
 *
Packit Service c5cf8c
 * This file is automatically generated by configure.  Edits will be lost
Packit Service c5cf8c
 * the next time you run configure!
Packit Service c5cf8c
 */
Packit Service c5cf8c
Packit Service c5cf8c
#ifndef HWLOC_CONFIGURE_H
Packit Service c5cf8c
#define HWLOC_CONFIGURE_H
Packit Service c5cf8c
])
Packit Service c5cf8c
AH_BOTTOM([
Packit Service c5cf8c
#endif /* HWLOC_CONFIGURE_H */
Packit Service c5cf8c
])
Packit Service c5cf8c
Packit Service c5cf8c
####################################################################
Packit Service c5cf8c
# Setup Libtool
Packit Service c5cf8c
####################################################################
Packit Service c5cf8c
Packit Service c5cf8c
# We want new Libtool.  None of that old stuff.  Pfft.
Packit Service c5cf8c
m4_ifdef([LT_PREREQ], [],
Packit Service c5cf8c
         [m4_fatal([libtool version 2.2.6 or higher is required], [63])])
Packit Service c5cf8c
LT_PREREQ([2.2.6])
Packit Service c5cf8c
Packit Service c5cf8c
# Setup libtool, but disable F77, Java and Windows Resource
Packit Service c5cf8c
# Compiler support -- we don't need that stuff.
Packit Service c5cf8c
AM_ENABLE_SHARED
Packit Service c5cf8c
AM_DISABLE_STATIC
Packit Service c5cf8c
Packit Service c5cf8c
# This did not exist pre AM 1.11.x (where x is somewhere >0 and <3),
Packit Service c5cf8c
# but it is necessary in AM 1.12.x.
Packit Service c5cf8c
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
Packit Service c5cf8c
Packit Service c5cf8c
LT_INIT([dlopen win32-dll])
Packit Service c5cf8c
LT_LANG([C])
Packit Service c5cf8c
LT_LANG([C++])
Packit Service c5cf8c
Packit Service c5cf8c
####################################################################
Packit Service c5cf8c
# Setup C, C++ compilers
Packit Service c5cf8c
####################################################################
Packit Service c5cf8c
Packit Service c5cf8c
CFLAGS_save=$CFLAGS
Packit Service c5cf8c
AC_PROG_CC
Packit Service c5cf8c
AM_PROG_CC_C_O
Packit Service c5cf8c
AC_PROG_CC_C99
Packit Service c5cf8c
CFLAGS=$CFLAGS_save
Packit Service c5cf8c
Packit Service c5cf8c
AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
Packit Service c5cf8c
AS_IF([test -z "$CC_FOR_BUILD"],[
Packit Service c5cf8c
    AC_SUBST([CC_FOR_BUILD], [$CC])
Packit Service c5cf8c
])
Packit Service c5cf8c
Packit Service c5cf8c
####################################################################
Packit Service c5cf8c
# CLI arguments
Packit Service c5cf8c
####################################################################
Packit Service c5cf8c
Packit Service c5cf8c
# Define hwloc's configure arguments
Packit Service c5cf8c
HWLOC_DEFINE_ARGS
Packit Service c5cf8c
Packit Service c5cf8c
# If debug mode, add -g
Packit Service c5cf8c
AS_IF([test "$hwloc_debug" = "1"],
Packit Service c5cf8c
      [CFLAGS="$CFLAGS -g"])
Packit Service c5cf8c
Packit Service c5cf8c
# If the user didn't specifically ask for embedding mode, default to
Packit Service c5cf8c
# standalone mode
Packit Service c5cf8c
AS_IF([test "$enable_embedded_mode" != "yes"],
Packit Service c5cf8c
      [AS_IF([test ! -d "$srcdir/doc"],
Packit Service c5cf8c
             [AC_MSG_WARN([The hwloc source tree looks incomplete for a standalone])
Packit Service c5cf8c
              AC_MSG_WARN([build.  Perhaps this hwloc tree is intended for an embedded])
Packit Service c5cf8c
              AC_MSG_WARN([build?  Try using the --enable-embedded-mode switch.])
Packit Service c5cf8c
              AC_MSG_ERROR([Cannot build standalone hwloc])],
Packit Service c5cf8c
             [HWLOC_BUILD_STANDALONE])])
Packit Service c5cf8c
Packit Service c5cf8c
####################################################################
Packit Service c5cf8c
# Setup for the hwloc API
Packit Service c5cf8c
####################################################################
Packit Service c5cf8c
Packit Service c5cf8c
AC_SUBST([libhwloc_so_version])
Packit Service c5cf8c
Packit Service c5cf8c
# Setup the hwloc core
Packit Service c5cf8c
HWLOC_SETUP_CORE([], [], [AC_MSG_ERROR([Cannot build hwloc core])], [1])
Packit Service c5cf8c
Packit Service c5cf8c
####################################################################
Packit Service c5cf8c
# Setup the netloc API
Packit Service c5cf8c
####################################################################
Packit Service c5cf8c
Packit Service c5cf8c
AC_SUBST([libnetloc_so_version])
Packit Service c5cf8c
Packit Service c5cf8c
AC_ARG_ENABLE([netloc],
Packit Service c5cf8c
              [AC_HELP_STRING([--enable-netloc],
Packit Service c5cf8c
                              [The Netloc functionality is disabled by default. Using --enable-netloc will cause configure to abort if Netloc cannot be build (e.g., not supported on your platform).])
Packit Service c5cf8c
              ])
Packit Service c5cf8c
Packit Service c5cf8c
AS_IF([test "$enable_netloc" = "yes" -a "$hwloc_mode" = "standalone"],
Packit Service c5cf8c
      [NETLOC_SETUP_CORE([], [],
Packit Service c5cf8c
           [AS_IF([test "$enable_netloc" = "yes"],
Packit Service c5cf8c
                  [AC_MSG_ERROR([Cannot build netloc core])])
Packit Service c5cf8c
           ],
Packit Service c5cf8c
           [1])
Packit Service c5cf8c
      ])
Packit Service c5cf8c
Packit Service c5cf8c
####################################################################
Packit Service c5cf8c
# Version information
Packit Service c5cf8c
####################################################################
Packit Service c5cf8c
Packit Service c5cf8c
# HWLOC_VERSION was setup by HWLOC_SETUP_CORE above.
Packit Service c5cf8c
Packit Service c5cf8c
# Make configure depend on the VERSION file, since it's used in AC_INIT
Packit Service c5cf8c
AC_SUBST([CONFIGURE_DEPENDENCIES], ['$(top_srcdir)/VERSION'])
Packit Service c5cf8c
Packit Service c5cf8c
# Override/fixup the version numbers set by AC_INIT, since on
Packit Service c5cf8c
# developer builds, there's no good way to know what the version is
Packit Service c5cf8c
# before running configure :(.  We only use the base version number
Packit Service c5cf8c
# for the version set in AC_INIT.  This will always match reality
Packit Service c5cf8c
# because we add the VERSION file (the only way to change the
Packit Service c5cf8c
# major.minor.release{greek}) into the configure dependencies.
Packit Service c5cf8c
PACKAGE_VERSION="$HWLOC_VERSION"
Packit Service c5cf8c
PACKAGE_STRING="${PACKAGE_NAME} ${PACKAGE_VERSION}"
Packit Service c5cf8c
VERSION="${PACKAGE_VERSION}"
Packit Service c5cf8c
Packit Service c5cf8c
# For standalone configurations, we also include a .so version number.
Packit Service c5cf8c
Packit Service c5cf8c
. $srcdir/VERSION
Packit Service c5cf8c
Packit Service c5cf8c
####################################################################
Packit Service c5cf8c
# Setup the rest of the infrastructure
Packit Service c5cf8c
####################################################################
Packit Service c5cf8c
Packit Service c5cf8c
# Setup hwloc's docs, utils, and tests
Packit Service c5cf8c
AS_IF([test "$hwloc_mode" = "standalone"],
Packit Service c5cf8c
      [HWLOC_SETUP_DOCS
Packit Service c5cf8c
       HWLOC_SETUP_UTILS
Packit Service c5cf8c
       HWLOC_SETUP_TESTS])
Packit Service c5cf8c
Packit Service c5cf8c
cat <
Packit Service c5cf8c
Packit Service c5cf8c
###
Packit Service c5cf8c
### Performing final hwloc configuration
Packit Service c5cf8c
###
Packit Service c5cf8c
EOF
Packit Service c5cf8c
Packit Service c5cf8c
# Run the AM_CONDITIONALs
Packit Service c5cf8c
HWLOC_DO_AM_CONDITIONALS
Packit Service c5cf8c
NETLOC_DO_AM_CONDITIONALS
Packit Service c5cf8c
Packit Service c5cf8c
####################################################################
Packit Service c5cf8c
# Final output
Packit Service c5cf8c
####################################################################
Packit Service c5cf8c
Packit Service c5cf8c
# Set the final flags
Packit Service c5cf8c
CFLAGS="$HWLOC_EMBEDDED_CFLAGS $CFLAGS"
Packit Service c5cf8c
CPPFLAGS="$HWLOC_EMBEDDED_CPPFLAGS $CPPFLAGS"
Packit Service c5cf8c
LIBS="$HWLOC_EMBEDDED_LIBS $LIBS"
Packit Service c5cf8c
Packit Service c5cf8c
# Party on
Packit Service c5cf8c
AC_OUTPUT
Packit Service c5cf8c
Packit Service c5cf8c
# Warn if we didn't have pkg-config
Packit Service c5cf8c
if test "x$PKG_CONFIG" = x; then
Packit Service c5cf8c
  cat << EOF
Packit Service c5cf8c
Packit Service c5cf8c
************************************************************************
Packit Service c5cf8c
Could not detect/enable some features such as libxml2 and Cairo support
Packit Service c5cf8c
because pkg-config isn't available.
Packit Service c5cf8c
************************************************************************
Packit Service c5cf8c
EOF
Packit Service c5cf8c
fi
Packit Service c5cf8c
Packit Service c5cf8c
# Show which optional support we'll be building
Packit Service c5cf8c
hwloc_xml_status=basic
Packit Service c5cf8c
AS_IF([test "$hwloc_libxml2_happy" = "yes"], [hwloc_xml_status=full])
Packit Service c5cf8c
netloc_status=no
Packit Service c5cf8c
AS_IF([test "$netloc_happy" = "yes"], [
Packit Service c5cf8c
  netlocscotch_status=without
Packit Service c5cf8c
  AS_IF([test "$scotch_found_headers" = "yes"], [netlocscotch_status=with])
Packit Service c5cf8c
  netloc_status="yes ($netlocscotch_status scotch)"
Packit Service c5cf8c
])
Packit Service c5cf8c
hwloc_cairo_status=$hwloc_cairo_happy
Packit Service c5cf8c
AS_IF([test "$enable_embedded_mode" = "yes"], [hwloc_cairo_status="no (disabled in embedded mode)"])
Packit Service c5cf8c
Packit Service c5cf8c
# Prepare the I/O summary
Packit Service c5cf8c
hwloc_probeio_list=
Packit Service c5cf8c
if test "x$hwloc_pciaccess_happy" = "xyes" -o "x$hwloc_linuxpci_happy" = "xyes"; then
Packit Service c5cf8c
  test "x$hwloc_pciaccess_happy" = "xyes" && hwloc_probepci_list=pciaccess
Packit Service c5cf8c
  test "x$hwloc_pciaccess_happy$hwloc_linuxpci_happy" = "xyesyes" && hwloc_probepci_list="${hwloc_probepci_list}+"
Packit Service c5cf8c
  test "x$hwloc_linuxio_happy" = "xyes" && hwloc_probepci_list="${hwloc_probepci_list}linux"
Packit Service c5cf8c
  hwloc_probeio_list="$hwloc_probeio_list PCI($hwloc_probepci_list)"
Packit Service c5cf8c
fi
Packit Service c5cf8c
test "x$hwloc_linuxio_happy" = "xyes" && hwloc_probeio_list="$hwloc_probeio_list LinuxIO"
Packit Service c5cf8c
test "x$hwloc_opencl_happy" = "xyes" && hwloc_probeio_list="$hwloc_probeio_list OpenCL"
Packit Service c5cf8c
test "x$hwloc_have_cudart" = "xyes" && hwloc_probeio_list="$hwloc_probeio_list CUDA"
Packit Service c5cf8c
test "x$hwloc_nvml_happy" = "xyes" && hwloc_probeio_list="$hwloc_probeio_list NVML"
Packit Service c5cf8c
test "x$hwloc_gl_happy" = "xyes" && hwloc_probeio_list="$hwloc_probeio_list GL"
Packit Service c5cf8c
# if nothing, say "no"
Packit Service c5cf8c
test "x$hwloc_probeio_list" = "x" && hwloc_probeio_list=" no"
Packit Service c5cf8c
Packit Service c5cf8c
# Beginning of generic support
Packit Service c5cf8c
cat <
Packit Service c5cf8c
Packit Service c5cf8c
-----------------------------------------------------------------------------
Packit Service c5cf8c
Hwloc optional build support status (more details can be found above):
Packit Service c5cf8c
Packit Service c5cf8c
Probe / display I/O devices:$hwloc_probeio_list
Packit Service c5cf8c
Graphical output (Cairo):    $hwloc_cairo_status
Packit Service c5cf8c
XML input / output:          $hwloc_xml_status
Packit Service c5cf8c
Netloc functionality:        $netloc_status
Packit Service c5cf8c
EOF
Packit Service c5cf8c
Packit Service c5cf8c
# Plugin support
Packit Service c5cf8c
hwloc_plugin_summary=$hwloc_have_plugins
Packit Service c5cf8c
test "x$hwloc_plugin_components" != "x" && hwloc_plugin_summary="yes ("`echo $hwloc_plugin_components`")" # echo removes the starting space
Packit Service c5cf8c
cat <
Packit Service c5cf8c
Plugin support:              $hwloc_plugin_summary
Packit Service c5cf8c
EOF
Packit Service c5cf8c
Packit Service c5cf8c
# End of generic support
Packit Service c5cf8c
cat <
Packit Service c5cf8c
-----------------------------------------------------------------------------
Packit Service c5cf8c
Packit Service c5cf8c
EOF