Skip to content

Commit 3867bd3

Browse files
committed
hwloc.m4: only check for valgrind in non-embedded mode
This fixes #1732: i.e., the case where the outer project has its own check for <valgrind/valgrind.h>, but also supplements CPPFLAGS (to find Valgrind's header files) before doing that check. Signed-off-by: Jeff Squyres <[email protected]> Ideally, we would tell OMPI to disable autoconf's caching of our valgrind check result so that its check gets the right result after adding CPPFLAGS. Not sure if we can do that. For now, just disable our Valgrind code in embedded mode. This will keep the x86 backend enabled under Valgrind but it will auto-disable itself when finding identical APIC ids anyway (because CPUID returns same outputs for all PUs). Signed-off-by: Brice Goglin <[email protected]> Fixes #1732 (cherry picked from commit open-mpi/hwloc@8b44fb1)
1 parent 57978a7 commit 3867bd3

File tree

1 file changed

+12
-3
lines changed
  • opal/mca/hwloc/hwloc1113/hwloc/config

1 file changed

+12
-3
lines changed

opal/mca/hwloc/hwloc1113/hwloc/config/hwloc.m4

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dnl Copyright © 2004-2012 The Regents of the University of California.
99
dnl All rights reserved.
1010
dnl Copyright © 2004-2008 High Performance Computing Center Stuttgart,
1111
dnl University of Stuttgart. All rights reserved.
12-
dnl Copyright © 2006-2015 Cisco Systems, Inc. All rights reserved.
12+
dnl Copyright © 2006-2016 Cisco Systems, Inc. All rights reserved.
1313
dnl Copyright © 2012 Blue Brain Project, BBP/EPFL. All rights reserved.
1414
dnl Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
1515
dnl See COPYING in top-level directory.
@@ -671,8 +671,17 @@ EOF])
671671
AC_CHECK_HEADERS([sys/utsname.h])
672672
AC_CHECK_FUNCS([uname])
673673
674-
AC_CHECK_HEADERS([valgrind/valgrind.h])
675-
AC_CHECK_DECLS([RUNNING_ON_VALGRIND],,[:],[[#include <valgrind/valgrind.h>]])
674+
dnl Don't check for valgrind in embedded mode because this may conflict
675+
dnl with the embedder projects also checking for it.
676+
dnl We only use Valgrind to nicely disable the x86 backend with a warning,
677+
dnl but we can live without it in embedded mode (it auto-disables itself
678+
dnl because of invalid CPUID outputs).
679+
dnl Non-embedded checks usually go to hwloc_internal.m4 but this one is
680+
dnl is really for the core library.
681+
AS_IF([test "$hwloc_mode" != "embedded"],
682+
[AC_CHECK_HEADERS([valgrind/valgrind.h])
683+
AC_CHECK_DECLS([RUNNING_ON_VALGRIND],,[:],[[#include <valgrind/valgrind.h>]])
684+
])
676685
677686
AC_CHECK_HEADERS([pthread_np.h])
678687
AC_CHECK_DECLS([pthread_setaffinity_np],,[:],[[

0 commit comments

Comments
 (0)