2006-09-21 16:08:52 +00:00
|
|
|
#! /usr/bin/env bash
|
2003-11-22 16:36:58 +00:00
|
|
|
#
|
2006-01-21 22:53:16 +00:00
|
|
|
# Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
2005-11-05 19:57:48 +00:00
|
|
|
# University Research and Technology
|
|
|
|
# Corporation. All rights reserved.
|
|
|
|
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
# of Tennessee Research Foundation. All rights
|
|
|
|
# reserved.
|
2004-11-28 20:09:25 +00:00
|
|
|
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
# University of Stuttgart. All rights reserved.
|
2005-03-24 12:43:37 +00:00
|
|
|
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
# All rights reserved.
|
2009-01-11 02:30:00 +00:00
|
|
|
# Copyright (c) 2007-2008 Cisco Systems, Inc. All rights reserved.
|
2004-11-22 01:38:40 +00:00
|
|
|
# $COPYRIGHT$
|
|
|
|
#
|
|
|
|
# Additional copyrights may follow
|
|
|
|
#
|
2004-01-07 14:43:42 +00:00
|
|
|
# $HEADER$
|
2003-11-22 16:36:58 +00:00
|
|
|
#
|
2004-08-06 14:30:18 +00:00
|
|
|
# This script is run on developer copies of Open MPI -- *not*
|
2003-11-22 16:36:58 +00:00
|
|
|
# distribution tarballs.
|
2004-01-04 00:14:51 +00:00
|
|
|
|
2005-05-04 01:02:06 +00:00
|
|
|
#set -x
|
2004-01-04 00:14:51 +00:00
|
|
|
|
2008-06-20 00:39:43 +00:00
|
|
|
# Just to make sure that local setup doesn't interfere with what we're
|
|
|
|
# doing here in this script
|
|
|
|
unalias test sort cut xargs echo 2> /dev/null
|
|
|
|
unset GREP_COLORS
|
|
|
|
|
2004-01-07 14:43:42 +00:00
|
|
|
##############################################################################
|
2004-01-04 00:14:51 +00:00
|
|
|
#
|
|
|
|
# User-definable parameters (search path and minimum supported versions)
|
2005-08-27 11:23:19 +00:00
|
|
|
#
|
|
|
|
# Note: use ';' to separate parameters
|
2004-01-07 14:43:42 +00:00
|
|
|
##############################################################################
|
2004-01-04 00:14:51 +00:00
|
|
|
|
2004-06-07 15:33:53 +00:00
|
|
|
ompi_aclocal_search="aclocal"
|
2005-08-27 11:23:19 +00:00
|
|
|
if test ! -z "$ACLOCAL"; then
|
|
|
|
ompi_aclocal_search="$ACLOCAL"
|
|
|
|
fi
|
2004-06-07 15:33:53 +00:00
|
|
|
ompi_autoheader_search="autoheader"
|
2005-08-27 11:23:19 +00:00
|
|
|
if test ! -z "$AUTOHEADER"; then
|
|
|
|
ompi_autoheader_search="$AUTOHEADER"
|
|
|
|
fi
|
2004-06-07 15:33:53 +00:00
|
|
|
ompi_autoconf_search="autoconf"
|
2005-08-27 11:23:19 +00:00
|
|
|
if test ! -z "$AUTOCONF"; then
|
|
|
|
ompi_autoconf_search="$AUTOCONF"
|
|
|
|
fi
|
2006-01-21 22:53:16 +00:00
|
|
|
ompi_autom4te_search="autom4te"
|
|
|
|
if test ! -z "$AUTOM4TE"; then
|
|
|
|
ompi_autom4te_search="$AUTOM4TE"
|
|
|
|
fi
|
2005-08-27 11:23:19 +00:00
|
|
|
ompi_libtoolize_search="libtoolize;glibtoolize"
|
|
|
|
if test ! -z "$LIBTOOLIZE"; then
|
|
|
|
ompi_libtoolize_search="$LIBTOOLIZE"
|
|
|
|
fi
|
2004-06-07 15:33:53 +00:00
|
|
|
ompi_automake_search="automake"
|
2005-08-27 11:23:19 +00:00
|
|
|
if test ! -z "$AUTOMAKE"; then
|
|
|
|
ompi_automake_search="$AUTOMAKE"
|
|
|
|
fi
|
2004-01-04 00:14:51 +00:00
|
|
|
|
2006-02-11 17:16:53 +00:00
|
|
|
ompi_automake_version="1.9.6"
|
2006-02-09 15:23:04 +00:00
|
|
|
ompi_autoconf_version="2.59"
|
2007-05-08 20:29:04 +00:00
|
|
|
ompi_libtool_version="1.5.22"
|
2004-01-04 00:14:51 +00:00
|
|
|
|
|
|
|
|
2004-01-07 14:43:42 +00:00
|
|
|
##############################################################################
|
2003-11-22 16:36:58 +00:00
|
|
|
#
|
2004-01-04 00:14:51 +00:00
|
|
|
# Global variables - should not need to modify defaults
|
2003-11-22 16:36:58 +00:00
|
|
|
#
|
2004-01-07 14:43:42 +00:00
|
|
|
##############################################################################
|
2003-11-22 16:36:58 +00:00
|
|
|
|
2004-06-07 15:33:53 +00:00
|
|
|
ompi_aclocal_version="$ompi_automake_version"
|
|
|
|
ompi_autoheader_version="$ompi_autoconf_version"
|
|
|
|
ompi_libtoolize_version="$ompi_libtool_version"
|
2006-01-21 22:53:16 +00:00
|
|
|
ompi_autom4te_version="$ompi_autoconf_version"
|
2004-01-04 00:14:51 +00:00
|
|
|
|
|
|
|
# program names to execute
|
2004-06-07 15:33:53 +00:00
|
|
|
ompi_aclocal=""
|
|
|
|
ompi_autoheader=""
|
|
|
|
ompi_autoconf=""
|
|
|
|
ompi_libtoolize=""
|
|
|
|
ompi_automake=""
|
2004-01-04 00:14:51 +00:00
|
|
|
|
2004-08-02 00:24:22 +00:00
|
|
|
mca_no_configure_components_file="config/mca_no_configure_components.m4"
|
2004-02-13 03:58:56 +00:00
|
|
|
mca_no_config_list_file="mca_no_config_list"
|
2005-07-06 18:38:57 +00:00
|
|
|
mca_no_config_env_file="mca_no_config_env"
|
2006-02-12 01:33:29 +00:00
|
|
|
mca_m4_include_file="config/mca_m4_config_include.m4"
|
2005-07-09 18:52:53 +00:00
|
|
|
mca_m4_config_env_file="mca_m4_config_env"
|
2004-09-23 23:46:58 +00:00
|
|
|
autogen_subdir_file="autogen.subdirs"
|
2006-02-12 01:33:29 +00:00
|
|
|
topdir_file="opal/include/opal_config_bottom.h"
|
2004-02-13 03:58:56 +00:00
|
|
|
|
2006-09-25 23:36:04 +00:00
|
|
|
if echo a | grep -E '(a|b)' >/dev/null 2>&1; then
|
|
|
|
egrep='grep -E'
|
|
|
|
else
|
|
|
|
egrep=egrep
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2004-01-07 14:43:42 +00:00
|
|
|
############################################################################
|
2004-01-04 00:14:51 +00:00
|
|
|
#
|
2004-01-07 14:43:42 +00:00
|
|
|
# Version check - does major,minor,release check (hopefully ignoring
|
|
|
|
# beta et al)
|
2004-01-04 00:14:51 +00:00
|
|
|
#
|
|
|
|
# INPUT:
|
|
|
|
# - minimum version allowable
|
|
|
|
# - version we found
|
|
|
|
#
|
|
|
|
# OUTPUT:
|
|
|
|
# - 0 version is ok
|
|
|
|
# - 1 version is not ok
|
|
|
|
#
|
|
|
|
# SIDE EFFECTS:
|
|
|
|
# none
|
|
|
|
#
|
2004-01-07 14:43:42 +00:00
|
|
|
##############################################################################
|
2004-01-04 00:14:51 +00:00
|
|
|
check_version() {
|
|
|
|
local min_version="$1"
|
|
|
|
local version="$2"
|
|
|
|
|
2007-05-09 19:54:10 +00:00
|
|
|
min_version=`echo $min_version | sed -e 's/[A-Za-z]//g'`
|
|
|
|
version=`echo $version | sed -e 's/[A-Za-z]//g'`
|
|
|
|
|
2004-01-04 00:14:51 +00:00
|
|
|
local min_major_version="`echo $min_version | cut -f1 -d.`"
|
|
|
|
local min_minor_version="`echo $min_version | cut -f2 -d.`"
|
|
|
|
local min_release_version="`echo $min_version | cut -f3 -d.`"
|
|
|
|
if test "$min_release_version" = "" ; then
|
|
|
|
min_release_version=0
|
|
|
|
fi
|
|
|
|
|
|
|
|
local major_version="`echo $version | cut -f1 -d.`"
|
|
|
|
local minor_version="`echo $version | cut -f2 -d.`"
|
|
|
|
local release_version="`echo $version | cut -f3 -d.`"
|
|
|
|
if test "$release_version" = "" ; then
|
|
|
|
release_version=0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test $min_major_version -lt $major_version ; then
|
|
|
|
return 0
|
|
|
|
elif test $min_major_version -gt $major_version ; then
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test $min_minor_version -lt $minor_version ; then
|
|
|
|
return 0
|
|
|
|
elif test $min_minor_version -gt $minor_version ; then
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test $min_release_version -gt $release_version ; then
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-01-07 14:43:42 +00:00
|
|
|
##############################################################################
|
2004-01-04 00:14:51 +00:00
|
|
|
#
|
2004-01-07 14:43:42 +00:00
|
|
|
# find app - find a version of the given application that is new
|
|
|
|
# enough for use
|
2004-01-04 00:14:51 +00:00
|
|
|
#
|
|
|
|
# INPUT:
|
|
|
|
# - name of application (eg aclocal)
|
2003-11-22 16:36:58 +00:00
|
|
|
#
|
2004-01-04 00:14:51 +00:00
|
|
|
# OUTPUT:
|
|
|
|
# none
|
2003-11-22 16:36:58 +00:00
|
|
|
#
|
2004-01-04 00:14:51 +00:00
|
|
|
# SIDE EFFECTS:
|
|
|
|
# - sets application_name variable to working executable name
|
|
|
|
# - aborts on error finding application
|
2003-12-24 01:49:07 +00:00
|
|
|
#
|
2004-01-07 14:43:42 +00:00
|
|
|
##############################################################################
|
2004-01-04 00:14:51 +00:00
|
|
|
find_app() {
|
|
|
|
local app_name="$1"
|
2003-12-24 01:49:07 +00:00
|
|
|
|
2004-01-04 00:14:51 +00:00
|
|
|
local version="0.0.0"
|
|
|
|
local min_version="99.99.99"
|
|
|
|
local found=0
|
2005-08-27 11:23:19 +00:00
|
|
|
local tmpIFS=$IFS
|
2004-01-04 00:14:51 +00:00
|
|
|
|
2004-06-07 15:33:53 +00:00
|
|
|
eval "min_version=\"\$ompi_${app_name}_version\""
|
|
|
|
eval "search_path=\"\$ompi_${app_name}_search\""
|
2005-08-27 11:23:19 +00:00
|
|
|
IFS=";"
|
2004-01-04 00:14:51 +00:00
|
|
|
for i in $search_path ; do
|
2005-08-27 11:23:19 +00:00
|
|
|
IFS="$tmpIFS"
|
2004-01-04 00:14:51 +00:00
|
|
|
version="`${i} --version 2>&1`"
|
|
|
|
if test "$?" != 0 ; then
|
2005-08-27 11:23:19 +00:00
|
|
|
IFS=";"
|
2003-12-24 01:49:07 +00:00
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2004-01-04 00:14:51 +00:00
|
|
|
version="`echo $version | cut -f2 -d')'`"
|
|
|
|
version="`echo $version | cut -f1 -d' '`"
|
|
|
|
|
|
|
|
if check_version $min_version $version ; then
|
2004-06-07 15:33:53 +00:00
|
|
|
eval "ompi_${app_name}=\"${i}\""
|
2007-05-09 19:54:10 +00:00
|
|
|
eval "ompi_${app_name}_found_version=$version"
|
2004-01-04 00:14:51 +00:00
|
|
|
found=1
|
2004-01-10 00:02:53 +00:00
|
|
|
break
|
2003-12-24 01:49:07 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2005-08-27 11:23:19 +00:00
|
|
|
IFS="$tmpIFS"
|
|
|
|
|
2004-01-04 00:14:51 +00:00
|
|
|
if test "$found" = "0" ; then
|
2003-11-22 16:36:58 +00:00
|
|
|
cat <<EOF
|
2004-01-04 00:14:51 +00:00
|
|
|
I could not find a recent enough copy of ${app_name}.
|
|
|
|
I am gonna abort. :-(
|
2003-11-22 16:36:58 +00:00
|
|
|
|
2004-01-04 00:14:51 +00:00
|
|
|
Please make sure you are using at least the following versions of the
|
|
|
|
GNU tools:
|
|
|
|
|
2004-06-07 15:33:53 +00:00
|
|
|
GNU Autoconf $ompi_autoconf_version
|
|
|
|
GNU Automake $ompi_automake_version
|
2004-07-08 17:49:41 +00:00
|
|
|
NOTE: You may need Automake 1.8.5 (or higher) in order to run
|
|
|
|
"make dist" successfully
|
2004-06-07 15:33:53 +00:00
|
|
|
GNU Libtool $ompi_libtool_version
|
2003-11-22 16:36:58 +00:00
|
|
|
|
|
|
|
EOF
|
2004-01-04 00:14:51 +00:00
|
|
|
exit 1
|
2003-11-22 16:36:58 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-01-07 14:43:42 +00:00
|
|
|
##############################################################################
|
2004-01-04 00:14:51 +00:00
|
|
|
#
|
|
|
|
# run_and_check - run the right GNU tool, printing warning on failure
|
|
|
|
#
|
|
|
|
# INPUT:
|
|
|
|
# - name of application (eg aclocal)
|
|
|
|
# - program arguments
|
2003-11-22 16:36:58 +00:00
|
|
|
#
|
2004-01-04 00:14:51 +00:00
|
|
|
# OUTPUT:
|
|
|
|
# none
|
2003-11-22 16:36:58 +00:00
|
|
|
#
|
2004-01-04 00:14:51 +00:00
|
|
|
# SIDE EFFECTS:
|
|
|
|
# - aborts on error running application
|
|
|
|
#
|
2004-01-07 14:43:42 +00:00
|
|
|
##############################################################################
|
2003-11-22 16:36:58 +00:00
|
|
|
run_and_check() {
|
2004-01-04 00:14:51 +00:00
|
|
|
local rac_progs="$*"
|
2007-05-09 19:54:10 +00:00
|
|
|
echo "$indent[Running] $rac_progs"
|
2003-11-22 16:36:58 +00:00
|
|
|
eval $rac_progs
|
|
|
|
if test "$?" != 0; then
|
|
|
|
cat <<EOF
|
|
|
|
|
2004-02-24 12:25:22 +00:00
|
|
|
-------------------------------------------------------------------------
|
|
|
|
It seems that the execution of "$rac_progs" has failed. See above for
|
|
|
|
the specific error message that caused it to abort.
|
|
|
|
-------------------------------------------------------------------------
|
2003-11-22 16:36:58 +00:00
|
|
|
|
|
|
|
EOF
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2004-01-07 14:43:42 +00:00
|
|
|
##############################################################################
|
2004-01-04 00:14:51 +00:00
|
|
|
#
|
|
|
|
# find_and_delete - look for standard files in a number of common places
|
|
|
|
# (e.g., ./config.guess, config/config.guess, dist/config.guess), and
|
|
|
|
# delete it. If it's not found there, look for AC_CONFIG_AUX_DIR in
|
|
|
|
# the configure.in script and try there. If it's not there, oh well.
|
2003-11-22 16:36:58 +00:00
|
|
|
#
|
2004-01-04 00:14:51 +00:00
|
|
|
# INPUT:
|
|
|
|
# - file to delete
|
2003-11-22 16:36:58 +00:00
|
|
|
#
|
2004-01-04 00:14:51 +00:00
|
|
|
# OUTPUT:
|
|
|
|
# none
|
|
|
|
#
|
|
|
|
# SIDE EFFECTS:
|
|
|
|
# - files may disappear
|
|
|
|
#
|
2004-01-07 14:43:42 +00:00
|
|
|
##############################################################################
|
2003-11-22 16:36:58 +00:00
|
|
|
find_and_delete() {
|
2004-01-04 00:14:51 +00:00
|
|
|
local fad_file="$1"
|
|
|
|
|
|
|
|
local fad_cfile
|
|
|
|
local auxdir
|
2003-11-22 16:36:58 +00:00
|
|
|
|
|
|
|
# Look for the file in "standard" places
|
|
|
|
|
|
|
|
if test -f $fad_file; then
|
|
|
|
rm -f $fad_file
|
|
|
|
elif test -d config/$fad_file; then
|
|
|
|
rm -f config/$fad_file
|
|
|
|
elif test -d dist/$fad_file; then
|
|
|
|
rm -f dist/$fad_file
|
|
|
|
else
|
|
|
|
|
|
|
|
# Didn't find it -- look for an AC_CONFIG_AUX_DIR line in
|
|
|
|
# configure.[in|ac]
|
|
|
|
|
|
|
|
if test -f configure.in; then
|
|
|
|
fad_cfile=configure.in
|
|
|
|
elif test -f configure.ac; then
|
|
|
|
fad_cfile=configure.ac
|
|
|
|
else
|
|
|
|
echo "--> Errr... there's no configure.in or configure.ac file!"
|
|
|
|
fi
|
|
|
|
if test -n "$fad_cfile"; then
|
2006-09-25 23:36:04 +00:00
|
|
|
auxdir="`grep AC_CONFIG_AUX_DIR $fad_cfile | $egrep -v '^dnl' | cut -d\( -f 2 | cut -d\) -f 1`"
|
2006-09-08 22:40:00 +00:00
|
|
|
fi
|
2003-11-22 16:36:58 +00:00
|
|
|
if test -f "$auxdir/$fad_file"; then
|
|
|
|
rm -f "$auxdir/$fad_file"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-01-11 21:35:37 +00:00
|
|
|
##############################################################################
|
|
|
|
#
|
2004-02-13 03:58:56 +00:00
|
|
|
# run_gnu_tools - run the GNU tools in a given directory
|
2004-01-11 21:35:37 +00:00
|
|
|
#
|
|
|
|
# INPUT:
|
2004-06-07 15:33:53 +00:00
|
|
|
# - OMPI top directory
|
2004-01-11 21:35:37 +00:00
|
|
|
#
|
|
|
|
# OUTPUT:
|
|
|
|
# none
|
|
|
|
#
|
|
|
|
# SIDE EFFECTS:
|
2004-02-13 03:58:56 +00:00
|
|
|
# - assumes that the directory is ready to have the GNU tools run
|
|
|
|
# in it (i.e., there's some form of configure.*)
|
|
|
|
# - may preprocess the directory before running the GNU tools
|
|
|
|
# (e.g., generale Makefile.am's from configure.params, etc.)
|
2004-01-11 21:35:37 +00:00
|
|
|
#
|
|
|
|
##############################################################################
|
|
|
|
run_gnu_tools() {
|
2004-10-21 16:27:17 +00:00
|
|
|
rgt_ompi_topdir="$1"
|
2004-02-13 03:58:56 +00:00
|
|
|
|
|
|
|
# Sanity check to ensure that there's a configure.in or
|
|
|
|
# configure.ac file here, or if there's a configure.params
|
|
|
|
# file and we need to run make_configure.pl.
|
|
|
|
|
|
|
|
if test -f configure.params -a -f configure.stub -a \
|
2004-06-07 15:33:53 +00:00
|
|
|
-x "$rgt_ompi_topdir/config/mca_make_configure.pl"; then
|
2004-02-13 03:58:56 +00:00
|
|
|
cat <<EOF
|
|
|
|
*** Found configure.stub
|
|
|
|
*** Running mca_make_configure.pl
|
|
|
|
EOF
|
2004-06-07 15:33:53 +00:00
|
|
|
"$rgt_ompi_topdir/config/mca_make_configure.pl" \
|
|
|
|
--ompidir "$rgt_ompi_topdir" \
|
2004-08-02 00:24:22 +00:00
|
|
|
--componentdir "`pwd`"
|
2004-02-13 03:58:56 +00:00
|
|
|
if test "$?" != "0"; then
|
|
|
|
echo "*** autogen.sh failed to complete!"
|
|
|
|
exit 1
|
|
|
|
fi
|
2004-10-21 16:27:17 +00:00
|
|
|
|
|
|
|
# If we need to make a version header template file, do so
|
|
|
|
|
|
|
|
rgt_abs_dir="`pwd`"
|
2006-09-25 23:38:04 +00:00
|
|
|
rgt_component_name=`basename "$rgt_abs_dir"`
|
|
|
|
rgt_component_type=`dirname "$rgt_abs_dir"`
|
|
|
|
rgt_component_type=`basename "$rgt_component_type"`
|
2004-10-21 16:27:17 +00:00
|
|
|
rgt_ver_header="$rgt_abs_dir/$rgt_component_type-$rgt_component_name-version.h"
|
2006-09-25 23:38:04 +00:00
|
|
|
rgt_ver_header_base=`basename "$rgt_ver_header"`
|
2004-10-21 16:27:17 +00:00
|
|
|
make_version_header_template "$rgt_ver_header_base" "$rgt_component_type" "$rgt_component_name"
|
|
|
|
|
2004-02-13 03:58:56 +00:00
|
|
|
happy=1
|
|
|
|
file=configure.ac
|
|
|
|
elif test -f configure.in; then
|
|
|
|
happy=1
|
|
|
|
file=configure.in
|
|
|
|
elif test -f configure.ac; then
|
|
|
|
happy=1
|
|
|
|
file=configure.ac
|
|
|
|
else
|
|
|
|
cat <<EOF
|
2005-05-04 01:02:06 +00:00
|
|
|
--> Err... there's no configure.in or configure.ac file in this directory
|
2004-02-13 03:58:56 +00:00
|
|
|
--> Confused; aborting in despair
|
|
|
|
EOF
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
unset happy
|
|
|
|
|
|
|
|
# Find and delete the GNU helper script files
|
|
|
|
|
|
|
|
find_and_delete config.guess
|
|
|
|
find_and_delete config.sub
|
|
|
|
find_and_delete depcomp
|
2005-12-09 15:13:36 +00:00
|
|
|
find_and_delete compile
|
2004-02-13 03:58:56 +00:00
|
|
|
find_and_delete install-sh
|
|
|
|
find_and_delete ltconfig
|
|
|
|
find_and_delete ltmain.sh
|
|
|
|
find_and_delete missing
|
|
|
|
find_and_delete mkinstalldirs
|
|
|
|
find_and_delete libtool
|
|
|
|
|
|
|
|
# Run the GNU tools
|
|
|
|
|
|
|
|
echo "*** Running GNU tools"
|
|
|
|
|
2006-02-12 01:33:29 +00:00
|
|
|
if test -f $topdir_file ; then
|
2006-01-21 22:53:16 +00:00
|
|
|
cd config
|
|
|
|
run_and_check $ompi_autom4te --language=m4sh ompi_get_version.m4sh -o ompi_get_version.sh
|
|
|
|
cd ..
|
|
|
|
fi
|
|
|
|
|
2004-02-13 03:58:56 +00:00
|
|
|
# We only need the libltdl stuff for the top-level
|
2004-08-02 00:24:22 +00:00
|
|
|
# configure, not any of the MCA components.
|
2004-02-13 03:58:56 +00:00
|
|
|
|
2006-02-12 01:33:29 +00:00
|
|
|
if test -f $topdir_file ; then
|
2005-07-02 14:29:45 +00:00
|
|
|
rm -rf libltdl opal/libltdl opal/ltdl.h
|
2004-06-07 15:33:53 +00:00
|
|
|
run_and_check $ompi_libtoolize --automake --copy --ltdl
|
2005-10-29 12:10:07 +00:00
|
|
|
if test -d libltdl; then
|
2007-05-09 19:54:10 +00:00
|
|
|
echo " -- Moving libltdl to opal/"
|
|
|
|
mv libltdl opal
|
|
|
|
fi
|
|
|
|
if check_version "1.10.0" $ompi_automake_found_version ; then
|
|
|
|
ver=`grep '^am__api_version' opal/libltdl/configure | cut -f2 -d=`
|
|
|
|
# eat single quotes
|
|
|
|
eval "ver=$ver"
|
|
|
|
if ! check_version "1.9.7" $ver ; then
|
|
|
|
indent=" "
|
|
|
|
echo "** Updating Automake version in libltdl package"
|
|
|
|
pushd opal/libltdl > /dev/null 2>&1
|
|
|
|
run_and_check $ompi_aclocal
|
|
|
|
run_and_check $ompi_automake
|
2007-11-07 02:30:40 +00:00
|
|
|
chmod u+w configure # Need this for FreeBSD.
|
2007-05-09 19:54:10 +00:00
|
|
|
run_and_check $ompi_autoconf
|
|
|
|
popd > /dev/null 2>&1
|
|
|
|
unset indent
|
|
|
|
fi
|
2005-10-29 12:10:07 +00:00
|
|
|
fi
|
|
|
|
if test ! -r opal/libltdl/ltdl.h; then
|
|
|
|
cat <<EOF
|
|
|
|
$ompi_libtoolize --ltdl apparently failed to install libltdl.
|
|
|
|
Please check that you have the libltdl development files installed.
|
|
|
|
EOF
|
|
|
|
exit 1
|
|
|
|
fi
|
2004-02-13 03:58:56 +00:00
|
|
|
|
2007-05-09 19:54:10 +00:00
|
|
|
echo "** Adjusting libltdl for OMPI :-("
|
2004-02-13 03:58:56 +00:00
|
|
|
|
2007-05-09 19:54:10 +00:00
|
|
|
echo " ++ patching for argz bugfix in libtool 1.5"
|
2005-07-02 14:29:45 +00:00
|
|
|
cd opal/libltdl
|
2004-03-17 19:06:06 +00:00
|
|
|
if test "`grep 'while ((before >= *pargz) && (before[-1] != LT_EOS_CHAR))' ltdl.c`" != ""; then
|
|
|
|
patch -N -p0 <<EOF
|
2004-02-13 03:58:56 +00:00
|
|
|
--- ltdl.c.old 2003-11-26 16:42:17.000000000 -0500
|
|
|
|
+++ ltdl.c 2003-12-03 17:06:27.000000000 -0500
|
|
|
|
@@ -682,7 +682,7 @@
|
|
|
|
/* This probably indicates a programmer error, but to preserve
|
|
|
|
semantics, scan back to the start of an entry if BEFORE points
|
|
|
|
into the middle of it. */
|
|
|
|
- while ((before >= *pargz) && (before[-1] != LT_EOS_CHAR))
|
|
|
|
+ while ((before > *pargz) && (before[-1] != LT_EOS_CHAR))
|
|
|
|
--before;
|
|
|
|
|
|
|
|
{
|
|
|
|
EOF
|
2005-05-04 01:02:06 +00:00
|
|
|
#'
|
2009-01-12 17:33:55 +00:00
|
|
|
rm -f ltdl.c.orig
|
|
|
|
rm -f ltdl.c.rej
|
2004-03-17 19:06:06 +00:00
|
|
|
else
|
2007-05-09 19:54:10 +00:00
|
|
|
echo " -- your libtool doesn't need this! yay!"
|
2004-03-17 19:06:06 +00:00
|
|
|
fi
|
|
|
|
cd ../..
|
2007-05-09 19:54:10 +00:00
|
|
|
echo " ++ patching 64-bit OS X bug in ltmain.sh"
|
2007-01-22 20:31:04 +00:00
|
|
|
if test ! -z "`grep otool config/ltmain.sh`" -a \
|
|
|
|
-z "`grep otool64 config/ltmain.sh`"; then
|
|
|
|
patch -N -p0 < config/ltmain_otool.diff
|
2007-05-08 13:24:08 +00:00
|
|
|
rm -f config/ltmain.sh.orig
|
2009-01-12 17:33:55 +00:00
|
|
|
rm -f config/ltmain.sh.rej
|
2007-01-22 20:31:04 +00:00
|
|
|
else
|
2007-05-09 19:54:10 +00:00
|
|
|
echo " -- your libtool doesn't need this! yay!"
|
2007-01-22 20:31:04 +00:00
|
|
|
fi
|
2007-03-05 17:21:42 +00:00
|
|
|
|
2007-05-09 19:54:10 +00:00
|
|
|
echo " ++ RTLD_GLOBAL in libltdl"
|
2007-03-05 17:21:42 +00:00
|
|
|
if test -r opal/libltdl/loaders/dlopen.c && \
|
|
|
|
test ! -z "`grep 'filename, LT_LAZY_OR_NOW' opal/libltdl/loaders/dlopen.c`"; then
|
|
|
|
patch -N -p0 < config/libltdl_dlopen_global.diff
|
2009-01-12 17:33:55 +00:00
|
|
|
rm -f opal/libltdl/loaders/dlopen.c.rej
|
2007-03-05 17:21:42 +00:00
|
|
|
else
|
2007-05-09 19:54:10 +00:00
|
|
|
echo " -- your libltdl doesn't need this! yay!"
|
2007-03-05 17:21:42 +00:00
|
|
|
fi
|
2007-05-15 04:23:48 +00:00
|
|
|
if grep 'chmod -w \.' configure ; then
|
|
|
|
echo " ++ patching configure for broken -c/-o compiler test"
|
|
|
|
sed -e 's/chmod -w \./#OMPI\/MPI FIX: chmod -w ./' \
|
|
|
|
configure > configure.new
|
|
|
|
mv configure.new configure
|
|
|
|
chmod a+x configure
|
|
|
|
fi
|
2008-05-27 21:58:09 +00:00
|
|
|
|
|
|
|
# See http://lists.gnu.org/archive/html/bug-libtool/2008-05/msg00045.html
|
|
|
|
if check_version "2.1.9999" $ompi_libtoolize_found_version ; then
|
|
|
|
echo " ++ patching for ifort (LT 2.2.0-4)"
|
|
|
|
cd opal/libltdl/m4
|
|
|
|
patch -N -p0 < ../../../config/lt224-icc.diff > /dev/null 2>&1
|
|
|
|
rm -f libtool.m4.orig
|
2009-01-12 17:33:55 +00:00
|
|
|
rm -f libtool.m4.rej
|
2008-05-27 21:58:09 +00:00
|
|
|
cd ../../..
|
|
|
|
fi
|
2004-02-13 03:58:56 +00:00
|
|
|
else
|
2004-06-07 15:33:53 +00:00
|
|
|
run_and_check $ompi_libtoolize --automake --copy
|
2004-02-13 03:58:56 +00:00
|
|
|
fi
|
2008-05-27 21:58:09 +00:00
|
|
|
|
|
|
|
if test -f $topdir_file; then
|
|
|
|
run_and_check $ompi_aclocal -I config
|
|
|
|
else
|
|
|
|
run_and_check $ompi_aclocal
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "`grep AC_CONFIG_HEADER $file`" != "" -o \
|
|
|
|
"`grep AM_CONFIG_HEADER $file`" != ""; then
|
|
|
|
run_and_check $ompi_autoheader
|
|
|
|
fi
|
|
|
|
|
|
|
|
# We only need to patch the top-level aclocal.m4 for libtool stuff
|
|
|
|
# because this only affects creating C++ libraries (with pathCC).
|
|
|
|
# This must be done before we run autoconf.
|
|
|
|
|
|
|
|
if test -f $topdir_file; then
|
|
|
|
echo "** Adjusting libtool for OMPI :-("
|
|
|
|
if ! check_version "2.0.0" $ompi_libtoolize_found_version ; then
|
|
|
|
echo " ++ patching for pathscale multi-line output (LT 1.5.x)"
|
|
|
|
patch -N -p0 < config/lt1522-pathCC.diff > /dev/null 2>&1
|
|
|
|
else
|
|
|
|
echo " ++ patching for pathscale multi-line output (LT 2.x)"
|
|
|
|
patch -N -p0 < config/lt21a-pathCC.diff > /dev/null 2>&1
|
|
|
|
fi
|
2009-01-12 17:33:55 +00:00
|
|
|
rm -f aclocal.m4.orig
|
|
|
|
rm -f aclocal.m4.rej
|
2008-05-27 21:58:09 +00:00
|
|
|
# See http://lists.gnu.org/archive/html/bug-libtool/2008-05/msg00045.html
|
|
|
|
if check_version "2.1.9999" $ompi_libtoolize_found_version ; then
|
|
|
|
echo " ++ patching for ifort (LT 2.2.0-4)"
|
|
|
|
cd config
|
|
|
|
patch -N -p0 < lt224-icc.diff > /dev/null 2>&1
|
|
|
|
rm -f libtool.m4.orig
|
2009-01-12 17:33:55 +00:00
|
|
|
rm -f libtool.m4.rej
|
2008-05-27 21:58:09 +00:00
|
|
|
cd ..
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Libtool 1.5.2x and 2.1x automatically link in the "Cstd" STL library
|
|
|
|
# when using the Sun compilers on Linux or Solaris, even if the
|
|
|
|
# application does not use the STL (as of Feb 2008, Open MPI does not
|
|
|
|
# use any C++ STL). The problem is that Solaris has two different STL
|
|
|
|
# libraries: Cstd and stlport. Having Libtool choose that OMPI (and its
|
|
|
|
# wrapper compilers) use Cstd is problematic for users who want to
|
|
|
|
# compile their MPI applications with the other STL library. So we
|
|
|
|
# currently hack aclocal's LT macros to *not* add the Cstd library to
|
|
|
|
# any of OMPI's CXXFLAGS; the OMPI wrapper compilers can then therefore
|
|
|
|
# be used with any STL library -- it's the user's choice.
|
|
|
|
|
|
|
|
echo " ++ patching to remove solaris Cstd"
|
|
|
|
sed -e 's/-lCstd -lCrun//' \
|
|
|
|
-e 's/-library=Cstd -library=Crun//' \
|
|
|
|
aclocal.m4 > aclocal.m4.new
|
|
|
|
cp aclocal.m4.new aclocal.m4
|
|
|
|
rm -f aclocal.m4.new
|
2008-11-25 15:59:48 +00:00
|
|
|
|
|
|
|
# This patch fixes a bug in Libtool's detection of the Sun Studio
|
|
|
|
# Fortran compiler. See the below e-mail thread for more details:
|
|
|
|
# http://www.open-mpi.org/community/lists/devel/2008/11/4920.php
|
|
|
|
echo " ++ patching for Sun Studio Fortran compilers"
|
|
|
|
patch -N -p0 < config/lt-sun-fortran.diff > /dev/null 2>&1
|
2009-01-12 17:33:55 +00:00
|
|
|
rm -f libtool.m4.orig
|
|
|
|
rm -f libtool.m4.rej
|
2008-05-27 21:58:09 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
run_and_check $ompi_autoconf
|
|
|
|
|
2004-06-07 15:33:53 +00:00
|
|
|
run_and_check $ompi_automake --foreign -a --copy --include-deps
|
2004-02-13 03:58:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-07-06 18:38:57 +00:00
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
#
|
|
|
|
# run_no_configure_component
|
|
|
|
# Prepares the non-configure component
|
|
|
|
#
|
|
|
|
# INPUT:
|
|
|
|
# - OMPI top directory
|
|
|
|
#
|
|
|
|
# OUTPUT:
|
|
|
|
# none
|
|
|
|
#
|
|
|
|
# SIDE EFFECTS:
|
|
|
|
#
|
|
|
|
##############################################################################
|
|
|
|
run_no_configure_component() {
|
|
|
|
noconf_dir="$1"
|
|
|
|
noconf_ompi_topdir="$2"
|
|
|
|
noconf_project="$3"
|
|
|
|
noconf_framework="$4"
|
|
|
|
noconf_component="$5"
|
|
|
|
|
|
|
|
# Write out to two files (they're merged at the end)
|
|
|
|
noconf_list_file="$noconf_ompi_topdir/$mca_no_config_list_file"
|
|
|
|
noconf_env_file="$noconf_ompi_topdir/$mca_no_config_env_file"
|
|
|
|
|
|
|
|
cat >> "$noconf_list_file" <<EOF
|
|
|
|
dnl ----------------------------------------------------------------
|
|
|
|
|
|
|
|
dnl No-configure component:
|
|
|
|
dnl $noconf_dir
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
# Tell configure to add all the PARAM_CONFIG_FILES to
|
|
|
|
# the AC_CONFIG_FILES list.
|
|
|
|
for file in $PARAM_CONFIG_FILES; do
|
|
|
|
echo "AC_CONFIG_FILES([$noconf_dir/$file])" >> "$noconf_list_file"
|
|
|
|
done
|
|
|
|
|
2005-07-09 18:52:53 +00:00
|
|
|
cat <<EOF
|
|
|
|
--> Adding to top-level configure no-configure subdirs:
|
|
|
|
--> $noconf_dir
|
|
|
|
--> Adding to top-level configure AC_CONFIG_FILES list:
|
|
|
|
--> $PARAM_CONFIG_FILES
|
|
|
|
EOF
|
2005-07-06 18:38:57 +00:00
|
|
|
|
2005-08-16 05:21:34 +00:00
|
|
|
echo "$PARAM_CONFIG_PRIORITY $noconf_component" >> "$noconf_env_file"
|
2005-07-09 18:52:53 +00:00
|
|
|
}
|
2005-07-06 18:38:57 +00:00
|
|
|
|
|
|
|
|
2005-07-09 18:52:53 +00:00
|
|
|
##############################################################################
|
|
|
|
#
|
|
|
|
# run_m4_configure_component
|
|
|
|
# Prepares the component with an .m4 file that should be used to
|
|
|
|
# configure the component.
|
|
|
|
#
|
|
|
|
# INPUT:
|
|
|
|
#
|
|
|
|
# OUTPUT:
|
|
|
|
# none
|
|
|
|
#
|
|
|
|
# SIDE EFFECTS:
|
|
|
|
#
|
|
|
|
##############################################################################
|
|
|
|
run_m4_configure_component() {
|
|
|
|
m4conf_dir="$1"
|
|
|
|
m4conf_ompi_topdir="$2"
|
|
|
|
m4conf_project="$3"
|
|
|
|
m4conf_framework="$4"
|
|
|
|
m4conf_component="$5"
|
|
|
|
|
|
|
|
# Write out to two files (they're merged at the end)
|
|
|
|
m4conf_list_file="$m4conf_ompi_topdir/$mca_no_config_list_file"
|
|
|
|
m4conf_env_file="$m4conf_ompi_topdir/$mca_m4_config_env_file"
|
|
|
|
|
|
|
|
cat >> "$m4conf_list_file" <<EOF
|
|
|
|
dnl ----------------------------------------------------------------
|
2005-07-06 18:38:57 +00:00
|
|
|
|
2005-07-09 18:52:53 +00:00
|
|
|
dnl m4-configure component:
|
|
|
|
dnl $m4conf_dir
|
2005-07-06 18:38:57 +00:00
|
|
|
|
|
|
|
EOF
|
|
|
|
|
2005-07-09 18:52:53 +00:00
|
|
|
# Tell configure to add all the PARAM_CONFIG_FILES to
|
|
|
|
# the AC_CONFIG_FILES list.
|
|
|
|
for file in $PARAM_CONFIG_FILES; do
|
|
|
|
echo "AC_CONFIG_FILES([$m4conf_dir/$file])" >> "$m4conf_list_file"
|
|
|
|
done
|
|
|
|
|
2005-07-28 15:48:46 +00:00
|
|
|
# add the m4_include of the m4 file into the mca .m4 file
|
|
|
|
# directly. It shouldn't be in a macro, so this is fairly safe to
|
|
|
|
# do. By this point, there should already be a header and all
|
|
|
|
# that. m4_includes are relative to the currently included file,
|
|
|
|
# so need the .. to get us from config/ to the topsrcdir again.
|
|
|
|
echo "m4_include(${m4conf_project}/mca/${m4conf_framework}/${m4conf_component}/configure.m4)" >> "$m4conf_ompi_topdir/$mca_m4_include_file"
|
2005-07-09 18:52:53 +00:00
|
|
|
|
2005-07-06 18:38:57 +00:00
|
|
|
cat <<EOF
|
2005-07-09 18:52:53 +00:00
|
|
|
--> Adding to top-level configure m4-configure subdirs:
|
|
|
|
--> $m4conf_dir
|
2005-07-06 18:38:57 +00:00
|
|
|
--> Adding to top-level configure AC_CONFIG_FILES list:
|
|
|
|
--> $PARAM_CONFIG_FILES
|
|
|
|
EOF
|
|
|
|
|
2005-08-16 05:21:34 +00:00
|
|
|
echo "$PARAM_CONFIG_PRIORITY $m4conf_component" >> "$m4conf_env_file"
|
2005-07-06 18:38:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-18 10:36:08 +00:00
|
|
|
##############################################################################
|
|
|
|
#
|
|
|
|
# make_template_version_header -- make a templated version header
|
|
|
|
# file, but only if we have a PARAM_VERSION_FILE that exists
|
|
|
|
#
|
|
|
|
# INPUT:
|
|
|
|
# - filename base
|
|
|
|
# - component type name
|
|
|
|
# - component name
|
|
|
|
#
|
|
|
|
# OUTPUT:
|
|
|
|
# none
|
|
|
|
#
|
|
|
|
# SIDE EFFECTS:
|
|
|
|
#
|
|
|
|
##############################################################################
|
|
|
|
make_version_header_template() {
|
|
|
|
mvht_filename="$1"
|
|
|
|
mvht_component_type="$2"
|
|
|
|
mvht_component_name="$3"
|
|
|
|
|
|
|
|
# See if we have a VERSION file
|
|
|
|
|
|
|
|
PARAM_CONFIG_FILES_save="$PARAM_CONFIG_FILES"
|
|
|
|
. ./configure.params
|
|
|
|
if test -z "$PARAM_VERSION_FILE"; then
|
|
|
|
if test -f "VERSION"; then
|
|
|
|
PARAM_VERSION_FILE="VERSION"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
if test ! -f "$PARAM_VERSION_FILE"; then
|
|
|
|
PARAM_VERSION_FILE=
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -n "$PARAM_VERSION_FILE" -a -f "$PARAM_VERSION_FILE" -a \
|
|
|
|
"$pd_component_type" != "common"; then
|
|
|
|
rm -f "$mvht_filename.template.in"
|
|
|
|
cat > "$mvht_filename.template.in" <<EOF
|
|
|
|
/*
|
|
|
|
* This file is automatically created by autogen.sh; it should not
|
|
|
|
* be edited by hand!!
|
|
|
|
*
|
|
|
|
* List of version number for this component
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MCA_${mvht_component_type}_${mvht_component_name}_VERSION_H
|
|
|
|
#define MCA_${mvht_component_type}_${mvht_component_name}_VERSION_H
|
|
|
|
|
|
|
|
#define MCA_${mvht_component_type}_${mvht_component_name}_MAJOR_VERSION @MCA_${mvht_component_type}_${mvht_component_name}_MAJOR_VERSION@
|
|
|
|
#define MCA_${mvht_component_type}_${mvht_component_name}_MINOR_VERSION @MCA_${mvht_component_type}_${mvht_component_name}_MINOR_VERSION@
|
|
|
|
#define MCA_${mvht_component_type}_${mvht_component_name}_RELEASE_VERSION @MCA_${mvht_component_type}_${mvht_component_name}_RELEASE_VERSION@
|
|
|
|
#define MCA_${mvht_component_type}_${mvht_component_name}_GREEK_VERSION "@MCA_${mvht_component_type}_${mvht_component_name}_GREEK_VERSION@"
|
|
|
|
#define MCA_${mvht_component_type}_${mvht_component_name}_SVN_VERSION "@MCA_${mvht_component_type}_${mvht_component_name}_SVN_VERSION@"
|
|
|
|
#define MCA_${mvht_component_type}_${mvht_component_name}_VERSION "@MCA_${mvht_component_type}_${mvht_component_name}_VERSION@"
|
|
|
|
|
|
|
|
#endif /* MCA_${mvht_component_type}_${mvht_component_name}_VERSION_H */
|
|
|
|
EOF
|
|