1
1

* Embed ident strings into the Open MPI libraries using one of the following

methods (in order of precedence):
  1. #pragma ident <ident string> (e.g., Intel and Sun)
  1. #ident <ident string> (e.g., GCC)
  1. static const char ident[] = <ident string> (all others)
By default, the ident string used is the standard Open MPI version string. Only
the following libraries will get the embedded version strings (e.g., DSOs will
not):
  * libmpi.so
  * libmpi_cxx.so
  * libmpi_f77.so
  * libopen-pal.so
  * libopen-rte.so
* Added two new configure options:
  * `--with-package-name="STRING"` (defaults to "Open MPI username@hostname
    Distribution"). `STRING` is displayed by `ompi_info` next to the "Package"
    heading.
  * `--with-ident-string="STRING"` (defaults to the standard Open MPI version
    string - e.g., X.Y.Zr######). `%VERSION%` will expand to the Open MPI
    version string if it is supplied to this configure option.

This commit was SVN r16644.
Этот коммит содержится в:
Ethan Mallove 2007-11-03 02:40:22 +00:00
родитель e4646a4dd5
Коммит 005652c9d4
12 изменённых файлов: 189 добавлений и 7 удалений

Просмотреть файл

@ -10,7 +10,7 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2006 Cisco Systems, Inc.
dnl Copyright (c) 2006-2007 Cisco Systems, Inc.
dnl Copyright (c) 2006 Los Alamos National Security, LLC. All rights
dnl reserved.
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
@ -58,6 +58,7 @@ m4_include(config/ompi_config_asm.m4)
m4_include(config/ompi_case_sensitive_fs_setup.m4)
m4_include(config/ompi_check_broken_qsort.m4)
m4_include(config/ompi_check_compiler_works.m4)
m4_include(config/ompi_check_ident.m4)
m4_include(config/ompi_check_func_lib.m4)
m4_include(config/ompi_check_optflags.m4)
m4_include(config/ompi_check_attributes.m4)

88
config/ompi_check_ident.m4 Обычный файл
Просмотреть файл

@ -0,0 +1,88 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
dnl defines:
dnl OMPI_$1_USE_PRAGMA_IDENT
dnl OMPI_$1_USE_IDENT
dnl OMPI_$1_USE_CONST_CHAR_IDENT
dnl
# OMPI_CHECK_IDENT(compiler-env, compiler-flags,
# file-suffix, lang) Try to compile a source file containing
# a #pragma ident, and determine whether the ident was
# inserted into the resulting object file
# -----------------------------------------------------------
AC_DEFUN([OMPI_CHECK_IDENT], [
AC_MSG_CHECKING([for $4 ident string support])
ompi_pragma_ident_happy=0
ompi_ident_happy=0
ompi_static_const_char_happy=0
_OMPI_CHECK_IDENT(
[$1], [$2], [$3],
[[#]pragma ident],
[ompi_pragma_ident_happy=1
ompi_message="[#]pragma ident"],
_OMPI_CHECK_IDENT(
[$1], [$2], [$3],
[[#]ident],
[ompi_ident_happy=1
ompi_message="[#]ident"],
[ompi_static_const_char_happy=1
ompi_message="static const char[[]]"]))
AC_DEFINE_UNQUOTED([OMPI_$1_USE_PRAGMA_IDENT],
[$ompi_pragma_ident_happy], [Use #pragma ident strings for $4 files])
AC_DEFINE_UNQUOTED([OMPI_$1_USE_IDENT],
[$ompi_ident_happy], [Use #ident strings for $4 files])
AC_DEFINE_UNQUOTED([OMPI_$1_USE_CONST_CHAR_IDENT],
[$ompi_static_const_char_happy], [Use static const char[] strings for $4 files])
AC_MSG_RESULT([$ompi_message])
unset ompi_pragma_ident_happy ompi_ident_happy ompi_static_const_char_happy ompi_message
])
# _OMPI_CHECK_IDENT(compiler-env, compiler-flags,
# file-suffix, header, action-if-success, action-if-fail)
# Try to compile a source file containing a #-style ident,
# and determine whether the ident was inserted into the
# resulting object file
# -----------------------------------------------------------
AC_DEFUN([_OMPI_CHECK_IDENT], [
eval ompi_compiler="\$$1"
eval ompi_flags="\$$2"
ompi_ident="string_not_coincidentally_inserted_by_the_compiler"
cat > conftest.$3 <<EOF
$4 "$ompi_ident"
int main(int argc, char** argv);
int main(int argc, char** argv) { return 0; }
EOF
# "strings" won't always return the ident string. objdump isn't
# universal (e.g., OS X doesn't have it), and ...other
# complications. So just try to "grep" for the string in the
# resulting object file. If the ident is found in "strings" or
# the grep succeeds, rule that we have this flavor of ident.
OMPI_LOG_COMMAND([$ompi_compiler $ompi_flags -c conftest.$3 -o conftest],
[ompi_output="`strings -a conftest | grep $ompi_ident`"
grep $ompi_ident conftest 2>&1 1>/dev/null
ompi_status=$?
AS_IF([test "$ompi_output" != "" -o "$ompi_status" = "0"],
[$5],
[$6])],
[OMPI_LOG_MSG([the failed program was:])
OMPI_LOG_FILE([conftest.$3])
$6])
unset ompi_compiler ompi_flags ompi_output ompi_status
/bin/rm -f conftest.* conftest
])dnl

Просмотреть файл

@ -10,7 +10,8 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2006-2007 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
@ -704,4 +705,34 @@ fi
AC_DEFINE_UNQUOTED([ORTE_WANT_ORTERUN_PREFIX_BY_DEFAULT],
[$orte_want_orterun_prefix_by_default],
[Whether we want orterun to effect "--prefix $prefix" by default])
#
# Package/brand string
#
AC_MSG_CHECKING([for package/brand string])
AC_ARG_WITH([package-string],
[AC_HELP_STRING([--with-package-string=STRING],
[Use a branding string throughout Open MPI])])
if test "$with_package_string" = "" -o "$with_package_string" = "no"; then
with_package_string="Open MPI $OMPI_CONFIGURE_USER@$OMPI_CONFIGURE_HOST Distribution"
fi
AC_DEFINE_UNQUOTED([OPAL_PACKAGE_STRING], ["$with_package_string"],
[package/branding string for Open MPI])
AC_MSG_RESULT([$with_package_string])
#
# Ident string
#
AC_MSG_CHECKING([for ident string])
AC_ARG_WITH([ident-string],
[AC_HELP_STRING([--with-ident-string=STRING],
[Embed an ident string into Open MPI object files])])
if test "$with_ident_string" = "" -o "$with_ident_string" = "no"; then
with_ident_string="%VERSION%"
fi
with_ident_string="`echo $with_ident_string | sed -e 's/%VERSION%/'$OMPI_VERSION/`"
AC_DEFINE_UNQUOTED([OPAL_IDENT_STRING], ["$with_ident_string"],
[ident string for Open MPI])
AC_MSG_RESULT([$with_ident_string])
])

Просмотреть файл

@ -10,7 +10,7 @@
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2006-2007 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2006-2007 Sun Microsystems, Inc. All rights reserved.
# Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights
# reserved.
@ -187,6 +187,10 @@ OMPI_SETUP_CC
AM_CONDITIONAL(OMPI_NEED_WINDOWS_REPLACEMENTS,
test "$ompi_cv_c_compiler_vendor" = "microsoft" )
# Does the compiler support "ident"-like constructs?
OMPI_CHECK_IDENT([CC], [CFLAGS], [c], [C])
#
# Check for some types
#
@ -359,6 +363,10 @@ AC_DEFINE_UNQUOTED(OMPI_HAVE_WEAK_SYMBOLS, $OMPI_C_HAVE_WEAK_SYMBOLS,
OMPI_SETUP_CXX
# Does the compiler support "ident"-like constructs?
OMPI_CHECK_IDENT([CXX], [CXXFLAGS], [cc], [C++])
# check for type sizes
AC_LANG_PUSH(C++)
@ -369,7 +377,7 @@ AC_CHECK_SIZEOF(bool)
OMPI_C_GET_ALIGNMENT(bool, OMPI_ALIGNMENT_CXX_BOOL)
AC_LANG_POP(C++)
# check if we want C++ support
# check if we want C++ support
AM_CONDITIONAL(WANT_MPI_CXX_BINDINGS,
test "$WANT_MPI_CXX_SUPPORT" = 1)
@ -377,7 +385,6 @@ AC_DEFINE_UNQUOTED(OMPI_WANT_CXX_BINDINGS, $WANT_MPI_CXX_SUPPORT,
[Whether we want MPI cxx support or not])
##################################
# Only after setting up both
# C and C++ check compiler attributes.

Просмотреть файл

@ -10,6 +10,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -24,6 +26,7 @@
#include "opal_config.h"
#define OMPI_IDENT_STRING OPAL_IDENT_STRING
/***********************************************************************
*

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -24,6 +26,14 @@
#include "ompi/mpi/c/bindings.h"
#include "ompi/constants.h"
#if OMPI_CC_USE_PRAGMA_IDENT
#pragma ident OMPI_IDENT_STRING
#elif OMPI_CC_USE_IDENT
#ident OMPI_IDENT_STRING
#else
static const char ident[] = OMPI_IDENT_STRING;
#endif
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
#pragma weak MPI_Init = PMPI_Init
#endif

Просмотреть файл

@ -10,14 +10,14 @@
// University of Stuttgart. All rights reserved.
// Copyright (c) 2004-2005 The Regents of the University of California.
// All rights reserved.
// Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
// Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
// $COPYRIGHT$
//
// Additional copyrights may follow
//
// $HEADER$
//
#include <stdio.h>
static const int ompi_stdio_seek_set = SEEK_SET;
static const int ompi_stdio_seek_cur = SEEK_CUR;
@ -28,6 +28,14 @@ static const int ompi_stdio_seek_end = SEEK_END;
/* Need to include ompi_config.h after mpicxx.h... */
#include "ompi_config.h"
#if OMPI_CXX_USE_PRAGMA_IDENT
#pragma ident OMPI_IDENT_STRING
#elif OMPI_CXX_USE_IDENT
#ident OMPI_IDENT_STRING
#else
static const char ident[] = OMPI_IDENT_STRING;
#endif
#include "ompi/errhandler/errhandler.h"
#if OMPI_PROVIDE_MPI_FILE_INTERFACE && OMPI_WANT_MPI_CXX_SEEK

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -18,6 +20,14 @@
#include "ompi_config.h"
#if OMPI_CC_USE_PRAGMA_IDENT
#pragma ident OMPI_IDENT_STRING
#elif OMPI_CC_USE_IDENT
#ident OMPI_IDENT_STRING
#else
static const char ident[] = OMPI_IDENT_STRING;
#endif
#include "ompi/mpi/f77/bindings.h"
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER

Просмотреть файл

@ -9,6 +9,7 @@
// University of Stuttgart. All rights reserved.
// Copyright (c) 2004-2005 The Regents of the University of California.
// All rights reserved.
// Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
// $COPYRIGHT$
//
// Additional copyrights may follow
@ -125,6 +126,7 @@ void ompi_info::do_version(bool want_all, opal_cmd_line_t *cmd_line)
//
void ompi_info::show_ompi_version(const string& scope)
{
out("Package", "package", OPAL_PACKAGE_STRING);
out("Open MPI", type_ompi + ":version:full",
make_version_str(scope,
OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION,
@ -151,6 +153,7 @@ void ompi_info::show_ompi_version(const string& scope)
OPAL_WANT_SVN, OPAL_SVN_R));
out("OPAL SVN revision", type_opal + ":version:svn",
OPAL_SVN_R);
out("Ident string", "ident", OPAL_IDENT_STRING);
}

Просмотреть файл

@ -10,6 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007 Cisco, Inc. All rights reserved.
* Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -48,6 +49,13 @@
#include "opal/util/keyval_parse.h"
#include "opal/util/sys_limits.h"
#if OMPI_CC_USE_PRAGMA_IDENT
#pragma ident OPAL_IDENT_STRING
#elif OMPI_CC_USE_IDENT
#ident OPAL_IDENT_STRING
#else
static const char ident[] = OPAL_IDENT_STRING;
#endif
int opal_initialized = 0;
int opal_util_initialized = 0;

Просмотреть файл

@ -10,6 +10,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -24,6 +26,8 @@
#include "opal_config.h"
#define ORTE_IDENT_STRING OPAL_IDENT_STRING
#if defined(__WINDOWS__)
# if defined(_USRDLL) /* building shared libraries (.DLL) */

Просмотреть файл

@ -12,6 +12,7 @@
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
*
* $COPYRIGHT$
*
@ -85,6 +86,14 @@
#include "orte/runtime/orte_cr.h"
#if OMPI_CC_USE_PRAGMA_IDENT
#pragma ident ORTE_IDENT_STRING
#elif OMPI_CC_USE_IDENT
#ident ORTE_IDENT_STRING
#else
static const char ident[] = ORTE_IDENT_STRING;
#endif
int orte_init(bool infrastructure)
{
int ret;