From 2ec2a329dcfd5d3ec5decd681e2751397017c56f Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Sun, 24 Sep 2017 05:36:23 -0700 Subject: [PATCH] hwloc2a/configure.m4: be more careful in with_cuda->enable_cuda Be a little more deliberate about convering OMPI's --with-cuda CLI value to hwloc's --enable-cuda configure option. Also, unconditionally disable hwloc NVML support (because Open MPI is not currently using it). Signed-off-by: Jeff Squyres --- opal/mca/hwloc/hwloc2a/configure.m4 | 36 +++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/opal/mca/hwloc/hwloc2a/configure.m4 b/opal/mca/hwloc/hwloc2a/configure.m4 index 5bae594364..70ce7c300e 100644 --- a/opal/mca/hwloc/hwloc2a/configure.m4 +++ b/opal/mca/hwloc/hwloc2a/configure.m4 @@ -124,14 +124,36 @@ AC_DEFUN([MCA_opal_hwloc_hwloc2a_CONFIG],[ # Per https://github.com/open-mpi/ompi/issues/4219, if # --without-cuda was specified, be sure to disable it in hwloc, - # too. Note that hwloc uses --disable-cuda, so just set - # enable_cuda=$with_cuda to get the same value that was passed in - # via the top-level --with-cuda CLI option. - enable_cuda=$with_cuda + # too. Note that hwloc uses --disable-cuda (i.e., a yes or no + # value), whereas we use --with-cuda here in Open MPI (i.e., a + # yes, no, or path value). Need to translate appropriately. + # + # Set enable_cuda to yes if: + # + # 1. --with-cuda was specified (i.e., a human specifically asked + # for it) + # 2. --with-cuda=blah was specified (i.e., a human specifically + # asked for it) + # 3. --with-cuda was not specified, but Open MPI is building CUDA + # support + # + # Set enable_cuda to no in all other cases. This logic could be + # compressed into a smaller set of if tests, but for readability / + # clarity, I left it expanded. + AC_MSG_CHECKING([for hwloc --enable-cuda value]) + enable_cuda=no + AS_IF([test "$with_cuda" = "yes"], + [enable_cuda=yes], + [AS_IF([test -n "$with_cuda" && test "$with_cuda" != "no"], + [enable_cuda=yes], + [AS_IF([test "$opal_check_cuda_happy" = "yes"], + [enable_cuda=yes]) + ]) + ]) + AC_MSG_RESULT(["$enable_cuda"]) - # Disable NVML support if CUDA support is not built - AS_IF([test "$opal_check_cuda_happy" != "yes"], - [enable_nvml=no]) + # Open MPI currently does not use hwloc's NVML support + enable_nvml=no # hwloc checks for compiler visibility, and its needs to do # this without "picky" flags.