Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hwloc2a/configure.m4: be more careful in with_cuda->enable_cuda #4257

Merged
merged 1 commit into from
Sep 25, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 30 additions & 8 deletions opal/mca/hwloc/hwloc2a/configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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

# Disable NVML support if CUDA support is not built
AS_IF([test "$opal_check_cuda_happy" != "yes"],
[enable_nvml=no])
# 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"])

# 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.
Expand Down