Merge the /tmp/jms-installdirs-trunk branch into the trunk. This
finally brings in functionality that is already on the 1.2 branch, and was developed and tested in the v1.2ofed branch (and other places). Short version of new features: * Support for ibv_fork_init() * Automatically fill in the openib BTL bandwidth value by querying the HCA port * Installdirs functionality * Fixes to always use -I in the Fortran wrapper compilers (#924) * Gleb's mpool updates * Remove some kruft in btl/openib/configure.m4, therefore fixing the harmless warnings noted in #665 * Bunches of updates to the Linux RPM spec file I.e., effectively the same thing that r14411 brought to the v1.2 branch. Also effectively brought in r14432 and r14433 (some fixes on top of the original r14411 commit to v1.2). Still need to bring in the moral equivalent of r14445 after this commit (fixes to installdirs). This commit was SVN r14449. The following SVN revision numbers were found above: r14411 --> open-mpi/ompi@83b31314ae r14432 --> open-mpi/ompi@a48f160595 r14433 --> open-mpi/ompi@68f346d2bc r14445 --> open-mpi/ompi@13d366b827
Этот коммит содержится в:
родитель
eef364546c
Коммит
0ba47105ed
@ -10,7 +10,9 @@
|
||||
# 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 Los Alamos National Security, LLC. All rights
|
||||
# reserved.
|
||||
# Copyright (c) 2006-2007 Mellanox Technologies. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
@ -28,10 +30,10 @@
|
||||
AC_DEFUN([OMPI_CHECK_OPENIB],[
|
||||
AC_ARG_WITH([openib],
|
||||
[AC_HELP_STRING([--with-openib(=DIR)],
|
||||
[Build OpenIB (InfiniBand) support, searching for libraries in DIR])])
|
||||
[Build OpenFabrics support, searching for libraries in DIR])])
|
||||
AC_ARG_WITH([openib-libdir],
|
||||
[AC_HELP_STRING([--with-openib-libdir=DIR],
|
||||
[Search for OpenIB (InfiniBand) libraries in DIR])])
|
||||
[Search for OpenFabrics libraries in DIR])])
|
||||
|
||||
AS_IF([test ! -z "$with_openib" -a "$with_openib" != "yes"],
|
||||
[ompi_check_openib_dir="$with_openib"])
|
||||
@ -40,11 +42,19 @@ AC_DEFUN([OMPI_CHECK_OPENIB],[
|
||||
AS_IF([test "$with_openib" != "no"],
|
||||
[ # check for pthreads and emit a warning that things might go south...
|
||||
AS_IF([test "$HAVE_POSIX_THREADS" != "1"],
|
||||
[AC_MSG_WARN([POSIX threads not enabled. May not be able to link with OpenIB])])
|
||||
[AC_MSG_WARN([POSIX threads not enabled. May not be able to link with OpenFabrics])])
|
||||
|
||||
ompi_check_openib_$1_save_CPPFLAGS="$CPPFLAGS"
|
||||
ompi_check_openib_$1_save_LDFLAGS="$LDFLAGS"
|
||||
ompi_check_openib_$1_save_LIBS="$LIBS"
|
||||
|
||||
AC_CHECK_HEADER([sysfs/libsysfs.h],
|
||||
[ompi_check_openib_sysfs_h=yes],
|
||||
[ompi_check_openib_sysfs_h=no])
|
||||
|
||||
AS_IF([test "$ompi_check_openib_sysfs_h" != "yes"],
|
||||
[AS_IF([test ! -z "$with_openib" -a "$with_openib" != "no"],
|
||||
[AC_MSG_ERROR([OpenFabrics support requested (via --with-openib) but required sysfs/libsysfs.h not found. Aborting])])])
|
||||
|
||||
AC_CHECK_LIB([sysfs],
|
||||
[sysfs_open_class],
|
||||
@ -55,43 +65,13 @@ AC_DEFUN([OMPI_CHECK_OPENIB],[
|
||||
|
||||
AS_IF([test "$ompi_check_openib_sysfs" != "yes"],
|
||||
[AS_IF([test ! -z "$with_openib" -a "$with_openib" != "no"],
|
||||
[AC_MSG_ERROR([OpenIB support requested but required sysfs not found. Aborting])])])
|
||||
|
||||
AC_CHECK_HEADER([sysfs/libsysfs.h],
|
||||
[ompi_check_openib_sysfs_h=yes],
|
||||
[ompi_check_openib_sysfs_h=no])
|
||||
|
||||
AS_IF([test "$ompi_check_openib_sysfs_h" != "yes"],
|
||||
[AS_IF([test ! -z "$with_openib" -a "$with_openib" != "no"],
|
||||
[AC_MSG_ERROR([OpenIB support requested but required sysfs/libsysfs.h not found. Aborting])])])
|
||||
|
||||
AS_IF([test "$ompi_check_openib_libdir" = ""],
|
||||
[ompi_check_openib_my_libdir=$ompi_check_openib_dir],
|
||||
[ompi_check_openib_my_libdir=$ompi_check_openib_libdir])
|
||||
|
||||
AS_IF([test -d "$ompi_check_openib_my_libdir/lib64/infiniband"],
|
||||
[ompi_check_openib_libflag=" -L$ompi_check_openib_my_libdir/lib64/infiniband"
|
||||
LDFLAGS="$LDFLAGS -L$ompi_check_openib_my_libdir/lib64/infiniband"],
|
||||
[AS_IF([test -d "$ompi_check_openib_my_libdir/lib/infiniband"],
|
||||
[ompi_check_openib_libflag=" -L$ompi_check_openib_my_libdir/lib/infiniband"
|
||||
LDFLAGS="$LDFLAGS -L$ompi_check_openib_my_libdir/lib/infiniband"])])
|
||||
|
||||
AS_IF([test -d "$ompi_check_openib_my_libdir/lib64"],
|
||||
[ompi_check_openib_libflag="$ompi_check_openib_libflag -L$ompi_check_openib_my_libdir/lib64"
|
||||
LDFLAGS="$LDFLAGS -L$ompi_check_openib_my_libdir/lib64"],
|
||||
[AS_IF([test -d "$ompi_check_openib_my_libdir/lib"],
|
||||
[ompi_check_openib_libflag="$ompi_check_openib_libflag -L$ompi_check_openib_my_libdir/lib"
|
||||
LDFLAGS="$LDFLAGS -L$ompi_check_openib_my_libdir/lib"])])
|
||||
|
||||
AC_CHECK_LIB([cm], [cm_timeout],
|
||||
[ompi_check_openib_libdeps="-lcm"]
|
||||
[ompi_check_openib_libdeps=""])
|
||||
[AC_MSG_ERROR([OpenFabrics support requested (via --with-openib) but required sysfs not found. Aborting])])])
|
||||
|
||||
OMPI_CHECK_PACKAGE([$1],
|
||||
[infiniband/verbs.h],
|
||||
[ibverbs],
|
||||
[ibv_open_device],
|
||||
[$ompi_check_openib_libdeps],
|
||||
[],
|
||||
[$ompi_check_openib_dir],
|
||||
[$ompi_check_openib_libdir],
|
||||
[ompi_check_openib_happy="yes"],
|
||||
@ -126,19 +106,19 @@ AC_DEFUN([OMPI_CHECK_OPENIB],[
|
||||
AC_CHECK_FUNCS([ibv_create_srq], [ompi_check_openib_have_srq=1], [ompi_check_openib_have_srq=0])
|
||||
AC_DEFINE_UNQUOTED([OMPI_MCA_]m4_translit([$1], [a-z], [A-Z])[_HAVE_SRQ],
|
||||
[$ompi_check_openib_have_srq],
|
||||
[Whether install of OpenIB includes shared receive queue support])
|
||||
[Whether install of OpenFabrics includes shared receive queue support])
|
||||
|
||||
AC_CHECK_FUNCS([ibv_get_device_list],
|
||||
[ompi_check_openib_have_device_list=1],
|
||||
[ompi_check_openib_have_device_list=0])
|
||||
AC_DEFINE_UNQUOTED([OMPI_MCA_]m4_translit([$1], [a-z], [A-Z])[_HAVE_DEVICE_LIST],
|
||||
[$ompi_check_openib_have_device_list],
|
||||
[Whether install of OpenIB includes ibv_get_device_list API])
|
||||
[Whether install of OpenFabrics includes ibv_get_device_list API])
|
||||
|
||||
AC_CHECK_FUNCS([ibv_resize_cq], [ompi_check_openib_have_resize_cq=1], [ompi_check_openib_have_resize_cq=0])
|
||||
AC_DEFINE_UNQUOTED([OMPI_MCA_]m4_translit([$1], [a-z], [A-Z])[_HAVE_RESIZE_CQ],
|
||||
[$ompi_check_openib_have_resize_cq],
|
||||
[Whether install of OpenIB includes resize completion queue support])
|
||||
[Whether install of OpenFabrics includes resize completion queue support])
|
||||
|
||||
CPPFLAGS="$ompi_check_openib_$1_save_CPPFLAGS"
|
||||
LDFLAGS="$ompi_check_openib_$1_save_LDFLAGS"
|
||||
@ -148,9 +128,7 @@ AC_DEFUN([OMPI_CHECK_OPENIB],[
|
||||
AS_IF([test "$ompi_check_openib_happy" = "yes"],
|
||||
[$2],
|
||||
[AS_IF([test ! -z "$with_openib" -a "$with_openib" != "no"],
|
||||
[AC_MSG_ERROR([OpenIB support requested but not found. Aborting])])
|
||||
[AC_MSG_ERROR([OpenFabrics support requested (via --with-openib) but not found. Aborting])])
|
||||
$3])
|
||||
|
||||
$1_LDFLAGS="$$1_LDFLAGS $ompi_check_openib_libflag"
|
||||
])
|
||||
|
||||
|
@ -33,22 +33,22 @@ AC_DEFUN([OMPI_INSTALL_DIRS], [
|
||||
# be done later so that NONE doesn't show up in the
|
||||
# {exec_}prefix-based variables.
|
||||
test "x$prefix" = xNONE && prefix=$ac_default_prefix
|
||||
test "x$exec_prefix" = xNONE && exec_prefix="$prefix"
|
||||
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
|
||||
eval datarootdir="$datarootdir"
|
||||
|
||||
OPAL_PREFIX="$prefix"
|
||||
OPAL_EXEC_PREFIX="$exec_prefix"
|
||||
eval OPAL_BINDIR="$bindir"
|
||||
eval OPAL_SBINDIR="$sbindir"
|
||||
eval OPAL_LIBEXECDIR="$libexecdir"
|
||||
eval OPAL_DATADIR="$datadir"
|
||||
eval OPAL_SYSCONFDIR="$sysconfdir"
|
||||
eval OPAL_SHAREDSTATEDIR="$sharedstatedir"
|
||||
eval OPAL_LOCALSTATEDIR="$localstatedir"
|
||||
eval OPAL_LIBDIR="$libdir"
|
||||
eval OPAL_INCLUDEDIR="$includedir"
|
||||
eval OPAL_INFODIR="$infodir"
|
||||
eval OPAL_MANDIR="$mandir"
|
||||
OPAL_BINDIR="$bindir"
|
||||
OPAL_SBINDIR="$sbindir"
|
||||
OPAL_LIBEXECDIR="$libexecdir"
|
||||
OPAL_DATADIR="$datadir"
|
||||
OPAL_SYSCONFDIR="$sysconfdir"
|
||||
OPAL_SHAREDSTATEDIR="$sharedstatedir"
|
||||
OPAL_LOCALSTATEDIR="$localstatedir"
|
||||
OPAL_LIBDIR="$libdir"
|
||||
OPAL_INCLUDEDIR="$includedir"
|
||||
OPAL_INFODIR="$infodir"
|
||||
OPAL_MANDIR="$mandir"
|
||||
|
||||
AC_SUBST(OPAL_PREFIX)
|
||||
AC_SUBST(OPAL_EXEC_PREFIX)
|
||||
|
@ -1132,8 +1132,6 @@ OMPI_SETUP_WRAPPER_FINAL
|
||||
|
||||
ompi_show_subtitle "Final output"
|
||||
|
||||
OMPI_INSTALL_DIRS(opal/include/opal/install_dirs.h)
|
||||
|
||||
AM_CONFIG_HEADER([opal/include/opal_config.h orte/include/orte_config.h ompi/include/ompi_config.h ompi/include/mpi.h])
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
|
265
contrib/dist/linux/openmpi.spec
поставляемый
265
contrib/dist/linux/openmpi.spec
поставляемый
@ -48,12 +48,15 @@
|
||||
%{!?install_in_opt: %define install_in_opt 0}
|
||||
|
||||
# Define this if you want this RPM to install environment setup
|
||||
# scripts in /etc/profile.d. Only used if install_in_opt is true.
|
||||
# shell scripts.
|
||||
# type: bool (0/1)
|
||||
%{!?install_profile_d_scripts: %define install_profile_d_scripts 0}
|
||||
%{!?install_shell_scripts: %define install_shell_scripts 0}
|
||||
# type: string (root path to install shell scripts)
|
||||
%{!?shell_scripts_path: %define shell_scripts_path %{_bindir}}
|
||||
# type: string (base name of the shell scripts)
|
||||
%{!?shell_scripts_basename: %define shell_scripts_basename mpivars-%{version}}
|
||||
|
||||
# Define this to 1 if you want this RPM to install a modulefile. Only
|
||||
# used if install_in_opt is true.
|
||||
# Define this to 1 if you want this RPM to install a modulefile.
|
||||
# type: bool (0/1)
|
||||
%{!?install_modulefile: %define install_modulefile 0}
|
||||
# type: string (root path to install modulefiles)
|
||||
@ -67,6 +70,17 @@
|
||||
# type: string (name of modules RPM)
|
||||
%{!?modules_rpm_name: %define modules_rpm_name modules}
|
||||
|
||||
# Should we use the mpi-selector functionality?
|
||||
# type: bool (0/1)
|
||||
%{!?use_mpi_selector: %define use_mpi_selector 0}
|
||||
# The name of the mpi-selector RPM. Can vary from system to system.
|
||||
# type: string (name of mpi-selector RPM)
|
||||
%{!?mpi_selector_rpm_name: %define mpi_selector_rpm_name mpi-selector}
|
||||
# The location of the mpi-selector executable (can be a relative path
|
||||
# name if "mpi-selector" can be found in the path)
|
||||
# type: string (path to mpi-selector exectuable)
|
||||
%{!?mpi_selector: %define mpi_selector mpi-selector}
|
||||
|
||||
# Should we build a debuginfo RPM or not?
|
||||
# type: bool (0/1)
|
||||
%{!?build_debuginfo_rpm: %define build_debuginfo_rpm 0}
|
||||
@ -83,8 +97,16 @@
|
||||
# unpackaged files)? It is discouraged to disable this, but some
|
||||
# installers need it (e.g., OFED, because it installs lots of other
|
||||
# stuff in the BUILD_ROOT before Open MPI).
|
||||
# type: bool (0/1)
|
||||
%{!?use_check_files: %define use_check_files 1}
|
||||
|
||||
# Should we use the traditional % build and % install sections? Or
|
||||
# should we combine them both into % install? This is entirely
|
||||
# motivated by the OFED installer where, on SLES, the % build macro
|
||||
# will completely remove the BUILD_ROOT before building (which breaks
|
||||
# some assumptions in the OFED installer). Ick!
|
||||
# type: bool (0/1)
|
||||
%{!?munge_build_into_install: %define munge_build_into_install 0}
|
||||
|
||||
#############################################################################
|
||||
#
|
||||
@ -106,11 +128,18 @@
|
||||
#
|
||||
# OFED-specific defaults
|
||||
#
|
||||
# Tailored for the peculiar requirements of the OFED installer; not
|
||||
# necessary for when building this SRPM outside of the OFED installer.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
%if %{ofed}
|
||||
%define leave_build_root 1
|
||||
%define use_check_files 0
|
||||
%define install_shell_scripts 1
|
||||
%define shell_scripts_basename mpivars
|
||||
%define munge_build_into_install 1
|
||||
%define use_mpi_selector 1
|
||||
%endif
|
||||
|
||||
|
||||
@ -139,6 +168,8 @@
|
||||
%global _sysconfdir %{_prefix}/etc
|
||||
%endif
|
||||
|
||||
%{!?_pkgdatadir: %define _pkgdatadir %{_datadir}/%{name}}
|
||||
|
||||
%if !%{use_check_files}
|
||||
%define __check_files %{nil}
|
||||
%endif
|
||||
@ -155,7 +186,7 @@
|
||||
Summary: A powerful implementaion of MPI
|
||||
Name: %{?_name:%{_name}}%{!?_name:openmpi}
|
||||
Version: $VERSION
|
||||
Release: 1
|
||||
Release: 2
|
||||
License: BSD
|
||||
Group: Development/Libraries
|
||||
Source: openmpi-%{version}.tar.$EXTENSION
|
||||
@ -168,6 +199,9 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
|
||||
%if %{install_modulefile}
|
||||
Requires: %{modules_rpm_name}
|
||||
%endif
|
||||
%if %{use_mpi_selector}
|
||||
Requires: %{mpi_selector_rpm_name}
|
||||
%endif
|
||||
|
||||
%description
|
||||
Open MPI is a project combining technologies and resources from
|
||||
@ -254,7 +288,7 @@ This subpackage provides the documentation for Open MPI.
|
||||
# do not want to delete the prior RPM_BUILD_ROOT because there may be
|
||||
# other stuff in there that we need (e.g., the OFED installer installs
|
||||
# everything into RPM_BUILD_ROOT that OMPI needs to compile, like the
|
||||
# OpenIB drivers).
|
||||
# OpenFabrics drivers).
|
||||
%if !%{leave_build_root}
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
%endif
|
||||
@ -267,44 +301,74 @@ rm -rf $RPM_BUILD_ROOT
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
# See note above about %{munge_build_into_install}
|
||||
%if %{munge_build_into_install}
|
||||
%install
|
||||
%else
|
||||
%build
|
||||
%endif
|
||||
|
||||
# Non-gcc compilers cannot use FORTIFY_SOURCE (at least, not as of 6
|
||||
# Oct 2006). So if we're not GCC, strip out any -DFORTIFY_SOURCE
|
||||
# arguments in the RPM_OPT_FLAGS before potentially propagating them
|
||||
# everywhere. We can really only examine the basename of the
|
||||
# compiler, so search for it in a few places.
|
||||
# rpmbuild processes seem to be geared towards the GNU compilers --
|
||||
# they pass in some flags that will only work with gcc. So if we're
|
||||
# trying to build with some other compiler, the process will choke.
|
||||
# This is *not* something the user can override with a well-placed
|
||||
# --define on the rpmbuild command line, unless they find and override
|
||||
# all "global" CFLAGS kinds of RPM macros (every distro names them
|
||||
# differently). For example, non-gcc compilers cannot use
|
||||
# FORTIFY_SOURCE (at least, not as of 6 Oct 2006).
|
||||
|
||||
fortify_source=1
|
||||
using_gcc=1
|
||||
if test "$CC" != ""; then
|
||||
if test "`basename $CC`" != "gcc"; then
|
||||
fortify_source=0
|
||||
# Do horrible things to get the basename of just the compiler,
|
||||
# particularly in the case of multword values for $CC
|
||||
eval "set $CC"
|
||||
if test "`basename $1`" != "gcc"; then
|
||||
using_gcc=0
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$fortify_source" = "1"; then
|
||||
compiler="`echo %{configure_options} | sed -e 's@.* CC=\([^ ]*\).*@\1@'`"
|
||||
# If that didn't find it, try for CC at the beginning of the line
|
||||
if test "$compiler" = "%{configure_options}"; then
|
||||
compiler="`echo %{configure_options} | sed -e 's@^CC=\([^ ]*\).*@\1@'`"
|
||||
fi
|
||||
if test "$using_gcc" = "1"; then
|
||||
# Do wretched things to find a CC=* token
|
||||
eval "set -- %{configure_options}"
|
||||
compiler=
|
||||
while test "$1" != "" -a "$compiler" = ""; do
|
||||
case "$1" in
|
||||
CC=*)
|
||||
compiler=`echo $1 | cut -d= -f2-`
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# Now that we *might* have the compiler name, do a best-faith
|
||||
# effort to see if it's gcc. Blah!
|
||||
if test "$compiler" != ""; then
|
||||
if test "`basename $compiler`" != "gcc"; then
|
||||
fortify_source=0
|
||||
using_gcc=0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$fortify_source" = 0; then
|
||||
# If we're not GCC, strip out any GCC-specific arguments in the
|
||||
# RPM_OPT_FLAGS before potentially propagating them everywhere. We
|
||||
# can really only examine the basename of the compiler, so search for
|
||||
# it in a few places.
|
||||
|
||||
if test "$using_gcc" = 0; then
|
||||
|
||||
# Non-gcc compilers cannot handle FORTIFY_SOURCE (at least, not as
|
||||
# of Oct 2006)
|
||||
RPM_OPT_FLAGS="`echo $RPM_OPT_FLAGS | sed -e 's@-D_FORTIFY_SOURCE[=0-9]*@@'`"
|
||||
|
||||
# Non-gcc compilers will generate warnings for several flags
|
||||
# placed in RPM_OPT_FLAGS by RHEL5, but -mtune=generic will cause
|
||||
# an error for icc 9.1.
|
||||
RPM_OPT_FLAGS="`echo $RPM_OPT_FLAGS | sed -e 's@-mtune=generic@@'`"
|
||||
fi
|
||||
|
||||
CFLAGS="%{?cflags:%{cflags}}%{!?cflags:$RPM_OPT_FLAGS}"
|
||||
CXXFLAGS="%{?cxxflags:%{cxxflags}}%{!?cxxflags:$RPM_OPT_FLAGS}"
|
||||
F77FLAGS="%{?f77flags:%{f77flags}}%{!?f7flags:$RPM_OPT_FLAGS}"
|
||||
FFLAGS="%{?f77flags:%{f77flags}}%{!?f7flags:$RPM_OPT_FLAGS}"
|
||||
FCFLAGS="%{?fcflags:%{fcflags}}%{!?fcflags:$RPM_OPT_FLAGS}"
|
||||
export CFLAGS CXXFLAGS F77FLAGS FCFLAGS
|
||||
|
||||
@ -317,13 +381,13 @@ export CFLAGS CXXFLAGS F77FLAGS FCFLAGS
|
||||
# Install Section
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
# See note above about %{munge_build_into_install}
|
||||
%if !%{munge_build_into_install}
|
||||
%install
|
||||
%endif
|
||||
%{__make} install DESTDIR=$RPM_BUILD_ROOT %{?mflags_install}
|
||||
|
||||
# An attempt to make enviornment happier when installed into non /usr path
|
||||
|
||||
%if %{install_in_opt}
|
||||
|
||||
# First, the [optional] modulefile
|
||||
|
||||
%if %{install_modulefile}
|
||||
@ -341,69 +405,70 @@ proc ModulesHelp { } {
|
||||
|
||||
module-whatis "Sets up Open MPI v%{version} in your enviornment"
|
||||
|
||||
append-path PATH "%{_prefix}/bin/"
|
||||
append-path LD_LIBRARY_PATH %{_libdir}
|
||||
append-path MANPATH %{_mandir}
|
||||
%if %{lanl}
|
||||
setenv MPI_ROOT %{_prefix}
|
||||
setenv MPIHOME %{_prefix}
|
||||
# These flags are now obsolete -- use mpicc (etc.)
|
||||
setenv MPI_LD_FLAGS ""
|
||||
setenv MPI_COMPILE_FLAGS ""
|
||||
%endif
|
||||
prepend-path PATH "%{_prefix}/bin/"
|
||||
prepend-path LD_LIBRARY_PATH %{_libdir}
|
||||
prepend-path MANPATH %{_mandir}
|
||||
EOF
|
||||
%endif
|
||||
# End of modulefile if
|
||||
|
||||
# Next, the [optional] profile.d scripts
|
||||
# Next, the [optional] shell scripts
|
||||
|
||||
%if %{install_profile_d_scripts}
|
||||
%{__mkdir_p} $RPM_BUILD_ROOT/etc/profile.d/
|
||||
cat <<EOF > $RPM_BUILD_ROOT/etc/profile.d/%{name}-%{version}.sh
|
||||
%if %{install_shell_scripts}
|
||||
%{__mkdir_p} $RPM_BUILD_ROOT/%{shell_scripts_path}
|
||||
cat <<EOF > $RPM_BUILD_ROOT/%{shell_scripts_path}/%{shell_scripts_basename}.sh
|
||||
# NOTE: This is an automatically-generated file! (generated by the
|
||||
# Open MPI RPM). Any changes made here will be lost a) if the RPM is
|
||||
# uninstalled, or b) if the RPM is upgraded or uninstalled.
|
||||
# Open MPI RPM). Any changes made here will be lost if the RPM is
|
||||
# uninstalled or upgraded.
|
||||
|
||||
CHANGED=0
|
||||
if test -z "`echo $PATH | grep %{_prefix}/bin`"; then
|
||||
PATH=\${PATH}:%{_prefix}/bin/
|
||||
CHANGED=1
|
||||
# PATH
|
||||
if test -z "\`echo \$PATH | grep %{_bindir}\`"; then
|
||||
PATH=%{_bindir}:\${PATH}
|
||||
export PATH
|
||||
fi
|
||||
if test -z "`echo $LD_LIBRARY_PATH | grep %{_libdir}`"; then
|
||||
LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:%{_libdir}
|
||||
CHANGED=1
|
||||
|
||||
# LD_LIBRARY_PATH
|
||||
if test -z "\`echo \$LD_LIBRARY_PATH | grep %{_libdir}\`"; then
|
||||
LD_LIBRARY_PATH=%{_libdir}:\${LD_LIBRARY_PATH}
|
||||
export LD_LIBRARY_PATH
|
||||
fi
|
||||
if test -z "`echo $MANPATH | grep %{_mandir}`"; then
|
||||
MANPATH=\${MANPATH}:%{_mandir}
|
||||
CHANGED=1
|
||||
fi
|
||||
if test "$CHANGED" = "1"; then
|
||||
export PATH LD_LIBRARY_PATH MANPATH
|
||||
|
||||
# MANPATH
|
||||
if test -z "\`echo \$MANPATH | grep %{_mandir}\`"; then
|
||||
MANPATH=%{_mandir}:\${MANPATH}
|
||||
export MANPATH
|
||||
fi
|
||||
EOF
|
||||
cat <<EOF > $RPM_BUILD_ROOT/etc/profile.d/%{name}-%{version}.csh
|
||||
cat <<EOF > $RPM_BUILD_ROOT/%{shell_scripts_path}/%{shell_scripts_basename}.csh
|
||||
# NOTE: This is an automatically-generated file! (generated by the
|
||||
# Open MPI RPM). Any changes made here will be lost a) if the RPM is
|
||||
# uninstalled, or b) if the RPM is upgraded or uninstalled.
|
||||
# Open MPI RPM). Any changes made here will be lost if the RPM is
|
||||
# uninstalled or upgraded.
|
||||
|
||||
if ("`echo $PATH | grep %{_prefix}/bin`") then
|
||||
setenv PATH \${PATH}:%{_prefix}/bin/
|
||||
# path
|
||||
if ("" == "\`echo \$path | grep %{_bindir}\`") then
|
||||
set path=(%{_bindir} \$path)
|
||||
endif
|
||||
if ("$?LD_LIBRARY_PATH") then
|
||||
if ("`echo $LD_LIBRARY_PATH | grep %{_libdir}`") then
|
||||
setenv LD_LIBRARY_PATH \${LD_LIBRARY_PATH}:%{_libdir}
|
||||
|
||||
# LD_LIBRARY_PATH
|
||||
if ("1" == "\$?LD_LIBRARY_PATH") then
|
||||
if ("\$LD_LIBRARY_PATH" !~ *%{_libdir}*) then
|
||||
setenv LD_LIBRARY_PATH %{_libdir}:\${LD_LIBRARY_PATH}
|
||||
endif
|
||||
else
|
||||
setenv LD_LIBRARY_PATH %{_libdir}
|
||||
endif
|
||||
if ("$?MANPATH") then
|
||||
if ("`echo $MANPATH | grep %{_mandir}`") then
|
||||
setenv MANPATH \${MANPATH}:%{_mandir}
|
||||
|
||||
# MANPATH
|
||||
if ("1" == "\$?MANPATH") then
|
||||
if ("\$MANPATH" !~ *%{_mandir}*) then
|
||||
setenv MANPATH %{_mandir}:\${MANPATH}
|
||||
endif
|
||||
else
|
||||
setenv MANPATH %{_mandir}:
|
||||
endif
|
||||
EOF
|
||||
%endif
|
||||
# End of profile.d if
|
||||
%endif
|
||||
# End of install_in_opt if
|
||||
# End of shell_scripts if
|
||||
|
||||
%if !%{build_all_in_one_rpm}
|
||||
|
||||
@ -436,7 +501,7 @@ find $RPM_BUILD_ROOT -type f -o -type l | \
|
||||
#############################################################################
|
||||
%clean
|
||||
# Remove installed driver after rpm build finished
|
||||
rm -rf $RPM_BUILD_DIR/%{_name}-%{_version}
|
||||
rm -rf $RPM_BUILD_DIR/%{name}-%{version}
|
||||
|
||||
# Leave $RPM_BUILD_ROOT in order to build dependent packages, if desired
|
||||
%if !%{leave_build_root}
|
||||
@ -445,14 +510,27 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
#############################################################################
|
||||
#
|
||||
# Post (Un)Install Section
|
||||
# Post Install Section
|
||||
#
|
||||
#############################################################################
|
||||
%if %{use_mpi_selector}
|
||||
%post
|
||||
# Stub
|
||||
%{mpi_selector} \
|
||||
--register %{name}-%{version} \
|
||||
--source-dir %{shell_scripts_path} \
|
||||
--yes
|
||||
%endif
|
||||
|
||||
%postun
|
||||
# Stub
|
||||
#############################################################################
|
||||
#
|
||||
# Pre Uninstall Section
|
||||
#
|
||||
#############################################################################
|
||||
%if %{use_mpi_selector}
|
||||
%preun
|
||||
%{mpi_selector} --unregister %{name}-%{version} --yes || \
|
||||
/bin/true > /dev/null 2> /dev/null
|
||||
%endif
|
||||
|
||||
#############################################################################
|
||||
#
|
||||
@ -485,10 +563,10 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
|
||||
%if %{install_modulefile}
|
||||
%{modulefile_path}
|
||||
%endif
|
||||
# If we're installing the profile.d scripts, get those, too
|
||||
%if %{install_profile_d_scripts}
|
||||
/etc/profile.d/%{name}-%{version}.sh
|
||||
/etc/profile.d/%{name}-%{version}.csh
|
||||
# If we're installing the shell scripts, get those, too
|
||||
%if %{install_shell_scripts}
|
||||
%{shell_scripts_path}/%{shell_scripts_basename}.sh
|
||||
%{shell_scripts_path}/%{shell_scripts_basename}.csh
|
||||
%endif
|
||||
%doc README INSTALL LICENSE
|
||||
|
||||
@ -520,10 +598,10 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
|
||||
%if %{install_modulefile}
|
||||
%{modulefile_path}
|
||||
%endif
|
||||
# If we're installing the profile.d scripts, get those, too
|
||||
%if %{install_profile_d_scripts}
|
||||
/etc/profile.d/%{name}-%{version}.sh
|
||||
/etc/profile.d/%{name}-%{version}.csh
|
||||
# If we're installing the shell scripts, get those, too
|
||||
%if %{install_shell_scripts}
|
||||
%{shell_scripts_path}/%{shell_scripts_basename}.sh
|
||||
%{shell_scripts_path}/%{shell_scripts_basename}.csh
|
||||
%endif
|
||||
%dir %{_bindir}
|
||||
%dir %{_libdir}
|
||||
@ -565,7 +643,26 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
|
||||
#
|
||||
#############################################################################
|
||||
%changelog
|
||||
* Fri Oct 6 2006 Jeff Squyes <jsquyres@cisco.com>
|
||||
* Thu Apr 12 2007 Jeff Squyres <jsquyres@cisco.com>
|
||||
- Ensure that _pkglibdir is always defined, suggested by Greg Kurtzer.
|
||||
|
||||
* Wed Apr 4 2007 Jeff Squyres <jsquyres@cisco.com>
|
||||
- Fix several mistakes in the generated profile.d scripts
|
||||
- Fix several bugs with identifying non-GNU compilers, stripping of
|
||||
FORTIFY_SOURCE, -mtune, etc.
|
||||
|
||||
* Fri Feb 9 2007 Jeff Squyres <jsquyres@cisco.com>
|
||||
- Revamp to make profile.d scripts more general: default to making the
|
||||
shell script files be %{_bindir}/mpivars.{sh|csh}
|
||||
- Add %{munge_build_into_install} option for OFED 1.2 installer on SLES
|
||||
- Change shell script files and modulefile to *pre*pend all the OMPI paths
|
||||
- Make shell script and modulefile installation indepdendent of
|
||||
%{install_in_opt} (they're really separate issues)
|
||||
- Add more "ofed" shortcut qualifiers
|
||||
- Slightly better test for basename CC in the fortify source section
|
||||
- Fix some problems in the csh shell script
|
||||
|
||||
* Fri Oct 6 2006 Jeff Squyres <jsquyres@cisco.com>
|
||||
- Remove LANL section; they don't want it
|
||||
- Add some help for OFED building
|
||||
- Remove some outdated "rm -f" lines for executables that we no longer ship
|
||||
|
@ -138,6 +138,10 @@ struct mca_btl_openib_component_t {
|
||||
/** Whether we want a warning if non default GID prefix is not configured
|
||||
on multiport setup */
|
||||
bool warn_default_gid_prefix;
|
||||
#ifdef HAVE_IBV_FORK_INIT
|
||||
/** Whether we want fork support or not */
|
||||
int want_fork_support;
|
||||
#endif
|
||||
}; typedef struct mca_btl_openib_component_t mca_btl_openib_component_t;
|
||||
|
||||
OMPI_MODULE_DECLSPEC extern mca_btl_openib_component_t mca_btl_openib_component;
|
||||
|
@ -49,7 +49,6 @@
|
||||
|
||||
#include "ompi/datatype/convertor.h"
|
||||
#include "ompi/mca/mpool/mpool.h"
|
||||
#include <sysfs/libsysfs.h>
|
||||
#include <infiniband/verbs.h>
|
||||
#include <errno.h>
|
||||
#include <string.h> /* for strerror()*/
|
||||
@ -305,7 +304,7 @@ static int init_one_port(opal_list_t *btl_list, mca_btl_openib_hca_t *hca,
|
||||
mca_btl_base_selected_module_t *ib_selected;
|
||||
union ibv_gid gid;
|
||||
uint64_t subnet_id;
|
||||
|
||||
|
||||
ibv_query_gid(hca->ib_dev_context, port_num, 0, &gid);
|
||||
subnet_id = ntoh64(gid.global.subnet_prefix);
|
||||
BTL_VERBOSE(("my subnet_id is %016x\n", subnet_id));
|
||||
@ -347,6 +346,54 @@ static int init_one_port(opal_list_t *btl_list, mca_btl_openib_hca_t *hca,
|
||||
openib_btl->port_info.mtu = hca->mtu;
|
||||
openib_btl->ib_reg[MCA_BTL_TAG_BTL].cbfunc = btl_openib_control;
|
||||
openib_btl->ib_reg[MCA_BTL_TAG_BTL].cbdata = NULL;
|
||||
|
||||
/* Auto-detect the port bandwidth */
|
||||
if (0 == openib_btl->super.btl_bandwidth) {
|
||||
/* To calculate the bandwidth available on this port,
|
||||
we have to look up the values corresponding to
|
||||
port->active_speed and port->active_width. These
|
||||
are enums corresponding to the IB spec. Overall
|
||||
forumula is 80% of the reported speed (to get the
|
||||
true link speed) times the number of links. */
|
||||
switch (ib_port_attr->active_speed) {
|
||||
case 1:
|
||||
/* 2.5Gbps * 0.8, in megabits */
|
||||
openib_btl->super.btl_bandwidth = 2000;
|
||||
break;
|
||||
case 2:
|
||||
/* 5.0Gbps * 0.8, in megabits */
|
||||
openib_btl->super.btl_bandwidth = 4000;
|
||||
break;
|
||||
case 4:
|
||||
/* 10.0Gbps * 0.8, in megabits */
|
||||
openib_btl->super.btl_bandwidth = 8000;
|
||||
break;
|
||||
default:
|
||||
/* Who knows? */
|
||||
return OMPI_ERR_VALUE_OUT_OF_BOUNDS;
|
||||
}
|
||||
switch (ib_port_attr->active_width) {
|
||||
case 1:
|
||||
/* 1x */
|
||||
/* unity */
|
||||
break;
|
||||
case 2:
|
||||
/* 4x */
|
||||
openib_btl->super.btl_bandwidth *= 4;
|
||||
break;
|
||||
case 4:
|
||||
/* 8x */
|
||||
openib_btl->super.btl_bandwidth *= 8;
|
||||
break;
|
||||
case 8:
|
||||
/* 12x */
|
||||
openib_btl->super.btl_bandwidth *= 12;
|
||||
break;
|
||||
default:
|
||||
/* Who knows? */
|
||||
return OMPI_ERR_VALUE_OUT_OF_BOUNDS;
|
||||
}
|
||||
}
|
||||
opal_list_append(btl_list, (opal_list_item_t*) ib_selected);
|
||||
hca->btls++;
|
||||
++mca_btl_openib_component.ib_num_btls;
|
||||
@ -576,6 +623,26 @@ btl_openib_component_init(int *num_btl_modules,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* If we want fork support, try to enable it */
|
||||
#ifdef HAVE_IBV_FORK_INIT
|
||||
if (0 != mca_btl_openib_component.want_fork_support) {
|
||||
if (0 != ibv_fork_init()) {
|
||||
/* If the want_fork_support MCA parameter is >0, then the
|
||||
user was specifically asking for fork support and we
|
||||
couldn't provide it. So print an error and deactivate
|
||||
this BTL. */
|
||||
if (mca_btl_openib_component.want_fork_support > 0) {
|
||||
opal_show_help("help-mpi-btl-openib.txt",
|
||||
"ibv_fork_init fail", true,
|
||||
orte_system_info.nodename);
|
||||
mca_btl_openib_component.ib_num_btls = 0;
|
||||
btl_openib_modex_send();
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if OMPI_MCA_BTL_OPENIB_HAVE_DEVICE_LIST
|
||||
ib_devs = ibv_get_device_list(&num_devs);
|
||||
#else
|
||||
|
@ -9,7 +9,8 @@
|
||||
* 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 Mellanox Technologies. All rights reserved.
|
||||
* Copyright (c) 2006-2007 Mellanox Technologies. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
@ -22,6 +23,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "opal/mca/installdirs/installdirs.h"
|
||||
#include "opal/util/output.h"
|
||||
#include "opal/util/show_help.h"
|
||||
#include "opal/mca/base/mca_base_param.h"
|
||||
@ -98,7 +100,7 @@ static inline int reg_int(const char* param_name, const char* param_desc,
|
||||
int btl_openib_register_mca_params(void)
|
||||
{
|
||||
char *msg, *str;
|
||||
int ival, ret, tmp;
|
||||
int ival, ival2, ret, tmp;
|
||||
|
||||
ret = OMPI_SUCCESS;
|
||||
#define CHECK(expr) \
|
||||
@ -118,10 +120,31 @@ int btl_openib_register_mca_params(void)
|
||||
"Warn when there is more than one active ports and at least one of them connected to the network with only default GID prefix configured (0 = do not warn; any other value = warn)",
|
||||
1, &ival, 0));
|
||||
mca_btl_openib_component.warn_default_gid_prefix = (0 != ival);
|
||||
asprintf(&str, "%s/mca-btl-openib-hca-params.ini", PKGDATADIR);
|
||||
asprintf(&str, "%s/mca-btl-openib-hca-params.ini",
|
||||
opal_install_dirs.pkgdatadir);
|
||||
if (NULL == str) {
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
#ifdef HAVE_IBV_FORK_INIT
|
||||
ival2 = -1;
|
||||
#else
|
||||
ival2 = 0;
|
||||
#endif
|
||||
CHECK(reg_int("want_fork_support",
|
||||
"Whether fork support is desired or not "
|
||||
"(negative = try to enable fork support, but continue even if it is not available, 0 = do not enable fork support, positive = try to enable fork support and fail if it is not available)",
|
||||
ival2, &ival, 0));
|
||||
#ifdef HAVE_IBV_FORK_INIT
|
||||
mca_btl_openib_component.want_fork_support = ival;
|
||||
#else
|
||||
if (0 != ival) {
|
||||
opal_show_help("help-mpi-btl-openib.txt",
|
||||
"ibv_fork requested but not supported", true,
|
||||
orte_system_info.nodename);
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
#endif
|
||||
|
||||
CHECK(reg_string("hca_param_files",
|
||||
"Colon-delimited list of INI-style files that contain HCA vendor/part-specific parameters",
|
||||
str, &mca_btl_openib_component.hca_params_file_names, 0));
|
||||
@ -207,8 +230,7 @@ int btl_openib_register_mca_params(void)
|
||||
5, &ival, REGINT_GE_ZERO));
|
||||
mca_btl_openib_component.ib_min_rnr_timer = (uint32_t) ival;
|
||||
|
||||
/* JMS is there a max? */
|
||||
CHECK(reg_int("ib_timeout", "InfiniBand transmit timeout, in seconds"
|
||||
CHECK(reg_int("ib_timeout", "InfiniBand transmit timeout, plugged into formula: 4.096 microseconds * (2^btl_openib_ib_timeout)"
|
||||
"(must be >= 0 and <= 32)",
|
||||
10, &ival, REGINT_GE_ZERO));
|
||||
mca_btl_openib_component.ib_timeout = (uint32_t) ival;
|
||||
@ -377,14 +399,28 @@ int btl_openib_register_mca_params(void)
|
||||
MCA_BTL_FLAGS_NEED_CSUM, &ival, REGINT_GE_ZERO));
|
||||
mca_btl_openib_module.super.btl_flags = (uint32_t) ival;
|
||||
|
||||
CHECK(reg_int("bandwidth", "Approximate maximum bandwidth "
|
||||
"of network (must be >= 1)",
|
||||
800, &ival, REGINT_GE_ONE));
|
||||
CHECK(reg_int("bandwidth", "Approximate maximum bandwidth of each network interface in megabits per second "
|
||||
"(if 0, filled in at run-time by querying the HCA, otherwise must be > 0) ",
|
||||
0, &ival, REGINT_GE_ZERO));
|
||||
mca_btl_openib_module.super.btl_bandwidth = (uint32_t) ival;
|
||||
|
||||
CHECK(reg_int("latency", "Approximate latency of the device (must be >= 1)",
|
||||
10, &ival, REGINT_GE_ONE));
|
||||
mca_btl_openib_module.super.btl_latency = (uint32_t) ival;
|
||||
|
||||
/* Info only */
|
||||
|
||||
mca_base_param_reg_int(&mca_btl_openib_component.super.btl_version,
|
||||
"have_fork_support",
|
||||
"Whether the OpenFabrics stack supports applications that invoke the \"fork()\" system call or not (0 = no, 1 = yes). Note that this value does NOT indicate whether the system being run on supports \"fork()\" with OpenFabrics applications or not.",
|
||||
false, true,
|
||||
#ifdef HAVE_IBV_FORK_INIT
|
||||
1,
|
||||
#else
|
||||
0,
|
||||
#endif
|
||||
NULL);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
# All rights reserved.
|
||||
# Copyright (c) 2007 Cisco, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
@ -29,6 +30,15 @@ AC_DEFUN([MCA_btl_openib_CONFIG],[
|
||||
AS_IF([test "$btl_openib_happy" = "yes"],
|
||||
[btl_openib_WRAPPER_EXTRA_LDFLAGS="$btl_openib_LDFLAGS"
|
||||
btl_openib_WRAPPER_EXTRA_LIBS="$btl_openib_LIBS"
|
||||
|
||||
# With the new openib flags, look for ibv_fork_init
|
||||
LDFLAGS_save="$LDFLAGS"
|
||||
LIBS_save="$LIBS"
|
||||
LDFLAGS="$LDFLAGS $btl_openib_LDFLAGS"
|
||||
LIBS="$LIBS $btl_openib_LIBS"
|
||||
AC_CHECK_FUNCS([ibv_fork_init])
|
||||
LDFLAGS="$LDFLAGS_save"
|
||||
LIBS="$LIBS_save"
|
||||
$1],
|
||||
[$2])
|
||||
|
||||
@ -38,4 +48,4 @@ AC_DEFUN([MCA_btl_openib_CONFIG],[
|
||||
AC_SUBST([btl_openib_CPPFLAGS])
|
||||
AC_SUBST([btl_openib_LDFLAGS])
|
||||
AC_SUBST([btl_openib_LIBS])
|
||||
])dnl
|
||||
])dnl
|
||||
|
@ -172,3 +172,13 @@ NOTE: You can turn off this warning by setting the MCA parameter
|
||||
[wrong buffer alignment]
|
||||
Wrong buffer alignment %d configured on host '%s'. Should be bigger
|
||||
than zero and power of two. Use default %d instead.
|
||||
[ibv_fork requested but not supported]
|
||||
WARNING: fork() support was requested for the openib BTL, but it is
|
||||
not supported on the host %s. Deactivating the openib BTL.
|
||||
[ibv_fork_init fail]
|
||||
WARNING: fork() support was requested for the openib BTL, but the
|
||||
library call ibv_fork_init() failed on the host %s.
|
||||
Deactivating the openib BTL.
|
||||
[wrong buffer alignment]
|
||||
Wrong buffer alignment %d configured on host '%s'. Should be bigger
|
||||
than zero and power of two. Use default %d instead.
|
||||
|
@ -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) 2006 Cisco Systems, Inc. All rights reserved.
|
||||
// $COPYRIGHT$
|
||||
//
|
||||
// Additional copyrights may follow
|
||||
@ -39,6 +40,8 @@
|
||||
#include "opal/mca/memory/base/base.h"
|
||||
#include "opal/mca/timer/timer.h"
|
||||
#include "opal/mca/timer/base/base.h"
|
||||
#include "opal/mca/installdirs/installdirs.h"
|
||||
#include "opal/mca/installdirs/base/base.h"
|
||||
#if OPAL_ENABLE_FT == 1
|
||||
#include "opal/mca/crs/crs.h"
|
||||
#include "opal/mca/crs/base/base.h"
|
||||
@ -208,6 +211,10 @@ void ompi_info::open_components()
|
||||
component_map["crs"] = &opal_crs_base_components_available;
|
||||
#endif
|
||||
|
||||
// OPAL's installdirs base open has already been called as part of
|
||||
// opal_init_util() back in main().
|
||||
component_map["installdirs"] = &opal_installdirs_components;
|
||||
|
||||
// ORTE frameworks
|
||||
|
||||
mca_oob_base_open();
|
||||
@ -362,6 +369,9 @@ void ompi_info::close_components()
|
||||
#if OPAL_ENABLE_FT == 1
|
||||
opal_crs_base_close();
|
||||
#endif
|
||||
// Do not call OPAL's installdirs close; it will be handled in
|
||||
// opal_finalize_util().
|
||||
|
||||
component_map.clear();
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
// University of Stuttgart. All rights reserved.
|
||||
// Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
// All rights reserved.
|
||||
// Copryight (c) 2007 Cisco Systems, Inc. All rights reserved.
|
||||
// $COPYRIGHT$
|
||||
//
|
||||
// Additional copyrights may follow
|
||||
@ -35,7 +36,7 @@
|
||||
#include <errno.h>
|
||||
|
||||
#include "ompi/tools/ompi_info/ompi_info.h"
|
||||
#include "opal/install_dirs.h"
|
||||
#include "opal/mca/installdirs/installdirs.h"
|
||||
#include "opal/class/opal_object.h"
|
||||
#include "opal/runtime/opal.h"
|
||||
#include "orte/runtime/runtime.h"
|
||||
@ -183,6 +184,7 @@ int main(int argc, char *argv[])
|
||||
ompi_info::mca_types.push_back("paffinity");
|
||||
ompi_info::mca_types.push_back("maffinity");
|
||||
ompi_info::mca_types.push_back("timer");
|
||||
ompi_info::mca_types.push_back("installdirs");
|
||||
#if OPAL_ENABLE_FT == 1
|
||||
ompi_info::mca_types.push_back("crs");
|
||||
#endif
|
||||
@ -256,7 +258,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (!acted) {
|
||||
ompi_info::show_ompi_version(ver_full);
|
||||
ompi_info::show_path(path_prefix, OPAL_PREFIX);
|
||||
ompi_info::show_path(path_prefix, opal_install_dirs.prefix);
|
||||
ompi_info::do_arch(cmd_line);
|
||||
ompi_info::do_config(false);
|
||||
ompi_info::open_components();
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
|
||||
#include "opal/install_dirs.h"
|
||||
#include "opal/mca/installdirs/installdirs.h"
|
||||
#include "opal/class/opal_value_array.h"
|
||||
#include "opal/util/printf.h"
|
||||
#include "opal/util/show_help.h"
|
||||
@ -253,29 +253,29 @@ void ompi_info::do_path(bool want_all, opal_cmd_line_t *cmd_line)
|
||||
string scope;
|
||||
|
||||
if (want_all) {
|
||||
show_path(path_prefix, OPAL_PREFIX);
|
||||
show_path(path_bindir, OPAL_BINDIR);
|
||||
show_path(path_libdir, OPAL_LIBDIR);
|
||||
show_path(path_incdir, OPAL_INCLUDEDIR);
|
||||
show_path(path_pkglibdir, OPAL_PKGLIBDIR);
|
||||
show_path(path_sysconfdir, OPAL_SYSCONFDIR);
|
||||
show_path(path_prefix, opal_install_dirs.prefix);
|
||||
show_path(path_bindir, opal_install_dirs.bindir);
|
||||
show_path(path_libdir, opal_install_dirs.libdir);
|
||||
show_path(path_incdir, opal_install_dirs.includedir);
|
||||
show_path(path_pkglibdir, opal_install_dirs.pkglibdir);
|
||||
show_path(path_sysconfdir, opal_install_dirs.sysconfdir);
|
||||
} else {
|
||||
count = opal_cmd_line_get_ninsts(cmd_line, "path");
|
||||
for (i = 0; i < count; ++i) {
|
||||
scope = opal_cmd_line_get_param(cmd_line, "path", i, 0);
|
||||
|
||||
if (path_prefix == scope)
|
||||
show_path(path_prefix, OPAL_PREFIX);
|
||||
show_path(path_prefix, opal_install_dirs.prefix);
|
||||
else if (path_bindir == scope)
|
||||
show_path(path_bindir, OPAL_BINDIR);
|
||||
show_path(path_bindir, opal_install_dirs.bindir);
|
||||
else if (path_libdir == scope)
|
||||
show_path(path_libdir, OPAL_LIBDIR);
|
||||
show_path(path_libdir, opal_install_dirs.libdir);
|
||||
else if (path_incdir == scope)
|
||||
show_path(path_incdir, OPAL_INCLUDEDIR);
|
||||
show_path(path_incdir, opal_install_dirs.includedir);
|
||||
else if (path_pkglibdir == scope)
|
||||
show_path(path_pkglibdir, OPAL_PKGLIBDIR);
|
||||
show_path(path_pkglibdir, opal_install_dirs.pkglibdir);
|
||||
else if (path_sysconfdir == scope)
|
||||
show_path(path_sysconfdir, OPAL_SYSCONFDIR);
|
||||
show_path(path_sysconfdir, opal_install_dirs.sysconfdir);
|
||||
else {
|
||||
char *usage = opal_cmd_line_get_usage_msg(cmd_line);
|
||||
opal_show_help("help-ompi_info.txt", "usage", true, usage);
|
||||
|
@ -26,7 +26,6 @@ headers += \
|
||||
opal/prefetch.h opal/hash_string.h
|
||||
|
||||
nodist_headers += \
|
||||
opal/install_dirs.h \
|
||||
opal/version.h
|
||||
|
||||
include opal/sys/Makefile.am
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "opal/install_dirs.h"
|
||||
#include "opal/mca/installdirs/installdirs.h"
|
||||
#include "opal/util/output.h"
|
||||
#include "opal/util/printf.h"
|
||||
#include "opal/mca/mca.h"
|
||||
@ -67,10 +67,10 @@ int mca_base_open(void)
|
||||
/* Register some params */
|
||||
#if !defined(__WINDOWS__)
|
||||
home = getenv("HOME");
|
||||
asprintf(&value, "%s:%s"OPAL_PATH_SEP".openmpi"OPAL_PATH_SEP"components", OPAL_PKGLIBDIR, home);
|
||||
asprintf(&value, "%s:%s"OPAL_PATH_SEP".openmpi"OPAL_PATH_SEP"components", opal_install_dirs.pkglibdir, home);
|
||||
#else
|
||||
home = getenv("USERPROFILE");
|
||||
asprintf(&value, "%s;%s"OPAL_PATH_SEP".openmpi"OPAL_PATH_SEP"components", OPAL_PKGLIBDIR, home);
|
||||
asprintf(&value, "%s;%s"OPAL_PATH_SEP".openmpi"OPAL_PATH_SEP"components", opal_install_dirs.pkglibdir, home);
|
||||
#endif /* !defined(__WINDOWS__) */
|
||||
|
||||
mca_base_param_component_path =
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#include "opal/install_dirs.h"
|
||||
#include "opal/mca/installdirs/installdirs.h"
|
||||
#include "opal/util/os_path.h"
|
||||
#include "opal/util/path.h"
|
||||
#include "opal/class/opal_value_array.h"
|
||||
@ -180,8 +180,7 @@ int mca_base_param_recache_files(bool rel_path_search)
|
||||
|
||||
asprintf(&files,
|
||||
"%s"OPAL_PATH_SEP".openmpi"OPAL_PATH_SEP"mca-params.conf%c%s"OPAL_PATH_SEP"openmpi-mca-params.conf",
|
||||
home, OPAL_ENV_SEP, OPAL_SYSCONFDIR);
|
||||
|
||||
home, OPAL_ENV_SEP, opal_install_dirs.sysconfdir);
|
||||
|
||||
/* Initialize a parameter that says where MCA param files can
|
||||
be found */
|
||||
@ -200,7 +199,7 @@ int mca_base_param_recache_files(bool rel_path_search)
|
||||
|
||||
asprintf(&agg_default_path,
|
||||
"%s"OPAL_PATH_SEP"amca-param-sets%c%s",
|
||||
OPAL_PKGDATADIR, OPAL_ENV_SEP, cwd);
|
||||
opal_install_dirs.pkgdatadir, OPAL_ENV_SEP, cwd);
|
||||
id = mca_base_param_reg_string_name("mca", "base_param_file_path",
|
||||
"Aggregate MCA parameter Search path",
|
||||
false, false, agg_default_path, &new_agg_path);
|
||||
@ -228,9 +227,8 @@ int mca_base_param_recache_files(bool rel_path_search)
|
||||
free(tmp_str);
|
||||
}
|
||||
}
|
||||
|
||||
read_files(new_files);
|
||||
|
||||
read_files(new_files);
|
||||
#if defined(__WINDOWS__)
|
||||
read_keys_from_registry(HKEY_CURRENT_USER, "SOFTWARE\\Open MPI", NULL);
|
||||
#endif /* defined(__WINDOWS__) */
|
||||
|
33
opal/mca/installdirs/Makefile.am
Обычный файл
33
opal/mca/installdirs/Makefile.am
Обычный файл
@ -0,0 +1,33 @@
|
||||
#
|
||||
# Copyright (c) 2006 Los Alamos National Security, LLC. All rights
|
||||
# reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
# main library setup
|
||||
noinst_LTLIBRARIES = libmca_installdirs.la
|
||||
libmca_installdirs_la_SOURCES =
|
||||
|
||||
# header setup
|
||||
nobase_opal_HEADERS =
|
||||
|
||||
# local files
|
||||
headers = installdirs.h
|
||||
libmca_installdirs_la_SOURCES += $(headers)
|
||||
|
||||
# Conditionally install the header files
|
||||
if WANT_INSTALL_HEADERS
|
||||
nobase_opal_HEADERS += $(headers)
|
||||
opaldir = $(includedir)/openmpi/opal/mca/installdirs
|
||||
else
|
||||
opaldir = $(includedir)
|
||||
endif
|
||||
|
||||
include base/Makefile.am
|
||||
|
||||
distclean-local:
|
||||
rm -f base/static-components.h
|
16
opal/mca/installdirs/base/Makefile.am
Обычный файл
16
opal/mca/installdirs/base/Makefile.am
Обычный файл
@ -0,0 +1,16 @@
|
||||
#
|
||||
# Copyright (c) 2006 Los Alamos National Security, LLC. All rights
|
||||
# reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
headers += \
|
||||
base/base.h
|
||||
|
||||
libmca_installdirs_la_SOURCES += \
|
||||
base/installdirs_base_components.c \
|
||||
base/installdirs_base_expand.c
|
39
opal/mca/installdirs/base/base.h
Обычный файл
39
opal/mca/installdirs/base/base.h
Обычный файл
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef OPAL_INSTALLDIRS_BASE_H
|
||||
#define OPAL_INSTALLDIRS_BASE_H
|
||||
|
||||
#include "opal_config.h"
|
||||
|
||||
#include "opal/mca/installdirs/installdirs.h"
|
||||
|
||||
/*
|
||||
* Global functions for MCA overall installdirs open and close
|
||||
*/
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
OPAL_DECLSPEC int opal_installdirs_base_open(void);
|
||||
OPAL_DECLSPEC int opal_installdirs_base_close(void);
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Globals
|
||||
*/
|
||||
OPAL_DECLSPEC extern opal_list_t opal_installdirs_components;
|
||||
|
||||
#endif /* OPAL_BASE_INSTALLDIRS_H */
|
164
opal/mca/installdirs/base/installdirs_base_components.c
Обычный файл
164
opal/mca/installdirs/base/installdirs_base_components.c
Обычный файл
@ -0,0 +1,164 @@
|
||||
/*
|
||||
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opal_config.h"
|
||||
|
||||
#include "opal/mca/mca.h"
|
||||
#include "opal/mca/installdirs/installdirs.h"
|
||||
#include "opal/mca/installdirs/base/base.h"
|
||||
#include "opal/mca/installdirs/base/static-components.h"
|
||||
|
||||
int opal_installdirs_base_output;
|
||||
opal_install_dirs_t opal_install_dirs;
|
||||
opal_list_t opal_installdirs_components;
|
||||
|
||||
#define CONDITIONAL_COPY(target, origin, field) \
|
||||
do { \
|
||||
if (origin.field != NULL && target.field == NULL) { \
|
||||
target.field = origin.field; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
int
|
||||
opal_installdirs_base_open(void)
|
||||
{
|
||||
int i, ret;
|
||||
mca_base_component_list_item_t *cli;
|
||||
|
||||
OBJ_CONSTRUCT(&opal_installdirs_components, opal_list_t);
|
||||
for (i = 0 ; mca_installdirs_base_static_components[i] != NULL ; ++i) {
|
||||
opal_installdirs_base_component_t *component =
|
||||
(opal_installdirs_base_component_t*)
|
||||
mca_installdirs_base_static_components[i];
|
||||
|
||||
/* Save it in a global list for ompi_info */
|
||||
cli = OBJ_NEW(mca_base_component_list_item_t);
|
||||
cli->cli_component = mca_installdirs_base_static_components[i];
|
||||
opal_list_append(&opal_installdirs_components,
|
||||
&cli->super);
|
||||
|
||||
if (NULL != component->component.mca_open_component) {
|
||||
ret = component->component.mca_open_component();
|
||||
if (OPAL_SUCCESS != ret) continue;
|
||||
}
|
||||
|
||||
/* copy over the data, if something isn't already there */
|
||||
CONDITIONAL_COPY(opal_install_dirs, component->install_dirs_data,
|
||||
prefix);
|
||||
CONDITIONAL_COPY(opal_install_dirs, component->install_dirs_data,
|
||||
exec_prefix);
|
||||
CONDITIONAL_COPY(opal_install_dirs, component->install_dirs_data,
|
||||
bindir);
|
||||
CONDITIONAL_COPY(opal_install_dirs, component->install_dirs_data,
|
||||
sbindir);
|
||||
CONDITIONAL_COPY(opal_install_dirs, component->install_dirs_data,
|
||||
libexecdir);
|
||||
CONDITIONAL_COPY(opal_install_dirs, component->install_dirs_data,
|
||||
datadir);
|
||||
CONDITIONAL_COPY(opal_install_dirs, component->install_dirs_data,
|
||||
sysconfdir);
|
||||
CONDITIONAL_COPY(opal_install_dirs, component->install_dirs_data,
|
||||
sharedstatedir);
|
||||
CONDITIONAL_COPY(opal_install_dirs, component->install_dirs_data,
|
||||
localstatedir);
|
||||
CONDITIONAL_COPY(opal_install_dirs, component->install_dirs_data,
|
||||
libdir);
|
||||
CONDITIONAL_COPY(opal_install_dirs, component->install_dirs_data,
|
||||
includedir);
|
||||
CONDITIONAL_COPY(opal_install_dirs, component->install_dirs_data,
|
||||
infodir);
|
||||
CONDITIONAL_COPY(opal_install_dirs, component->install_dirs_data,
|
||||
mandir);
|
||||
CONDITIONAL_COPY(opal_install_dirs, component->install_dirs_data,
|
||||
pkgdatadir);
|
||||
CONDITIONAL_COPY(opal_install_dirs, component->install_dirs_data,
|
||||
pkglibdir);
|
||||
CONDITIONAL_COPY(opal_install_dirs, component->install_dirs_data,
|
||||
pkgincludedir);
|
||||
}
|
||||
|
||||
/* expand out all the fields */
|
||||
opal_install_dirs.prefix =
|
||||
opal_install_dirs_expand(opal_install_dirs.prefix);
|
||||
opal_install_dirs.exec_prefix =
|
||||
opal_install_dirs_expand(opal_install_dirs.exec_prefix);
|
||||
opal_install_dirs.bindir =
|
||||
opal_install_dirs_expand(opal_install_dirs.bindir);
|
||||
opal_install_dirs.sbindir =
|
||||
opal_install_dirs_expand(opal_install_dirs.sbindir);
|
||||
opal_install_dirs.libexecdir =
|
||||
opal_install_dirs_expand(opal_install_dirs.libexecdir);
|
||||
opal_install_dirs.datadir =
|
||||
opal_install_dirs_expand(opal_install_dirs.datadir);
|
||||
opal_install_dirs.sysconfdir =
|
||||
opal_install_dirs_expand(opal_install_dirs.sysconfdir);
|
||||
opal_install_dirs.sharedstatedir =
|
||||
opal_install_dirs_expand(opal_install_dirs.sharedstatedir);
|
||||
opal_install_dirs.localstatedir =
|
||||
opal_install_dirs_expand(opal_install_dirs.localstatedir);
|
||||
opal_install_dirs.libdir =
|
||||
opal_install_dirs_expand(opal_install_dirs.libdir);
|
||||
opal_install_dirs.includedir =
|
||||
opal_install_dirs_expand(opal_install_dirs.includedir);
|
||||
opal_install_dirs.infodir =
|
||||
opal_install_dirs_expand(opal_install_dirs.infodir);
|
||||
opal_install_dirs.mandir =
|
||||
opal_install_dirs_expand(opal_install_dirs.mandir);
|
||||
opal_install_dirs.pkgdatadir =
|
||||
opal_install_dirs_expand(opal_install_dirs.pkgdatadir);
|
||||
opal_install_dirs.pkglibdir =
|
||||
opal_install_dirs_expand(opal_install_dirs.pkglibdir);
|
||||
opal_install_dirs.pkgincludedir =
|
||||
opal_install_dirs_expand(opal_install_dirs.pkgincludedir);
|
||||
|
||||
for (i = 0 ; mca_installdirs_base_static_components[i] != NULL ; ++i) {
|
||||
if (NULL != mca_installdirs_base_static_components[i]->mca_close_component) {
|
||||
mca_installdirs_base_static_components[i]->mca_close_component();
|
||||
}
|
||||
}
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
opal_installdirs_base_close(void)
|
||||
{
|
||||
opal_list_item_t *item;
|
||||
|
||||
free(opal_install_dirs.prefix);
|
||||
free(opal_install_dirs.exec_prefix);
|
||||
free(opal_install_dirs.bindir);
|
||||
free(opal_install_dirs.sbindir);
|
||||
free(opal_install_dirs.libexecdir);
|
||||
free(opal_install_dirs.datadir);
|
||||
free(opal_install_dirs.sysconfdir);
|
||||
free(opal_install_dirs.sharedstatedir);
|
||||
free(opal_install_dirs.localstatedir);
|
||||
free(opal_install_dirs.libdir);
|
||||
free(opal_install_dirs.includedir);
|
||||
free(opal_install_dirs.infodir);
|
||||
free(opal_install_dirs.mandir);
|
||||
free(opal_install_dirs.pkgdatadir);
|
||||
free(opal_install_dirs.pkglibdir);
|
||||
free(opal_install_dirs.pkgincludedir);
|
||||
|
||||
for (item = opal_list_remove_first(&opal_installdirs_components);
|
||||
NULL != item;
|
||||
item = opal_list_remove_first(&opal_installdirs_components)) {
|
||||
OBJ_RELEASE(item);
|
||||
}
|
||||
OBJ_DESTRUCT(&opal_installdirs_components);
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
93
opal/mca/installdirs/base/installdirs_base_expand.c
Обычный файл
93
opal/mca/installdirs/base/installdirs_base_expand.c
Обычный файл
@ -0,0 +1,93 @@
|
||||
/*
|
||||
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opal_config.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "opal/util/os_path.h"
|
||||
#include "opal/mca/installdirs/base/base.h"
|
||||
#include "opal/mca/installdirs/installdirs.h"
|
||||
|
||||
#define EXPAND_STRING(field) \
|
||||
do { \
|
||||
if (NULL != (start_pos = strstr(retval, "${" #field "}"))) { \
|
||||
tmp = retval; \
|
||||
*start_pos = '\0'; \
|
||||
end_pos = start_pos + strlen("${" #field "}"); \
|
||||
asprintf(&retval, "%s%s%s", tmp, \
|
||||
opal_install_dirs.field + destdir_offset, \
|
||||
end_pos); \
|
||||
free(tmp); \
|
||||
changed = true; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
|
||||
char *
|
||||
opal_install_dirs_expand(const char* input)
|
||||
{
|
||||
size_t len, i;
|
||||
bool needs_expand = false;
|
||||
char *retval = strdup(input);
|
||||
char *destdir = getenv("OPAL_DESTDIR");
|
||||
size_t destdir_offset = 0;
|
||||
|
||||
if (NULL != destdir && strlen(destdir) > 0) {
|
||||
destdir_offset = strlen(destdir);
|
||||
}
|
||||
|
||||
len = strlen(input);
|
||||
for (i = 0 ; i < len ; ++i) {
|
||||
if (input[i] == '$') {
|
||||
needs_expand = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
retval = strdup(input);
|
||||
if (NULL == retval) return NULL;
|
||||
|
||||
if (needs_expand) {
|
||||
bool changed = false;
|
||||
char *start_pos, *end_pos, *tmp;
|
||||
|
||||
do {
|
||||
changed = false;
|
||||
EXPAND_STRING(prefix);
|
||||
EXPAND_STRING(exec_prefix);
|
||||
EXPAND_STRING(bindir);
|
||||
EXPAND_STRING(sbindir);
|
||||
EXPAND_STRING(libexecdir);
|
||||
EXPAND_STRING(datadir);
|
||||
EXPAND_STRING(sysconfdir);
|
||||
EXPAND_STRING(sharedstatedir);
|
||||
EXPAND_STRING(localstatedir);
|
||||
EXPAND_STRING(libdir);
|
||||
EXPAND_STRING(includedir);
|
||||
EXPAND_STRING(infodir);
|
||||
EXPAND_STRING(mandir);
|
||||
EXPAND_STRING(pkgdatadir);
|
||||
EXPAND_STRING(pkglibdir);
|
||||
EXPAND_STRING(pkgincludedir);
|
||||
} while (changed);
|
||||
}
|
||||
|
||||
if (NULL != destdir) {
|
||||
char *tmp = retval;
|
||||
retval = opal_os_path(false, destdir, tmp, NULL);
|
||||
free(tmp);
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
19
opal/mca/installdirs/config/Makefile.am
Обычный файл
19
opal/mca/installdirs/config/Makefile.am
Обычный файл
@ -0,0 +1,19 @@
|
||||
#
|
||||
# Copyright (c) 2006 Los Alamos National Security, LLC. All rights
|
||||
# reserved.
|
||||
# Copyright (c) 2007 Cisco, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
noinst_LTLIBRARIES = libmca_installdirs_config.la
|
||||
|
||||
libmca_installdirs_config_la_SOURCES = \
|
||||
opal_installdirs_config.c
|
||||
|
||||
# This file is generated; we do not want to include it in the tarball
|
||||
nodist_libmca_installdirs_config_la_SOURCES = \
|
||||
install_dirs.h
|
25
opal/mca/installdirs/config/configure.m4
Обычный файл
25
opal/mca/installdirs/config/configure.m4
Обычный файл
@ -0,0 +1,25 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# Copyright (c) 2006 Los Alamos National Security, LLC. All rights
|
||||
# reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
AC_DEFUN([MCA_installdirs_config_COMPILE_MODE], [
|
||||
AC_MSG_CHECKING([for MCA component $2:$3 compile mode])
|
||||
$4="static"
|
||||
AC_MSG_RESULT([$$4])
|
||||
])
|
||||
|
||||
|
||||
# MCA_installdirs_config_CONFIG(action-if-can-compile,
|
||||
# [action-if-cant-compile])
|
||||
# ------------------------------------------------
|
||||
AC_DEFUN([MCA_installdirs_config_CONFIG],[
|
||||
OMPI_INSTALL_DIRS([opal/mca/installdirs/config/install_dirs.h])
|
||||
])
|
||||
|
15
opal/mca/installdirs/config/configure.params
Обычный файл
15
opal/mca/installdirs/config/configure.params
Обычный файл
@ -0,0 +1,15 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# Copyright (c) 2006 Los Alamos National Security, LLC. All rights
|
||||
# reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
# Specific to this module
|
||||
|
||||
PARAM_CONFIG_PRIORITY=0
|
||||
PARAM_CONFIG_FILES="Makefile"
|
59
opal/mca/installdirs/config/opal_installdirs_config.c
Обычный файл
59
opal/mca/installdirs/config/opal_installdirs_config.c
Обычный файл
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "opal_config.h"
|
||||
|
||||
#include "opal/mca/installdirs/installdirs.h"
|
||||
#include "opal/mca/installdirs/config/install_dirs.h"
|
||||
|
||||
const opal_installdirs_base_component_t mca_installdirs_config_component = {
|
||||
/* First, the mca_component_t struct containing meta information
|
||||
about the component itself */
|
||||
{
|
||||
/* Indicate that we are a backtrace v1.0.0 component (which also
|
||||
implies a specific MCA version) */
|
||||
OPAL_INSTALLDIRS_BASE_VERSION_1_0_0,
|
||||
|
||||
/* Component name and version */
|
||||
"config",
|
||||
OPAL_MAJOR_VERSION,
|
||||
OPAL_MINOR_VERSION,
|
||||
OPAL_RELEASE_VERSION,
|
||||
|
||||
/* Component open and close functions */
|
||||
NULL,
|
||||
NULL
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
{
|
||||
/* Whether the component is checkpointable or not */
|
||||
true
|
||||
},
|
||||
|
||||
{
|
||||
OPAL_PREFIX,
|
||||
OPAL_EXEC_PREFIX,
|
||||
OPAL_BINDIR,
|
||||
OPAL_SBINDIR,
|
||||
OPAL_LIBEXECDIR,
|
||||
OPAL_DATADIR,
|
||||
OPAL_SYSCONFDIR,
|
||||
OPAL_SHAREDSTATEDIR,
|
||||
OPAL_LOCALSTATEDIR,
|
||||
OPAL_LIBDIR,
|
||||
OPAL_INCLUDEDIR,
|
||||
OPAL_INFODIR,
|
||||
OPAL_MANDIR,
|
||||
OPAL_PKGDATADIR,
|
||||
OPAL_PKGLIBDIR,
|
||||
OPAL_PKGINCLUDEDIR
|
||||
}
|
||||
};
|
14
opal/mca/installdirs/env/Makefile.am
поставляемый
Обычный файл
14
opal/mca/installdirs/env/Makefile.am
поставляемый
Обычный файл
@ -0,0 +1,14 @@
|
||||
#
|
||||
# Copyright (c) 2006 Los Alamos National Security, LLC. All rights
|
||||
# reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
noinst_LTLIBRARIES = libmca_installdirs_env.la
|
||||
|
||||
libmca_installdirs_env_la_SOURCES = \
|
||||
opal_installdirs_env.c
|
22
opal/mca/installdirs/env/configure.m4
поставляемый
Обычный файл
22
opal/mca/installdirs/env/configure.m4
поставляемый
Обычный файл
@ -0,0 +1,22 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# Copyright (c) 2006 Los Alamos National Security, LLC. All rights
|
||||
# reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
AC_DEFUN([MCA_installdirs_env_COMPILE_MODE], [
|
||||
AC_MSG_CHECKING([for MCA component $2:$3 compile mode])
|
||||
$4="static"
|
||||
AC_MSG_RESULT([$$4])
|
||||
])
|
||||
|
||||
# MCA_installdirs_config_CONFIG(action-if-can-compile,
|
||||
# [action-if-cant-compile])
|
||||
# ------------------------------------------------
|
||||
AC_DEFUN([MCA_installdirs_env_CONFIG], [$1])
|
||||
|
15
opal/mca/installdirs/env/configure.params
поставляемый
Обычный файл
15
opal/mca/installdirs/env/configure.params
поставляемый
Обычный файл
@ -0,0 +1,15 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# Copyright (c) 2006 Los Alamos National Security, LLC. All rights
|
||||
# reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
# Specific to this module
|
||||
|
||||
PARAM_CONFIG_PRIORITY=10
|
||||
PARAM_CONFIG_FILES="Makefile"
|
80
opal/mca/installdirs/env/opal_installdirs_env.c
поставляемый
Обычный файл
80
opal/mca/installdirs/env/opal_installdirs_env.c
поставляемый
Обычный файл
@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "opal_config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "opal/mca/installdirs/installdirs.h"
|
||||
|
||||
static int installdirs_env_open(void);
|
||||
|
||||
|
||||
opal_installdirs_base_component_t mca_installdirs_env_component = {
|
||||
/* First, the mca_component_t struct containing meta information
|
||||
about the component itself */
|
||||
{
|
||||
/* Indicate that we are a backtrace v1.0.0 component (which also
|
||||
implies a specific MCA version) */
|
||||
OPAL_INSTALLDIRS_BASE_VERSION_1_0_0,
|
||||
|
||||
/* Component name and version */
|
||||
"env",
|
||||
OPAL_MAJOR_VERSION,
|
||||
OPAL_MINOR_VERSION,
|
||||
OPAL_RELEASE_VERSION,
|
||||
|
||||
/* Component open and close functions */
|
||||
installdirs_env_open,
|
||||
NULL
|
||||
},
|
||||
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
{
|
||||
/* Whether the component is checkpointable or not */
|
||||
true
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
#define SET_FIELD(field, envname) \
|
||||
do { \
|
||||
char *tmp = getenv(envname); \
|
||||
if (NULL != tmp && 0 == strlen(tmp)) { \
|
||||
tmp = NULL; \
|
||||
} \
|
||||
mca_installdirs_env_component.install_dirs_data.field = tmp; \
|
||||
} while (0)
|
||||
|
||||
|
||||
static int
|
||||
installdirs_env_open(void)
|
||||
{
|
||||
SET_FIELD(prefix, "OPAL_PREFIX");
|
||||
SET_FIELD(exec_prefix, "OPAL_EXEC_PREFIX");
|
||||
SET_FIELD(bindir, "OPAL_BINDIR");
|
||||
SET_FIELD(sbindir, "OPAL_SBINDIR");
|
||||
SET_FIELD(libexecdir, "OPAL_LIBEXECDIR");
|
||||
SET_FIELD(datadir, "OPAL_DATADIR");
|
||||
SET_FIELD(sysconfdir, "OPAL_SYSCONFDIR");
|
||||
SET_FIELD(sharedstatedir, "OPAL_SHAREDSTATEDIR");
|
||||
SET_FIELD(localstatedir, "OPAL_LOCALSTATEDIR");
|
||||
SET_FIELD(libdir, "OPAL_LIBDIR");
|
||||
SET_FIELD(includedir, "OPAL_INCLUDEDIR");
|
||||
SET_FIELD(infodir, "OPAL_INFODIR");
|
||||
SET_FIELD(mandir, "OPAL_MANDIR");
|
||||
SET_FIELD(pkgdatadir, "OPAL_PKGDATADIR");
|
||||
SET_FIELD(pkglibdir, "OPAL_PKGLIBDIR");
|
||||
SET_FIELD(pkgincludedir, "OPAL_PKGINCLUDEDIR");
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
78
opal/mca/installdirs/installdirs.h
Обычный файл
78
opal/mca/installdirs/installdirs.h
Обычный файл
@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef OPAL_MCA_INSTALLDIRS_INSTALLDIRS_H
|
||||
#define OPAL_MCA_INSTALLDIRS_INSTALLDIRS_H
|
||||
|
||||
#include "opal_config.h"
|
||||
|
||||
#include "opal/mca/mca.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
|
||||
/*
|
||||
* Most of this file is just for ompi_info. The only public interface
|
||||
* once opal_init has been called is the opal_install_dirs structure
|
||||
* and the opal_install_dirs_expand() call */
|
||||
struct opal_install_dirs_t {
|
||||
char* prefix;
|
||||
char* exec_prefix;
|
||||
char* bindir;
|
||||
char* sbindir;
|
||||
char* libexecdir;
|
||||
char* datadir;
|
||||
char* sysconfdir;
|
||||
char* sharedstatedir;
|
||||
char* localstatedir;
|
||||
char* libdir;
|
||||
char* includedir;
|
||||
char* infodir;
|
||||
char* mandir;
|
||||
char* pkgdatadir;
|
||||
char* pkglibdir;
|
||||
char* pkgincludedir;
|
||||
};
|
||||
typedef struct opal_install_dirs_t opal_install_dirs_t;
|
||||
|
||||
/* Install directories. Only available after opal_init() */
|
||||
extern opal_install_dirs_t opal_install_dirs;
|
||||
|
||||
/**
|
||||
* Expand out path variables (such as ${prefix}) in the input string
|
||||
* using the current opal_install_dirs structure */
|
||||
char * opal_install_dirs_expand(const char* input);
|
||||
|
||||
|
||||
/**
|
||||
* Structure for installdirs v1.0.0 components.
|
||||
* Chained to MCA v1.0.0
|
||||
*/
|
||||
struct opal_installdirs_base_component_1_0_0_t {
|
||||
/** MCA base component */
|
||||
mca_base_component_t component;
|
||||
/** MCA base data */
|
||||
mca_base_component_data_1_0_0_t component_data;
|
||||
/** install directories provided by the given component */
|
||||
opal_install_dirs_t install_dirs_data;
|
||||
};
|
||||
/**
|
||||
* Convenience typedef
|
||||
*/
|
||||
typedef struct opal_installdirs_base_component_1_0_0_t opal_installdirs_base_component_t;
|
||||
|
||||
/*
|
||||
* Macro for use in components that are of type installdirs v1.0.0
|
||||
*/
|
||||
#define OPAL_INSTALLDIRS_BASE_VERSION_1_0_0 \
|
||||
/* installdirs v1.0 is chained to MCA v1.0 */ \
|
||||
MCA_BASE_VERSION_1_0_0, \
|
||||
/* installdirs v1.0 */ \
|
||||
"installdirs", 1, 0, 0
|
||||
|
||||
#endif /* OPAL_MCA_INSTALLDIRS_INSTALLDIRS_H */
|
@ -30,6 +30,7 @@
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/runtime/opal.h"
|
||||
#include "opal/constants.h"
|
||||
#include "opal/mca/installdirs/base/base.h"
|
||||
#include "opal/mca/memcpy/base/base.h"
|
||||
#include "opal/mca/memory/base/base.h"
|
||||
#include "opal/mca/backtrace/base/base.h"
|
||||
@ -55,6 +56,8 @@ opal_finalize_util(void)
|
||||
/* keyval lex-based parser */
|
||||
opal_util_keyval_parse_finalize();
|
||||
|
||||
opal_installdirs_base_close();
|
||||
|
||||
/* finalize the memory allocator */
|
||||
opal_malloc_finalize();
|
||||
|
||||
|
@ -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 Cisco, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -27,6 +28,7 @@
|
||||
#include "opal/memoryhooks/memory.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/runtime/opal.h"
|
||||
#include "opal/mca/installdirs/base/base.h"
|
||||
#include "opal/mca/memory/base/base.h"
|
||||
#include "opal/mca/memcpy/base/base.h"
|
||||
#include "opal/mca/paffinity/base/base.h"
|
||||
@ -146,9 +148,6 @@ opal_init_util(void)
|
||||
/* initialize the output system */
|
||||
opal_output_init();
|
||||
|
||||
/* init the trace function */
|
||||
opal_trace_init();
|
||||
|
||||
/* register handler for errnum -> string converstion */
|
||||
if (OPAL_SUCCESS != (ret = opal_error_register("OPAL",
|
||||
OPAL_ERR_BASE, OPAL_ERR_MAX, opal_err2str))) {
|
||||
@ -156,6 +155,16 @@ opal_init_util(void)
|
||||
goto return_error;
|
||||
}
|
||||
|
||||
/* initialize install dirs code */
|
||||
if (OPAL_SUCCESS != (ret = opal_installdirs_base_open())) {
|
||||
fprintf(stderr, "opal_installdirs_base_open() failed -- process will likely abort (%s:%d, returned %d instead of OPAL_INIT)\n",
|
||||
__FILE__, __LINE__, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* init the trace function */
|
||||
opal_trace_init();
|
||||
|
||||
/* keyval lex-based parser */
|
||||
if (OPAL_SUCCESS != (ret = opal_util_keyval_parse_init())) {
|
||||
error = "opal_util_keyval_parse_init";
|
||||
|
@ -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 Cisco, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -36,7 +37,7 @@
|
||||
#include <string.h>
|
||||
#endif /* HAVE_STRING_H */
|
||||
|
||||
#include "opal/install_dirs.h"
|
||||
#include "opal/mca/installdirs/installdirs.h"
|
||||
#include "opal/runtime/opal.h"
|
||||
#include "opal/constants.h"
|
||||
#include "opal/util/argv.h"
|
||||
@ -285,7 +286,8 @@ data_callback(const char *key, const char *value)
|
||||
if (NULL != value) options_data[parse_options_idx].compiler_flags_env = strdup(value);
|
||||
} else if (0 == strcmp(key, "includedir")) {
|
||||
if (NULL != value) {
|
||||
options_data[parse_options_idx].path_includedir = strdup(value);
|
||||
options_data[parse_options_idx].path_includedir =
|
||||
opal_install_dirs_expand(value);
|
||||
if (0 != strcmp(options_data[parse_options_idx].path_includedir, "/usr/include") ||
|
||||
0 == strncmp(options_data[parse_options_idx].language, "Fortran", strlen("Fortran"))) {
|
||||
char *line;
|
||||
@ -307,7 +309,8 @@ data_callback(const char *key, const char *value)
|
||||
}
|
||||
}
|
||||
} else if (0 == strcmp(key, "libdir")) {
|
||||
if (NULL != value) options_data[parse_options_idx].path_libdir = strdup(value);
|
||||
if (NULL != value) options_data[parse_options_idx].path_libdir =
|
||||
opal_install_dirs_expand(value);
|
||||
#if defined(__WINDOWS__)
|
||||
opal_argv_append_nosize( &options_data[parse_options_idx].link_flags, "/link" );
|
||||
#endif /* defined(__WINDOWS__) */
|
||||
@ -335,7 +338,7 @@ data_init(const char *appname)
|
||||
|
||||
/* now load the data */
|
||||
asprintf(&datafile, "%s%s%s-wrapper-data.txt",
|
||||
OPAL_PKGDATADIR, OPAL_PATH_SEP, appname);
|
||||
opal_install_dirs.pkgdatadir, OPAL_PATH_SEP, appname);
|
||||
if (NULL == datafile) return OPAL_ERR_TEMP_OUT_OF_RESOURCE;
|
||||
|
||||
ret = opal_util_keyval_parse(datafile, data_callback);
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
|
||||
#include "opal/install_dirs.h"
|
||||
#include "opal/mca/installdirs/installdirs.h"
|
||||
#include "opal/util/show_help.h"
|
||||
#include "opal/util/show_help_lex.h"
|
||||
#include "opal/util/printf.h"
|
||||
@ -104,11 +104,11 @@ static int open_file(const char *base, const char *topic)
|
||||
/* Try to open the file. If we can't find it, try it with a .txt
|
||||
extension. */
|
||||
|
||||
filename = opal_os_path( false, OPAL_PKGDATADIR, base, NULL );
|
||||
filename = opal_os_path( false, opal_install_dirs.pkgdatadir, base, NULL );
|
||||
opal_show_help_yyin = fopen(filename, "r");
|
||||
free(filename);
|
||||
if (NULL == opal_show_help_yyin) {
|
||||
asprintf(&filename, "%s/%s.txt", OPAL_PKGDATADIR, base);
|
||||
asprintf(&filename, "%s/%s.txt", opal_install_dirs.pkgdatadir, base);
|
||||
opal_show_help_yyin = fopen(filename, "r");
|
||||
free(filename);
|
||||
}
|
||||
@ -123,11 +123,11 @@ static int open_file(const char *base, const char *topic)
|
||||
/* Do we have a file matching that locale? If not, open the
|
||||
default language (because we know that we have that one) */
|
||||
|
||||
asprintf(&filename, "%s/%s.%s", OPAL_PKGDATADIR, base, lang);
|
||||
asprintf(&filename, "%s/%s.%s", opal_install_dirs.pkgdatadir, base, lang);
|
||||
opal_show_help_yyin = fopen(filename, "r");
|
||||
free(filename);
|
||||
if (NULL == opal_show_help_yyin) {
|
||||
asprintf(&filename, "%s/%s.%s", OPAL_PKGDATADIR,
|
||||
asprintf(&filename, "%s/%s.%s", opal_install_dirs.pkgdatadir,
|
||||
base, default_language);
|
||||
opal_show_help_yyin = fopen(filename, "r");
|
||||
free(filename);
|
||||
@ -136,7 +136,7 @@ static int open_file(const char *base, const char *topic)
|
||||
/* If we still couldn't find it, try with no extension */
|
||||
|
||||
if (NULL == opal_show_help_yyin) {
|
||||
filename = opal_os_path( false, OPAL_PKGDATADIR, base, NULL );
|
||||
filename = opal_os_path( false, opal_install_dirs.pkgdatadir, base, NULL );
|
||||
opal_show_help_yyin = fopen(filename, "r");
|
||||
free(filename);
|
||||
}
|
||||
|
@ -44,7 +44,8 @@
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include "opal/install_dirs.h"
|
||||
#include "opal/mca/installdirs/installdirs.h"
|
||||
#include "opal/class/opal_list.h"
|
||||
#include "opal/class/opal_list.h"
|
||||
#include "opal/event/event.h"
|
||||
#include "opal/mca/base/mca_base_param.h"
|
||||
@ -574,7 +575,7 @@ static int orte_pls_bproc_launch_daemons(orte_job_map_t *map, char ***envp) {
|
||||
} else {
|
||||
orted_path = opal_path_findv(mca_pls_bproc_component.orted, 0, environ, NULL);
|
||||
if(NULL == orted_path) {
|
||||
orted_path = opal_os_path( false, OPAL_BINDIR, mca_pls_bproc_component.orted, NULL );
|
||||
orted_path = opal_os_path( false, opal_install_dirs.bindir, mca_pls_bproc_component.orted, NULL );
|
||||
if( (NULL != orted_path) || (0 != stat(orted_path, &buf)) ) {
|
||||
char *path = getenv("PATH");
|
||||
if (NULL == path) {
|
||||
@ -582,7 +583,7 @@ static int orte_pls_bproc_launch_daemons(orte_job_map_t *map, char ***envp) {
|
||||
}
|
||||
opal_show_help("help-pls-bproc.txt", "no-orted", true,
|
||||
mca_pls_bproc_component.orted,
|
||||
mca_pls_bproc_component.orted, path, OPAL_BINDIR);
|
||||
mca_pls_bproc_component.orted, path, opal_install_dirs.bindir);
|
||||
rc = ORTE_ERROR;
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
|
@ -60,7 +60,7 @@
|
||||
#include <pwd.h>
|
||||
#endif
|
||||
|
||||
#include "opal/install_dirs.h"
|
||||
#include "opal/mca/installdirs/installdirs.h"
|
||||
#include "opal/mca/base/mca_base_param.h"
|
||||
#include "opal/util/if.h"
|
||||
#include "opal/util/os_path.h"
|
||||
@ -116,14 +116,14 @@ static int orte_pls_gridengine_fill_orted_path(char** orted_path)
|
||||
{
|
||||
struct stat buf;
|
||||
|
||||
asprintf(orted_path, "%s/orted", OPAL_BINDIR);
|
||||
asprintf(orted_path, "%s/orted", opal_install_dirs.bindir);
|
||||
if (0 != stat(*orted_path, &buf)) {
|
||||
char *path = getenv("PATH");
|
||||
if (NULL == path) {
|
||||
path = ("PATH is empty!");
|
||||
}
|
||||
opal_show_help("help-pls-gridengine.txt", "no-local-orted",
|
||||
true, path, OPAL_BINDIR);
|
||||
true, path, opal_install_dirs.bindir);
|
||||
return ORTE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
@ -330,8 +330,8 @@ int orte_pls_gridengine_launch_job(orte_jobid_t jobid)
|
||||
the rationale for how / why we're doing this.
|
||||
*/
|
||||
|
||||
lib_base = opal_basename(OPAL_LIBDIR);
|
||||
bin_base = opal_basename(OPAL_BINDIR);
|
||||
lib_base = opal_basename(opal_install_dirs.libdir);
|
||||
bin_base = opal_basename(opal_install_dirs.bindir);
|
||||
|
||||
/* See the note about prefix_dir in the orte/mca/pls/slurm/pls_slurm.c
|
||||
* module. Fo here, just note that we must have at least one app_context,
|
||||
|
@ -9,7 +9,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$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -56,7 +56,7 @@
|
||||
#include <pwd.h>
|
||||
#endif
|
||||
|
||||
#include "opal/install_dirs.h"
|
||||
#include "opal/mca/installdirs/installdirs.h"
|
||||
#include "opal/mca/base/mca_base_param.h"
|
||||
#include "opal/util/if.h"
|
||||
#include "opal/util/os_path.h"
|
||||
@ -246,14 +246,14 @@ static int orte_pls_rsh_fill_exec_path ( char ** exec_path)
|
||||
{
|
||||
struct stat buf;
|
||||
|
||||
asprintf(exec_path, "%s/orted", OPAL_BINDIR);
|
||||
asprintf(exec_path, "%s/orted", opal_install_dirs.bindir);
|
||||
if (0 != stat(*exec_path, &buf)) {
|
||||
char *path = getenv("PATH");
|
||||
if (NULL == path) {
|
||||
path = ("PATH is empty!");
|
||||
}
|
||||
opal_show_help("help-pls-rsh.txt", "no-local-orted",
|
||||
true, path, OPAL_BINDIR);
|
||||
true, path, opal_install_dirs.bindir);
|
||||
return ORTE_ERR_NOT_FOUND;
|
||||
}
|
||||
return ORTE_SUCCESS;
|
||||
@ -653,10 +653,7 @@ int orte_pls_rsh_launch(orte_jobid_t jobid)
|
||||
/* Figure out the basenames for the libdir and bindir. This
|
||||
requires some explanation:
|
||||
|
||||
- Use OPAL_LIBDIR and OPAL_BINDIR instead of -D'ing some macros
|
||||
in this directory's Makefile.am because it makes all the
|
||||
dependencies work out correctly. These are defined in
|
||||
opal/install_dirs.h.
|
||||
- Use opal_install_dirs.libdir and opal_install_dirs.bindir.
|
||||
|
||||
- After a discussion on the devel-core mailing list, the
|
||||
developers decided that we should use the local directory
|
||||
@ -680,8 +677,8 @@ int orte_pls_rsh_launch(orte_jobid_t jobid)
|
||||
and use that on the remote node.
|
||||
*/
|
||||
|
||||
lib_base = opal_basename(OPAL_LIBDIR);
|
||||
bin_base = opal_basename(OPAL_BINDIR);
|
||||
lib_base = opal_basename(opal_install_dirs.libdir);
|
||||
bin_base = opal_basename(opal_install_dirs.bindir);
|
||||
|
||||
/*
|
||||
* Iterate through each of the nodes
|
||||
@ -904,11 +901,15 @@ int orte_pls_rsh_launch(orte_jobid_t jobid)
|
||||
exec_path = strdup(mca_pls_rsh_component.agent_path);
|
||||
|
||||
if (NULL != prefix_dir) {
|
||||
char *opal_prefix = getenv("OPAL_PREFIX");
|
||||
if (remote_sh) {
|
||||
asprintf (&argv[local_exec_index],
|
||||
"PATH=%s/%s:$PATH ; export PATH ; "
|
||||
"%s%s%s PATH=%s/%s:$PATH ; export PATH ; "
|
||||
"LD_LIBRARY_PATH=%s/%s:$LD_LIBRARY_PATH ; export LD_LIBRARY_PATH ; "
|
||||
"%s/%s/%s",
|
||||
(opal_prefix != NULL ? "OPAL_PREFIX=" : ""),
|
||||
(opal_prefix != NULL ? opal_prefix : ""),
|
||||
(opal_prefix != NULL ? " ;" : ""),
|
||||
prefix_dir, bin_base,
|
||||
prefix_dir, lib_base,
|
||||
prefix_dir, bin_base,
|
||||
@ -923,7 +924,7 @@ int orte_pls_rsh_launch(orte_jobid_t jobid)
|
||||
See this thread for more details:
|
||||
http://www.open-mpi.org/community/lists/users/2006/01/0517.php. */
|
||||
asprintf (&argv[local_exec_index],
|
||||
"set path = ( %s/%s $path ) ; "
|
||||
"%s%s%s set path = ( %s/%s $path ) ; "
|
||||
"if ( $?LD_LIBRARY_PATH == 1 ) "
|
||||
"set OMPI_have_llp ; "
|
||||
"if ( $?LD_LIBRARY_PATH == 0 ) "
|
||||
@ -931,6 +932,9 @@ int orte_pls_rsh_launch(orte_jobid_t jobid)
|
||||
"if ( $?OMPI_have_llp == 1 ) "
|
||||
"setenv LD_LIBRARY_PATH %s/%s:$LD_LIBRARY_PATH ; "
|
||||
"%s/%s/%s",
|
||||
(opal_prefix != NULL ? "setenv OPAL_PREFIX " : ""),
|
||||
(opal_prefix != NULL ? opal_prefix : ""),
|
||||
(opal_prefix != NULL ? " ;" : ""),
|
||||
prefix_dir, bin_base,
|
||||
prefix_dir, lib_base,
|
||||
prefix_dir, lib_base,
|
||||
|
@ -48,7 +48,7 @@
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#include "opal/install_dirs.h"
|
||||
#include "opal/mca/installdirs/installdirs.h"
|
||||
#include "opal/util/argv.h"
|
||||
#include "opal/util/output.h"
|
||||
#include "opal/util/opal_environ.h"
|
||||
@ -556,8 +556,8 @@ static int pls_slurm_start_proc(int argc, char **argv, char **env,
|
||||
explaining all the rationale for how / why we're doing
|
||||
this. */
|
||||
|
||||
lib_base = opal_basename(OPAL_LIBDIR);
|
||||
bin_base = opal_basename(OPAL_BINDIR);
|
||||
lib_base = opal_basename(opal_install_dirs.libdir);
|
||||
bin_base = opal_basename(opal_install_dirs.bindir);
|
||||
|
||||
/* If we have a prefix, then modify the PATH and
|
||||
LD_LIBRARY_PATH environment variables. */
|
||||
|
@ -45,7 +45,7 @@
|
||||
#include <errno.h>
|
||||
#include <tm.h>
|
||||
|
||||
#include "opal/install_dirs.h"
|
||||
#include "opal/mca/installdirs/installdirs.h"
|
||||
#include "opal/threads/condition.h"
|
||||
#include "opal/event/event.h"
|
||||
#include "opal/util/argv.h"
|
||||
@ -245,8 +245,8 @@ static int pls_tm_launch_job(orte_jobid_t jobid)
|
||||
/* Figure out the basenames for the libdir and bindir. There is a
|
||||
lengthy comment about this in pls_rsh_module.c explaining all
|
||||
the rationale for how / why we're doing this. */
|
||||
lib_base = opal_basename(OPAL_LIBDIR);
|
||||
bin_base = opal_basename(OPAL_BINDIR);
|
||||
lib_base = opal_basename(opal_install_dirs.libdir);
|
||||
bin_base = opal_basename(opal_install_dirs.bindir);
|
||||
|
||||
/* setup environment */
|
||||
env = opal_argv_copy(environ);
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "orte_config.h"
|
||||
#include "orte/orte_constants.h"
|
||||
|
||||
#include "opal/install_dirs.h"
|
||||
#include "opal/mca/installdirs/installdirs.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/mca/base/mca_base_param.h"
|
||||
#include "opal/util/output.h"
|
||||
@ -76,7 +76,7 @@ orte_rds_hostfile_component_t mca_rds_hostfile_component = {
|
||||
*/
|
||||
static int orte_rds_hostfile_open(void)
|
||||
{
|
||||
char *path = opal_os_path(false, OPAL_SYSCONFDIR, "openmpi-default-hostfile", NULL);
|
||||
char *path = opal_os_path(false, opal_install_dirs.sysconfdir, "openmpi-default-hostfile", NULL);
|
||||
OBJ_CONSTRUCT(&mca_rds_hostfile_component.lock, opal_mutex_t);
|
||||
|
||||
mca_base_param_reg_int(&mca_rds_hostfile_component.super.rds_version, "debug",
|
||||
|
@ -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$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -38,7 +38,6 @@
|
||||
#endif /* HAVE_SYS_WAIT_H */
|
||||
|
||||
#include "opal/event/event.h"
|
||||
#include "opal/install_dirs.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/threads/condition.h"
|
||||
#include "opal/util/argv.h"
|
||||
|
@ -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 Cisco, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -48,6 +49,7 @@
|
||||
#include "opal/util/show_help.h"
|
||||
#include "opal/util/trace.h"
|
||||
#include "opal/util/argv.h"
|
||||
#include "opal/runtime/opal.h"
|
||||
|
||||
#include "orte/dss/dss.h"
|
||||
#include "orte/class/orte_value_array.h"
|
||||
@ -205,6 +207,12 @@ int main(int argc, char *argv[])
|
||||
/* initialize the globals */
|
||||
memset(&orted_globals, 0, sizeof(orted_globals_t));
|
||||
|
||||
/* Ensure that enough of OPAL is setup for us to be able to run */
|
||||
if (OPAL_SUCCESS != opal_init_util()) {
|
||||
fprintf(stderr, "OPAL failed to initialize -- orted aborting\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* save the environment for use when launching application processes */
|
||||
orted_globals.saved_environ = opal_argv_copy(environ);
|
||||
|
||||
|
@ -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$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -39,7 +39,6 @@
|
||||
#endif /* HAVE_SYS_WAIT_H */
|
||||
|
||||
#include "opal/event/event.h"
|
||||
#include "opal/install_dirs.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/util/basename.h"
|
||||
#include "opal/util/cmd_line.h"
|
||||
|
@ -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$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -38,7 +38,6 @@
|
||||
#endif /* HAVE_SYS_WAIT_H */
|
||||
|
||||
#include "opal/event/event.h"
|
||||
#include "opal/install_dirs.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/threads/condition.h"
|
||||
#include "opal/util/argv.h"
|
||||
|
@ -42,7 +42,7 @@
|
||||
#endif /* HAVE_SYS_TIME_H */
|
||||
|
||||
#include "opal/event/event.h"
|
||||
#include "opal/install_dirs.h"
|
||||
#include "opal/mca/installdirs/installdirs.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/threads/condition.h"
|
||||
#include "opal/util/argv.h"
|
||||
@ -58,6 +58,7 @@
|
||||
#endif
|
||||
|
||||
#include "opal/version.h"
|
||||
#include "opal/runtime/opal.h"
|
||||
|
||||
#include "orte/orte_constants.h"
|
||||
|
||||
@ -344,6 +345,13 @@ int orterun(int argc, char *argv[])
|
||||
* we will get to them in a moment
|
||||
*/
|
||||
opal_mca_base_param_use_amca_sets = true;
|
||||
|
||||
/* Need to initialize OPAL so that install_dirs are filled in */
|
||||
|
||||
opal_init_util();
|
||||
|
||||
/* Setup MCA params */
|
||||
|
||||
mca_base_param_init();
|
||||
orte_register_params(false);
|
||||
|
||||
@ -1482,7 +1490,7 @@ static int create_app(int argc, char* argv[], orte_app_context_t **app_ptr,
|
||||
}
|
||||
/* --enable-orterun-prefix-default was given to orterun */
|
||||
else {
|
||||
param = strdup(OPAL_PREFIX);
|
||||
param = strdup(opal_install_dirs.prefix);
|
||||
}
|
||||
|
||||
if (NULL != param) {
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user