diff --git a/opal/mca/paffinity/linux/plpa/NEWS b/opal/mca/paffinity/linux/plpa/NEWS index 7a6143ec99..4c49d47b2b 100644 --- a/opal/mca/paffinity/linux/plpa/NEWS +++ b/opal/mca/paffinity/linux/plpa/NEWS @@ -3,7 +3,7 @@ Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana Corporation. All rights reserved. Copyright (c) 2004-2005 The Regents of the University of California. All rights reserved. -Copyright (c) 2006-2008 Cisco Systems, Inc. All rights reserved. +Copyright (c) 2006-2009 Cisco Systems, Inc. All rights reserved. $COPYRIGHT$ Additional copyrights may follow @@ -16,6 +16,14 @@ This file contains the main features as well as overviews of specific bug fixes (and other actions) for each version of PLPA since version 1.0. +1.3 +--- + +- Added --with-valgrind support that allows building support for + Valgrind into PLPA (i.e., tell Valgrind to not warn about things + that we know are ok). + + 1.2 --- diff --git a/opal/mca/paffinity/linux/plpa/README b/opal/mca/paffinity/linux/plpa/README index 32f7e5b7e9..ac794ed79d 100644 --- a/opal/mca/paffinity/linux/plpa/README +++ b/opal/mca/paffinity/linux/plpa/README @@ -404,6 +404,35 @@ shell$ make install Depending on your --prefix, you may need to run the "make install" step as root or some other privileged user. +There are a few noteworthy configure options listed below. The +enable/disable options are shown in their non-default form. For +example, if --enable-foo is shown below, it is because --disable-foo +is the default. + +--enable-emulate: allow using PLPA on platforms that do not have + __NR_sched_setaffinity (e.g., OS X); usually only useful in + development / testing scenarios. + +--disable-executables: do not build the PLPA executables; only build + the library. + +--enable-included-mode: build PLPA in the "included" mode (see + below). + +--enable-debug: this option is probably only helpful for PLPA + developers. + +--with-plpa-symbol-prefix=STRING: a string prefix to add to all public + PLPA symbols. This is usually only useful in included mode (see + below). + +--with-valgrind(=DIR): require building PLPA with Valgrind support + (requires finding include/valgrind/memcheck.h). This will add a + small number of Valgrind annotations in the PLPA code base that + remove false/irrelevant Valgrind warnings. The =DIR clause is only + necessary if Valgrind's header files cannot be found by the + preprocessor's default search path. + "make install" will install the following: - in $includedir (typically $prefix/include) diff --git a/opal/mca/paffinity/linux/plpa/VERSION b/opal/mca/paffinity/linux/plpa/VERSION index 863da6ce7e..319ea0c555 100644 --- a/opal/mca/paffinity/linux/plpa/VERSION +++ b/opal/mca/paffinity/linux/plpa/VERSION @@ -6,7 +6,7 @@ # ... If release is zero, then it is omitted. major=1 -minor=2 +minor=3 release=0 # greek is used for alpha or beta release tags. If it is non-empty, @@ -16,7 +16,7 @@ release=0 # requirement is that it must be entirely printable ASCII characters # and have no white space. -greek=rc2 +greek=rc1 # If want_svn=1, then the SVN r number will be included in the overall # PLPA version number in some form. @@ -33,4 +33,4 @@ want_svn=0 # distribution tarball is being made from an SVN checkout, the value # of svn_r in this file is replaced with the output of "svnversion". -svn_r=r222 +svn_r=r232 diff --git a/opal/mca/paffinity/linux/plpa/config/config.guess b/opal/mca/paffinity/linux/plpa/config/config.guess index c7607c74f1..e5716eea73 100755 --- a/opal/mca/paffinity/linux/plpa/config/config.guess +++ b/opal/mca/paffinity/linux/plpa/config/config.guess @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. -timestamp='2008-04-14' +timestamp='2009-02-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -331,7 +331,20 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize @@ -796,7 +809,7 @@ EOF x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; - EM64T | authenticamd) + EM64T | authenticamd | genuineintel) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) @@ -935,6 +948,9 @@ EOF if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -1138,6 +1154,16 @@ EOF 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; @@ -1324,6 +1350,9 @@ EOF i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff --git a/opal/mca/paffinity/linux/plpa/config/config.sub b/opal/mca/paffinity/linux/plpa/config/config.sub index 053e7381fa..d546a94b95 100755 --- a/opal/mca/paffinity/linux/plpa/config/config.sub +++ b/opal/mca/paffinity/linux/plpa/config/config.sub @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. -timestamp='2008-09-08' +timestamp='2009-02-03' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -122,6 +122,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` @@ -249,6 +250,7 @@ case $basic_machine in | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ @@ -279,7 +281,7 @@ case $basic_machine in | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ - | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -331,6 +333,7 @@ case $basic_machine in | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ @@ -362,7 +365,7 @@ case $basic_machine in | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ @@ -443,6 +446,10 @@ case $basic_machine in basic_machine=m68k-apollo os=-bsd ;; + aros) + basic_machine=i386-pc + os=-aros + ;; aux) basic_machine=m68k-apple os=-aux @@ -1182,7 +1189,7 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) @@ -1254,8 +1261,9 @@ case $os in -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ + | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ diff --git a/opal/mca/paffinity/linux/plpa/config/distscript.csh b/opal/mca/paffinity/linux/plpa/config/distscript.csh index 17146f2708..90533017b3 100755 --- a/opal/mca/paffinity/linux/plpa/config/distscript.csh +++ b/opal/mca/paffinity/linux/plpa/config/distscript.csh @@ -101,19 +101,38 @@ chmod +x config.guess config.sub # fail to be made correctly. This is a primitive attempt to fix that. # If we got zero-length files from wget, use a config.guess / # config.sub from a known location that is more recent than what ships -# in the current generation of auto* tools. +# in the current generation of auto* tools. Also check to ensure that +# the resulting scripts are runnable (Jan 2009: there are un-runnable +# scripts available right now because of some git vulnerability). +# Before you complain about this too loudly, remember that we're using +# unreleased software... + +set happy=0 if (! -f config.guess || ! -s config.guess) then - echo " - WARNING: Got BAD config.guess from ftp.gnu.org" - echo " - WARNING: using included version" + echo " - WARNING: Got bad config.guess from ftp.gnu.org (non-existent or empty)" else - cp config.guess .. + ./config.guess >& /dev/null + if ($status != 0) then + echo " - WARNING: Got bad config.guess from ftp.gnu.org (not executable)" + else + if (! -f config.sub || ! -s config.sub) then + echo " - WARNING: Got bad config.sub from ftp.gnu.org (non-existent or empty)" + else + ./config.sub `./config.guess` >& /dev/null + if ($status != 0) then + echo " - WARNING: Got bad config.sub from ftp.gnu.org (not executable)" + else + echo " - Got good config.guess and config.sub from ftp.gnu.org" + cp config.sub config.guess .. + set happy=1 + endif + endif + endif endif -if (! -f config.sub || ! -s config.sub) then - echo " - WARNING: Got BAD config.sub from ftp.gnu.org" - echo " - WARNING: using known version" -else - cp config.sub .. + +if ("$happy" == "0") then + echo " - WARNING: using included versions for both config.sub and config.guess" endif cd .. rm -rf tmp.$$ diff --git a/opal/mca/paffinity/linux/plpa/config/plpa.m4 b/opal/mca/paffinity/linux/plpa/config/plpa.m4 index 06dc8d1c62..9455706b76 100644 --- a/opal/mca/paffinity/linux/plpa/config/plpa.m4 +++ b/opal/mca/paffinity/linux/plpa/config/plpa.m4 @@ -5,7 +5,9 @@ # Corporation. All rights reserved. # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. -# Copyright (c) 2006-2008 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2004-2008 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright (c) 2006-2009 Cisco Systems, Inc. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -295,6 +297,42 @@ AC_DEFUN([_PLPA_INIT],[ [The PLPA symbol prefix in all caps]) AC_MSG_RESULT([$plpa_symbol_prefix_value]) + # Build with valgrind support if we can find it, unless it was + # explicitly disabled + AC_ARG_WITH([valgrind], + [AC_HELP_STRING([--with-valgrind(=DIR)], + [Directory where the valgrind software is installed])]) + CPPFLAGS_save="$CPPFLAGS" + valgrind_happy=no + AS_IF([test "$with_valgrind" != "no"], + [AS_IF([test ! -z "$with_valgrind" -a "$with_valgrind" != "yes"], + [CPPFLAGS="$CPPFLAGS -I$with_valgrind/include"]) + AC_CHECK_HEADERS([valgrind/valgrind.h], + [AC_MSG_CHECKING([for VALGRIND_CHECK_MEM_IS_ADDRESSABLE]) + AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[ +#include "valgrind/memcheck.h" +]], + [[char buffer = 0xff; + VALGRIND_CHECK_MEM_IS_ADDRESSABLE(&buffer, sizeof(buffer));]]), + [AC_MSG_RESULT([yes]) + valgrind_happy=yes], + [AC_MSG_RESULT([no]) + AC_MSG_ERROR([Need Valgrind version 3.2.0 or later.])] + [AC_MSG_RESULT([cross-compiling; assume yes...?]) + AC_MSG_WARN([PLPA will fail to compile if you do not have Valgrind version 3.2.0 or later]) + valgrind_happy=yes]), + ], + [AC_MSG_WARN([valgrind.h not found])]) + AS_IF([test "$valgrind_happy" = "no" -a "x$with_valgrind" != "x"], + [AC_MSG_WARN([Valgrind support requested but not possible]) + AC_MSG_ERROR([Cannot continue])])]) + AS_IF([test "$valgrind_happy" = "no"], + [CPPFLAGS="$CPPFLAGS_save" + valgrind_define=0], + [valgrind_define=1]) + AC_DEFINE_UNQUOTED([PLPA_WANT_VALGRIND_SUPPORT], [$valgrind_define], + [Whether we want Valgrind support or not]) + dnl JMS: No fortran bindings yet dnl # Check for fortran dnl AC_MSG_CHECKING([whether to build PLPA Fortran API]) diff --git a/opal/mca/paffinity/linux/plpa/configure b/opal/mca/paffinity/linux/plpa/configure index 1ef329cb17..e3f15f3479 100755 --- a/opal/mca/paffinity/linux/plpa/configure +++ b/opal/mca/paffinity/linux/plpa/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for plpa 1.2rc2. +# Generated by GNU Autoconf 2.63 for plpa 1.3rc1. # # Report bugs to . # @@ -745,8 +745,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='plpa' PACKAGE_TARNAME='plpa' -PACKAGE_VERSION='1.2rc2' -PACKAGE_STRING='plpa 1.2rc2' +PACKAGE_VERSION='1.3rc1' +PACKAGE_STRING='plpa 1.3rc1' PACKAGE_BUGREPORT='http://www.open-mpi.org/community/help/' # Factoring default headers for most tests. @@ -913,6 +913,7 @@ enable_executables enable_included_mode with_plpa_symbol_prefix enable_debug +with_valgrind enable_shared enable_static with_pic @@ -1483,7 +1484,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures plpa 1.2rc2 to adapt to many kinds of systems. +\`configure' configures plpa 1.3rc1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1553,7 +1554,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of plpa 1.2rc2:";; + short | recursive ) echo "Configuration of plpa 1.3rc1:";; esac cat <<\_ACEOF @@ -1592,6 +1593,7 @@ Optional Packages: STRING can be any valid C symbol name. It will be prefixed to all public PLPA symbols. Default: "plpa_" + --with-valgrind(=DIR) Directory where the valgrind software is installed --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] @@ -1677,7 +1679,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -plpa configure 1.2rc2 +plpa configure 1.3rc1 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1691,7 +1693,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by plpa $as_me 1.2rc2, which was +It was created by plpa $as_me 1.3rc1, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -2411,7 +2413,7 @@ fi # Define the identity of the package. PACKAGE='plpa' - VERSION='1.2rc2' + VERSION='1.3rc1' # Some tools Automake needs. @@ -5414,6 +5416,256 @@ _ACEOF { $as_echo "$as_me:$LINENO: result: $plpa_symbol_prefix_value" >&5 $as_echo "$plpa_symbol_prefix_value" >&6; } + # Build with valgrind support if we can find it, unless it was + # explicitly disabled + +# Check whether --with-valgrind was given. +if test "${with_valgrind+set}" = set; then + withval=$with_valgrind; +fi + + CPPFLAGS_save="$CPPFLAGS" + valgrind_happy=no + if test "$with_valgrind" != "no"; then + if test ! -z "$with_valgrind" -a "$with_valgrind" != "yes"; then + CPPFLAGS="$CPPFLAGS -I$with_valgrind/include" +fi + + +for ac_header in valgrind/valgrind.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------------------------------ ## +## Report this to http://www.open-mpi.org/community/help/ ## +## ------------------------------------------------------ ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + { $as_echo "$as_me:$LINENO: checking for VALGRIND_CHECK_MEM_IS_ADDRESSABLE" >&5 +$as_echo_n "checking for VALGRIND_CHECK_MEM_IS_ADDRESSABLE... " >&6; } + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include "valgrind/memcheck.h" + +int +main () +{ +char buffer = 0xff; + VALGRIND_CHECK_MEM_IS_ADDRESSABLE(&buffer, sizeof(buffer)); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + valgrind_happy=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:$LINENO: error: Need Valgrind version 3.2.0 or later." >&5 +$as_echo "$as_me: error: Need Valgrind version 3.2.0 or later." >&2;} + { (exit 1); exit 1; }; } + { $as_echo "$as_me:$LINENO: result: cross-compiling; assume yes...?" >&5 +$as_echo "cross-compiling; assume yes...?" >&6; } + { $as_echo "$as_me:$LINENO: WARNING: PLPA will fail to compile if you do not have Valgrind version 3.2.0 or later" >&5 +$as_echo "$as_me: WARNING: PLPA will fail to compile if you do not have Valgrind version 3.2.0 or later" >&2;} + valgrind_happy=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext, + +else + { $as_echo "$as_me:$LINENO: WARNING: valgrind.h not found" >&5 +$as_echo "$as_me: WARNING: valgrind.h not found" >&2;} +fi + +done + + if test "$valgrind_happy" = "no" -a "x$with_valgrind" != "x"; then + { $as_echo "$as_me:$LINENO: WARNING: Valgrind support requested but not possible" >&5 +$as_echo "$as_me: WARNING: Valgrind support requested but not possible" >&2;} + { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5 +$as_echo "$as_me: error: Cannot continue" >&2;} + { (exit 1); exit 1; }; } +fi + +fi + + if test "$valgrind_happy" = "no"; then + CPPFLAGS="$CPPFLAGS_save" + valgrind_define=0 +else + valgrind_define=1 +fi + + +cat >>confdefs.h <<_ACEOF +#define PLPA_WANT_VALGRIND_SUPPORT $valgrind_define +_ACEOF + + # Check whether to build the exectuables or not { $as_echo "$as_me:$LINENO: checking whether to build PLPA executables" >&5 @@ -6173,13 +6425,13 @@ if test "${lt_cv_nm_interface+set}" = set; then else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:6176: $ac_compile\"" >&5) + (eval echo "\"\$as_me:6428: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:6179: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:6431: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:6182: output\"" >&5) + (eval echo "\"\$as_me:6434: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -7384,7 +7636,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 7387 "configure"' > conftest.$ac_ext + echo '#line 7639 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -8689,11 +8941,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8692: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8944: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8696: \$? = $ac_status" >&5 + echo "$as_me:8948: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -9028,11 +9280,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9031: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9283: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:9035: \$? = $ac_status" >&5 + echo "$as_me:9287: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -9133,11 +9385,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9136: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9388: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9140: \$? = $ac_status" >&5 + echo "$as_me:9392: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -9188,11 +9440,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9191: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9443: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9195: \$? = $ac_status" >&5 + echo "$as_me:9447: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -11988,7 +12240,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11991 "configure" +#line 12243 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12084,7 +12336,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12087 "configure" +#line 12339 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12760,7 +13012,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by plpa $as_me 1.2rc2, which was +This file was extended by plpa $as_me 1.3rc1, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -12823,7 +13075,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -plpa config.status 1.2rc2 +plpa config.status 1.3rc1 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/opal/mca/paffinity/linux/plpa/src/libplpa/plpa_api_probe.c b/opal/mca/paffinity/linux/plpa/src/libplpa/plpa_api_probe.c index 9cc7971729..97bfd05f06 100644 --- a/opal/mca/paffinity/linux/plpa/src/libplpa/plpa_api_probe.c +++ b/opal/mca/paffinity/linux/plpa/src/libplpa/plpa_api_probe.c @@ -20,6 +20,10 @@ #include #include +#if PLPA_WANT_VALGRIND_SUPPORT +#include "valgrind/memcheck.h" +#endif + /* Cache, just to make things a little more efficient */ static PLPA_NAME(api_type_t) cache = PLPA_NAME_CAPS(PROBE_UNSET); @@ -40,7 +44,19 @@ int PLPA_NAME(api_probe_init)(void) size_t tmp = (0 != rc) ? ((size_t) rc) : len; /* Pass mask=NULL, expect errno==EFAULT if tmp was OK as a length */ +#if PLPA_WANT_VALGRIND_SUPPORT + /* Lie to Valgrind and say that this memory is addressible + so that we don't get a false positive here -- we *know* + that 0 is unaddressible; that's the whole point of this + test (to see what error NR_sched_set_affinity will + return). So let's not see a warning from Valgrind from + something that we know is wrong. :-) */ + VALGRIND_MAKE_MEM_DEFINED(0, len); +#endif rc = syscall(__NR_sched_setaffinity, 0, tmp, NULL); +#if PLPA_WANT_VALGRIND_SUPPORT + VALGRIND_MAKE_MEM_UNDEFINED(0, len); +#endif if ((rc < 0) && (errno == EFAULT)) { cache = PLPA_NAME_CAPS(PROBE_OK); PLPA_NAME(len) = tmp; diff --git a/opal/mca/paffinity/linux/plpa/src/libplpa/plpa_config.h.in b/opal/mca/paffinity/linux/plpa/src/libplpa/plpa_config.h.in index a1712d2d69..f67020e75d 100644 --- a/opal/mca/paffinity/linux/plpa/src/libplpa/plpa_config.h.in +++ b/opal/mca/paffinity/linux/plpa/src/libplpa/plpa_config.h.in @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* Define to 1 if you have the header file. */ +#undef HAVE_VALGRIND_VALGRIND_H + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR @@ -88,6 +91,9 @@ /* The PLPA symbol prefix in all caps */ #undef PLPA_SYM_PREFIX_CAPS +/* Whether we want Valgrind support or not */ +#undef PLPA_WANT_VALGRIND_SUPPORT + /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS