1
1

Rollback the last two commits.

svn merge -r 19823:19821 https://svn.open-mpi.org/svn/ompi/trunk ./

I copied the config directory in another location, and the original
.svn directory was replaced by the Open MPI one ... As a result my
first commit, applied the changes on the Open MPI trunk instead of
the other project.

This commit was SVN r19824.
This commit is contained in:
George Bosilca 2008-10-28 17:22:29 +00:00
parent e0bb777a51
commit d33801c0fa
80 changed files with 13132 additions and 2 deletions

View File

@ -19,11 +19,11 @@
EXTRA_DIST = \
distscript.csh \
opal_get_version.m4sh \
ompi_get_version.m4sh \
libltdl_dlopen_global.diff \
lt1522-pathCC.diff \
lt21a-pathCC.diff \
ltmain_otool.diff
maintainer-clean-local:
rm -f opal_get_version.sh
rm -f ompi_get_version.sh

20
config/Makefile.options Normal file
View File

@ -0,0 +1,20 @@
# -*- makefile -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# 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.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
AUTOMAKE_OPTIONS = foreign dist-bzip2

View File

@ -0,0 +1,94 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
AC_DEFUN([OMPI_CXX_FIND_EXCEPTION_FLAGS],[
#
# Arguments: none
#
# Dependencies: none
#
# Get the exception handling flags for the C++ compiler. Leaves
# CXXFLAGS undisturbed.
# Provides --with-exflags command line argument for configure as well.
#
# Sets OMPI_CXX_EXCEPTION_CXXFLAGS and OMPI_CXX_EXCEPTION_LDFLAGS as
# appropriate.
# Must call AC_SUBST manually
#
# Command line flags
AC_ARG_WITH(exflags,
AC_HELP_STRING([--with-exflags],
[Specify flags necessary to enable C++ exceptions]),
ompi_force_exflags="$withval")
ompi_CXXFLAGS_SAVE="$CXXFLAGS"
AC_MSG_CHECKING([for compiler exception flags])
# See which flags to use
if test "$ompi_force_exflags" != ""; then
# If the user supplied flags, use those
ompi_exflags="$ompi_force_exflags"
elif test "$GXX" = "yes"; then
# g++ has changed their flags a few times. Sigh.
CXXFLAGS="$CXXFLAGS -fexceptions"
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[]], [[try { int i = 0; } catch(...) { int j = 2; }]]), ompi_happy=1, ompi_happy=0)
if test "$ompi_happy" = "1"; then
ompi_exflags="-fexceptions";
else
CXXFLAGS="$CXXFLAGS_SAVE -fhandle-exceptions"
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[]], [[try { int i = 0; } catch(...) { int j = 2; }]]), ompi_happy=1, ompi_happy=0)
if test "$ompi_happy" = "1"; then
ompi_exflags="-fhandle-exceptions";
fi
fi
AC_LANG_RESTORE
elif test "`basename $CXX`" = "KCC"; then
# KCC flags
ompi_exflags="--exceptions"
fi
CXXFLAGS="$ompi_CXXFLAGS_SAVE"
# Save the result
OMPI_CXX_EXCEPTIONS_CXXFLAGS="$ompi_exflags"
OMPI_CXX_EXCEPTIONS_LDFLAGS="$ompi_exflags"
if test "$ompi_exflags" = ""; then
AC_MSG_RESULT([none necessary])
else
AC_MSG_RESULT([$ompi_exflags])
fi
# Clean up
unset ompi_force_exflags ompi_CXXFLAGS_SAVE ompi_exflags ompi_happy])dnl

View File

@ -0,0 +1,44 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
AC_DEFUN([OMPI_CXX_FIND_TEMPLATE_PARAMETERS],[
#
# Arguments: none
#
# Dependencies: None
#
# Get the C++ compiler template parameters.
#
# Adds to CXXFLAGS
AC_MSG_CHECKING([for C++ compiler template parameters])
if test "$BASECXX" = "KCC"; then
new_flags="--one_instantiation_per_object"
CXXFLAGS="$CXXFLAGS $new_flags"
else
new_flags="none needed"
fi
AC_MSG_RESULT([$new_flags])
#
# Clean up
#
unset new_flags
])

View File

@ -0,0 +1,170 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
AC_DEFUN([OMPI_CXX_FIND_TEMPLATE_REPOSITORY],[
AC_REQUIRE([AC_PROG_GREP])
#
# Arguments: None
#
# Dependencies: None
#
# See if the compiler makes template repository directories
# Warning: this is a really screwy example! -JMS
#
# Sets OMPI_CXX_TEMPLATE_REPOSITORY to the template repository, or blank.
# Must call AC_SUBST manually
#
AC_CACHE_CHECK([for C++ template_repository_directory],
[ompi_cv_cxx_template_repository],
[_OMPI_CXX_FIND_TEMPLATE_REPOSITORY])
if test "$ompi_cv_cxx_template_repository" = "not used" ; then
OMPI_CXX_TEMPLATE_REPOSITORY=
elif test "$ompi_cv_cxx_template_repository" = "templates not supported" ; then
OMPI_CXX_TEMPLATE_REPOSITORY=
else
OMPI_CXX_TEMPLATE_REPOSITORY="$ompi_cv_cxx_template_repository"
fi
])
AC_DEFUN([_OMPI_CXX_FIND_TEMPLATE_REPOSITORY],[
# Find the repository
mkdir conf_tmp_$$
cd conf_tmp_$$
cat > conftest.h <<EOF
template <class T>
class foo {
public:
foo(T yow) : data(yow) { yow.member(3); };
void member(int i);
private:
T data;
};
class bar {
public:
bar(int i) { data = i; };
void member(int j) { data = data * j; };
private:
int data;
};
EOF
cat > conftest2.C <<EOF
#include "conftest.h"
void
some_other_function(void)
{
foo<bar> var1(6);
foo< foo<bar> > var2(var1);
}
EOF
cat > conftest1.C <<EOF
#include "conftest.h"
void some_other_function(void);
template <class T>
void
foo<T>::member(int i)
{
i += 2;
}
int
main()
{
foo<bar> var1(6);
foo< foo<bar> > var2(var1);
some_other_function();
return 0;
}
EOF
ompi_template_failed=
echo configure:__oline__: $CXX $CXXFLAGS -c conftest1.C >&5
$CXX $CXXFLAGS -c conftest1.C >&5 2>&5
if test ! -f conftest1.o ; then
ompi_cv_cxx_template_repository="templates not supported"
echo configure:__oline__: here is the program that failed: >&5
cat conftest1.C >&5
echo configure:__oline__: here is conftest.h: >&5
cat conftest.h >&5
ompi_template_failed=1
else
echo configure:__oline__: $CXX $CXXFLAGS -c conftest2.C >&5
$CXX $CXXFLAGS -c conftest2.C >&5 2>&5
if test ! -f conftest2.o ; then
ompi_cv_cxx_template_repository=
echo configure:__oline__: here is the program that failed: >&5
cat conftest2.C >&5
echo configure:__oline__: here is conftest.h: >&5
cat conftest.h >&5
else
rm -rf conftest*
for ompi_file in `ls`
do
if test "$ompi_file" != "." -a "$ompi_file" != ".."; then
# Is it a directory?
if test -d "$ompi_file"; then
ompi_template_dir="$ompi_file $ompi_template_dir"
# Or is it a file?
else
name="`echo $ompi_file | cut -d. -f1`"
temp_mask=
if test "$name" = "main" -o "$name" = "other"; then
temp_mask="`echo $ompi_file | cut -d. -f2`"
if test "$ompi_template_filemask" = ""; then
ompi_template_filemask="$temp_mask";
elif test "`echo $ompi_template_filemask | $GREP $temp_mask`" = ""; then
ompi_template_filemask="$ompi_template_filemask $temp_mask"
fi
fi
fi
fi
done
if test "$ompi_template_filemask" != ""; then
temp_mask=
for mask in $ompi_template_filemask
do
temp_mask="*.$mask $temp_mask"
done
ompi_template_filemask=$temp_mask
fi
fi
fi
ompi_cv_cxx_template_repository="$ompi_template_dir $ompi_template_filemask"
if test "`echo $ompi_cv_cxx_template_repository`" = ""; then
ompi_cv_cxx_template_repository="not used"
fi
cd ..
rm -rf conf_tmp_$$
# Clean up
unset ompi_file ompi_template_failed ompi_template_dir])

View File

@ -0,0 +1,44 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
AC_DEFUN([OMPI_CXX_HAVE_EXCEPTIONS],[
#
# Arguments: None
#
# Depdencies: None
#
# Check to see if the C++ compiler can handle exceptions
#
# Sets OMPI_CXX_EXCEPTIONS to 1 if compiler has exceptions, 0 if not
#
AC_MSG_CHECKING([for throw/catch])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[]], [[int i=1; throw(i);]]),
OMPI_CXX_EXCEPTIONS=1, OMPI_CXX_EXCPTIONS=0)
if test "$OMPI_CXX_EXCEPTIONS" = "1"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
# Clean up
AC_LANG_RESTORE])dnl

235
config/distscript.csh Executable file
View File

@ -0,0 +1,235 @@
#! /bin/csh -f
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# 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.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
set srcdir="$1"
set builddir="`pwd`"
set distdir="$builddir/$2"
set OMPI_VERSION="$3"
set OMPI_SVN_VERSION="$4"
if ("$distdir" == "") then
echo "Must supply relative distdir as argv[2] -- aborting"
exit 1
elif ("$OMPI_VERSION" == "") then
echo "Must supply version as argv[1] -- aborting"
exit 1
endif
# we can catch some hard (but possible) to do mistakes by looking at
# our tree's revision number, but only if we are in the source tree.
# Otherwise, use what configure told us, at the cost of allowing one
# or two corner cases in (but otherwise VPATH builds won't work)
set svn_r=$OMPI_SVN_VERSION
if (-d .svn) then
set svn_r="r`svnversion .`"
endif
set start=`date`
cat <<EOF
Creating Open MPI distribution
In directory: `pwd`
Version: $OMPI_VERSION
Started: $start
EOF
umask 022
if (! -d "$distdir") then
echo "*** ERROR: dist dir does not exist"
echo "*** ERROR: $distdir"
exit 1
endif
#
# See if we need to update the version file with the current SVN
# revision number. Do this *before* entering the distribution tree to
# solve a whole host of problems with VPATH (since srcdir may be
# relative or absolute)
#
set cur_svn_r="`grep '^svn_r' ${distdir}/VERSION | cut -d= -f2`"
if ("$cur_svn_r" == "-1") then
sed -e 's/^svn_r=.*/svn_r='$svn_r'/' "${distdir}/VERSION" > "${distdir}/version.new"
cp "${distdir}/version.new" "${distdir}/VERSION"
rm -f "${distdir}/version.new"
# need to reset the timestamp to not annoy AM dependencies
touch -r "${srcdir}/VERSION" "${distdir}/VERSION"
echo "*** Updated VERSION file with SVN r number"
else
echo "*** Did NOT updated VERSION file with SVN r number"
endif
# Copy configure.params and autogen.subdirs files into distribution.
# This should really be in each component's Makefile.am, but that's
# never going to happen. So copy here automagically.
echo "*** Copying configure.params files"
find opal orte ompi -name "configure.params" -exec cp -f -p "{}" "$distdir/{}" \; >& /dev/null
echo "*** Copying autogen.subdirs files"
find opal orte ompi -name "autogen.subdirs" -exec cp -f -p "{}" "$distdir/{}" \; >& /dev/null
#########################################################
# VERY IMPORTANT: Now go into the new distribution tree #
#########################################################
cd "$distdir"
echo "*** Now in distdir: $distdir"
#
# Get the latest config.guess and config.sub from ftp.gnu.org
#
echo "*** Downloading latest config.sub/config.guess from ftp.gnu.org..."
cd config
set configdir="`pwd`"
mkdir tmp.$$
cd tmp.$$
# Official HTTP git mirrors for config.guess / config.sub
wget -t 1 -T 10 -O config.guess 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=master'
wget -t 1 -T 10 -O config.sub 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=master'
chmod +x config.guess config.sub
# Recently, ftp.gnu.org has had zero-legnth config.guess / config.sub
# files, which causes the automated nightly SVN snapshot tarball to
# fail to be made correctly. This is a primitive attempt to fix that.
# If we got zero-length files from wget, use a config.guess /
# config.sub from a known location that is more recent than what ships
# in the current generation of auto* tools.
if (! -f config.guess || ! -s config.guess) then
echo " - WARNING: Got BAD config.guess from ftp.gnu.org"
echo " - WARNING: using included version"
else
cp config.guess ..
endif
if (! -f config.sub || ! -s config.sub) then
echo " - WARNING: Got BAD config.sub from ftp.gnu.org"
echo " - WARNING: using known version"
else
cp config.sub ..
endif
cd ..
rm -rf tmp.$$
cd ..
#
# Find all the config.guess/config.sub files, and replace them with
# the ones that we've downloaded
#
echo "*** Now in: `pwd`"
echo "*** Replacing config.sub/config.guess with latest from ftp.gnu.org..."
foreach file (config.guess config.sub)
foreach dir (opal orte ompi)
find $dir -name $file \
-exec chmod +w {} \; \
-exec cp -f $configdir/$file {} \; \
-print
end
end
#
# Put in date/version number in man pages
# JMS don't have man pages yet -- this is a straight copy from LAM7
#
set ver="$OMPI_VERSION"
#echo "*** Updating version date/number in man pages"
#rm -f manfiles
#find man -type f | grep -v Makefile > manfiles
#set date="`date '+%B, %Y'`"
#cp $srcdir/config/doctext.nroff.def .
#foreach file (`cat manfiles` doctext.nroff.def)
# sed -e "s/-RELEASEDATE-/$date/g" $file > foo
# sed -e "s/-RELEASEVERSION-/$ver/g" foo > bar
# rm -f $file # Needed 'cause automake makes hard links, not copies
# mv bar $file
# rm -f foo
#end
#rm -f manfiles
#
# Make all the man pages -- doctext needs to be in your path
# JMS: Don't have man pages yet; need to do this at some point
#
#
# Now we need to list all these generated man pages in the Makefile.am
# and Makefile.in in man/man3. Ick!
# JMS: Will probably need to do this as well. Sigh.
#
#echo "*** Frobbing Makefile.am and Makefile.in..."
#cd ../../man/man3
#set files="`ls MPI_*3 MPIO_*3 XMPI_*3 MPIL_*3`"
#
# This is unfortunately necessary because $files is too long to do a
# single sed search/replace. Ugh.
# JMS: Will probably need to do this as well. Sigh.
#
#echo "*** Adding man files to Makefile.in..."
#foreach file ($files)
# set name_prefix="`echo $file | cut -c1-4`"
# if ("$name_prefix" == "MPI_") then
# set letter="`echo $file | cut -c5`"
# set div="`expr $letter \> F`"
# set line="generated_man_$div"
# else
# set line="generated_man_other"
# endif
# echo " - $file / $line"
# foreach fix (Makefile.am Makefile.in)
# sed -e "s/$line =/$line =$file /" $fix > $fix.new
# chmod +w $fix
# mv -f $fix.new $fix
# chmod -w $fix
# end
#end
#cd ../..
#
# Put the release version number in the README and INSTALL files
#
set files="README INSTALL"
echo "*** Updating version number in $files..."
foreach file ($files)
echo " - Setting $file"
if (-f $file) then
sed -e "s/OMPI_VERSION/$ver/g" $file > bar
mv -f bar $file
endif
end
#
# All done
#
cat <<EOF
*** Open MPI version $ver distribution created
Started: $start
Ended: `date`
EOF

113
config/f77_check.m4 Normal file
View File

@ -0,0 +1,113 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OMPI_F77_CHECK(Fortran type, c type required,
# types to search, expected size)
#----------------------------------------------------------
# Check Fortran type, including:
# - whether compiler supports or not
# - size of type
# - equal to expected size
# - alignment
# - associated C type
#
# types to search is a comma-seperated list of values
AC_DEFUN([OMPI_F77_CHECK], [
ofc_expected_size=$4
ofc_have_type=0
ofc_type_size=$ac_cv_sizeof_int
ofc_type_alignment=$ac_cv_sizeof_int
ofc_c_type=ompi_fortran_bogus_type_t
# Only check if we actually want the F77 bindings / have a F77
# compiler. This allows us to call this macro, even if there is
# no F77 compiler. If we have no f77 compiler, then just set a
# bunch of defaults.
if test "$OMPI_WANT_F77_BINDINGS" = "1"; then
OMPI_F77_CHECK_TYPE([$1], [ofc_have_type=1], [ofc_have_type=0])
else
AC_MSG_CHECKING([if Fortran 77 compiler supports $1])
AC_MSG_RESULT([skipped])
fi
if test "$ofc_have_type" = "1"; then
# What is the size of this type?
# NOTE: Some Fortran compilers actually will return that a
# type exists even if it doesn't support it -- the compiler
# will automatically convert the unsupported type to a type
# that it *does* support. For example, if you try to use
# INTEGER*16 and the compiler doesn't support it, it may well
# automatically convert it to INTEGER*8 for you (!). So we
# have to check the actual size of the type once we determine
# that the compiler doesn't error if we try to use it
# (i.e,. the compiler *might* support that type). If the size
# doesn't match the expected size, then the compiler doesn't
# really support it.
OMPI_F77_GET_SIZEOF([$1], [ofc_type_size])
if test "$ofc_expected_size" != "-1" -a "$ofc_type_size" != "$ofc_expected_size"; then
AC_MSG_WARN([*** Fortran 77 $1 does not have expected size!])
AC_MSG_WARN([*** Expected $ofc_expected_size, got $ofc_type_size])
AC_MSG_WARN([*** Disabling MPI support for Fortran 77 $1])
ofc_have_type=0
else
# Look for a corresponding C type (will abort by itself if the
# type isn't found and we need it)
ofc_c_type=
m4_ifval([$3], [OMPI_FIND_TYPE([$1], [$3], [$2], [$ofc_type_size], [ofc_c_type])
if test -z "$ofc_c_type" ; then
ofc_have_type=0
fi])
# Get the alignment of the type
if test "$ofc_have_type" = "1"; then
OMPI_F77_GET_ALIGNMENT([$1], [ofc_type_alignment])
fi
fi
fi
# We always need these defines -- even if we don't have a given type,
# there are some places in the code where we have to have *something*.
AC_DEFINE_UNQUOTED([OMPI_HAVE_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_]),
[$ofc_have_type],
[Whether we have Fortran 77 $1 or not])
AC_DEFINE_UNQUOTED([OMPI_SIZEOF_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_]),
[$ofc_type_size],
[Size of Fortran 77 $1])
AC_DEFINE_UNQUOTED([OMPI_ALIGNMENT_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_]),
[$ofc_type_alignment],
[Alignment of Fortran 77 $1])
if test "$3" != ""; then
AC_DEFINE_UNQUOTED([ompi_fortran_]m4_translit(m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_]), [A-Z], [a-z])[_t],
[$ofc_c_type],
[C type corresponding to Fortran 77 $1])
fi
# Save some in shell variables for later use (e.g., need
# OMPI_SIZEOF_FORTRAN_INTEGER in OMPI_F77_GET_FORTRAN_HANDLE_MAX)
[OMPI_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_])[_C_TYPE=$ofc_c_type]
[OMPI_HAVE_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_])[=$ofc_have_type]
[OMPI_SIZEOF_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_])[=$ofc_type_size]
[OMPI_ALIGNMENT_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_])[=$ofc_type_alignment]
# Clean up
unset ofc_have_type ofc_type_size ofc_type_alignment ofc_c_type
unset ofc_expected_size
])dnl

View File

@ -0,0 +1,101 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University.
dnl All rights reserved.
dnl Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
dnl All rights reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
AC_DEFUN([OMPI_F77_CHECK_LOGICAL_ARRAY],[
AC_CACHE_CHECK([for correct handling of FORTRAN logical arrays],
[ompi_cv_f77_logical_array_correct],
[if test "$1" = "none" -o "$OMPI_WANT_F77_BINDINGS" = "0"; then
ompi_cv_f77_logical_array_correct=yes
else
OMPI_F77_MAKE_C_FUNCTION([ompi_check_logical_fn], [check])
# Fortran module
cat > conftestf.f <<EOF
program check_logical_array
external check
logical l(2)
l(1)=.FALSE.
l(2)=.TRUE.
CALL check(l)
end
EOF
# C module
# We really need the confdefs.h Header file for
# the ompi_fortran_logical_t definition
if test \! -f confdefs.h ; then
AC_MSG_WARN([*** Problem running configure test!])
AC_MSG_WARN([*** Cannot find confdefs.h file for config test])
AC_MSG_WARN([*** See config.log for details.])
AC_MSG_ERROR([*** Cannot continue.])
fi
cat > conftest.c <<EOF
#include <stdio.h>
#include <stdlib.h>
#include "confdefs.h"
#ifdef __cplusplus
extern "C" {
#endif
void $ompi_check_logical_fn(ompi_fortran_logical_t * logical);
void $ompi_check_logical_fn(ompi_fortran_logical_t * logical)
{
int result = 0;
FILE *f=fopen("conftestval", "w");
if (!f) exit(1);
if (logical[[0]] == 0 &&
logical[[1]] == $ompi_cv_f77_true_value)
result = 1;
fprintf(f, "%d\n", result);
}
#ifdef __cplusplus
}
#endif
EOF
# Try the compilation and run. Can't use AC_TRY_RUN
# because it's two module files.
OMPI_LOG_COMMAND([$CC $CFLAGS -I. -c conftest.c],
[OMPI_LOG_COMMAND([$F77 $FFLAGS conftestf.f conftest.o -o conftest $LDFLAGS $LIBS],
[happy=1], [happy=0])],
[happy=0])
if test "$happy" = "0" ; then
AC_MSG_ERROR([Error determining if arrays of logical values work properly.])
fi
AS_IF([test "$cross_compiling" = "yes"],
[ # assume we're ok
ompi_cv_f77_logical_array_correct=yes],
[OMPI_LOG_COMMAND([./conftest],
[if test "`cat conftestval`" = "1" ; then
ompi_cv_f77_logical_array_correct=yes
else
ompi_cv_f77_logical_array_correct=no
fi],
[ompi_cv_f77_logical_array_correct=no])])
fi])
if test "$ompi_cv_f77_logical_array_correct" = "no" ; then
AC_MSG_ERROR([Error determining if arrays of logical values work properly.])
fi
unset happy ompi_check_logical_fn
rm -rf conftest*
])dnl

40
config/f77_check_type.m4 Normal file
View File

@ -0,0 +1,40 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OMPI_F77_CHECK_TYPE([type, action if found, action if not found])
# -----------------------------------------------------------------
AC_DEFUN([OMPI_F77_CHECK_TYPE],[
AS_VAR_PUSHDEF([type_var], [ompi_cv_f77_have_$1])
# Determine FORTRAN datatype size.
# First arg is type, 2nd arg is config var to define
AC_CACHE_CHECK([if Fortran 77 compiler supports $1], type_var,
[AC_LANG_PUSH([Fortran 77])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[C
program main
$1 bogus_variable
end]])],
[AS_VAR_SET(type_var, "yes")],
[AS_VAR_SET(type_var, "no")])
AC_LANG_POP([Fortran 77])])
AS_IF([test "AS_VAR_GET(type_var)" = "yes"], [$2], [$3])
AS_VAR_POPDEF([type_var])dnl
])dnl

View File

@ -0,0 +1,120 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
AC_DEFUN([OMPI_F77_FIND_EXT_SYMBOL_CONVENTION], [
AC_REQUIRE([AC_PROG_NM])
AC_REQUIRE([AC_PROG_GREP])
# invalidate cache if result came from a run where F77 was disabled
if test "$ompi_cv_f77_external_symbol" = "skipped" ; then
unset ompi_cv_f77_external_symbol
fi
AC_CACHE_CHECK([$F77 external symbol convention],
[ompi_cv_f77_external_symbol],
[if test "$F77" = "none" -o "$OMPI_WANT_F77_BINDINGS" = "0"; then
ompi_cv_f77_external_symbol="skipped"
else
cat >conftest.f <<EOF
subroutine FOO_bar(a)
integer a
a = 1
return
end
EOF
OMPI_LOG_COMMAND([$F77 $FFLAGS -c conftest.f $LDFLAGS $LIBS],
[if $NM conftest.o | $GREP foo_bar__ >/dev/null 2>&1 ; then
ompi_cv_f77_external_symbol="double underscore"
elif $NM conftest.o | $GREP foo_bar_ >/dev/null 2>&1 ; then
ompi_cv_f77_external_symbol="single underscore"
elif $NM conftest.o | $GREP FOO_bar >/dev/null 2>&1 ; then
ompi_cv_f77_external_symbol="mixed case"
elif $NM conftest.o | $GREP foo_bar >/dev/null 2>&1 ; then
ompi_cv_f77_external_symbol="no underscore"
elif $NM conftest.o | $GREP FOO_BAR >/dev/null 2>&1 ; then
ompi_cv_f77_external_symbol="upper case"
else
$NM conftest.o >conftest.out 2>&1
OMPI_LOG_MSG([output from $NM:])
OMPI_LOG_FILE([conftest.out])
AC_MSG_ERROR([Could not determine Fortran naming convention.])
fi],
[AC_MSG_ERROR([Fortran compiler did not produce object file])])
fi])
ompi_fortran_double_underscore=0
ompi_fortran_single_underscore=0
ompi_fortran_caps=0
ompi_fortran_plain=0
if test "$ompi_cv_f77_external_symbol" = "double underscore" ; then
ompi_fortran_double_underscore=1
elif test "$ompi_cv_f77_external_symbol" = "single underscore" ; then
ompi_fortran_single_underscore=1
elif test "$ompi_cv_f77_external_symbol" = "mixed case" ; then
ompi_fortran_caps=1
elif test "$ompi_cv_f77_external_symbol" = "no underscore" ; then
ompi_fortran_plain=1
elif test "$ompi_cv_f77_external_symbol" = "upper case" ; then
ompi_fortran_caps=1
elif test "$ompi_cv_f77_external_symbol" != "skipped" ; then
AC_MSG_ERROR([unknown naming convention: $ompi_cv_f77_external_symbol])
fi
AC_DEFINE_UNQUOTED([OMPI_F77_DOUBLE_UNDERSCORE],
[$ompi_fortran_double_underscore],
[Whether fortran symbols have a trailing double underscore or not])
AC_DEFINE_UNQUOTED([OMPI_F77_SINGLE_UNDERSCORE],
[$ompi_fortran_single_underscore],
[Whether fortran symbols have a trailing underscore or not])
AC_DEFINE_UNQUOTED([OMPI_F77_CAPS],
[$ompi_fortran_caps],
[Whether fortran symbols are all caps or not])
AC_DEFINE_UNQUOTED([OMPI_F77_PLAIN],
[$ompi_fortran_plain],
[Whether fortran symbols have no trailing underscore or not])
rm -rf conftest.*
])dnl
AC_DEFUN([OMPI_F77_MAKE_C_FUNCTION], [
if test "$ompi_cv_f77_external_symbol" = "double underscore" ; then
# so the general rule is that if there is an _ in the function
# name, then there are two trailing underscores. Otherwise,
# there is only one trailing underscore. Any idea how to do
# that with m4_translit?
if echo $2 | $GREP _ >/dev/null 2>&1 ; then
$1[=]m4_translit([$2], [A-Z], [a-z])[__]
else
$1[=]m4_translit([$2], [A-Z], [a-z])[_]
fi
elif test "$ompi_cv_f77_external_symbol" = "single underscore" ; then
$1[=]m4_translit([$2], [A-Z], [a-z])[_]
elif test "$ompi_cv_f77_external_symbol" = "mixed case" ; then
$1[=]$2
elif test "$ompi_cv_f77_external_symbol" = "no underscore" ; then
$1[=]m4_translit([$2], [A-Z], [a-z])
elif test "$ompi_cv_f77_external_symbol" = "upper case" ; then
$1[=]m4_translit([$2], [a-z], [A-Z])
else
AC_MSG_ERROR([unknown naming convention: $ompi_cv_f77_external_symbol])
fi
])

View File

@ -0,0 +1,92 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OMPI_F77_GET_ALIGNMENT(type, shell variable to set)
# ----------------------------------------------------
AC_DEFUN([OMPI_F77_GET_ALIGNMENT],[
AS_VAR_PUSHDEF([type_var], [ompi_cv_f77_alignment_$1])
AC_CACHE_CHECK([alignment of Fortran $1], type_var,
[OMPI_F77_MAKE_C_FUNCTION([ompi_ac_align_fn], [align])
# Fortran module
cat > conftestf.f <<EOF
program falign
external align
$1 w,x,y,z
CHARACTER a,b,c
common /foo/a,w,b,x,y,c,z
call align(w,x,y,z)
end
EOF
# C module
if test -f conftest.h; then
ompi_conftest_h="#include \"conftest.h\""
else
ompi_conftest_h=""
fi
cat > conftest.c <<EOF
#include <stdio.h>
#include <stdlib.h>
$conftest
#ifdef __cplusplus
extern "C" {
#endif
void $ompi_ac_align_fn(char *w, char *x, char *y, char *z)
{ unsigned long aw, ax, ay, az;
FILE *f=fopen("conftestval", "w");
if (!f) exit(1);
aw = (unsigned long) w;
ax = (unsigned long) x;
ay = (unsigned long) y;
az = (unsigned long) z;
if (! ((aw%16)||(ax%16)||(ay%16)||(az%16))) fprintf(f, "%d\n", 16);
else if (! ((aw%12)||(ax%12)||(ay%12)||(az%12))) fprintf(f, "%d\n", 12);
else if (! ((aw%8)||(ax%8)||(ay%8)||(az%8))) fprintf(f, "%d\n", 8);
else if (! ((aw%4)||(ax%4)||(ay%4)||(az%4))) fprintf(f, "%d\n", 4);
else if (! ((aw%2)||(ax%2)||(ay%2)||(az%2))) fprintf(f, "%d\n", 2);
else fprintf(f, "%d\n", 1);
fclose(f);
}
#ifdef __cplusplus
}
#endif
EOF
OMPI_LOG_COMMAND([$CC $CFLAGS -I. -c conftest.c],
[OMPI_LOG_COMMAND([$F77 $FFLAGS conftestf.f conftest.o -o conftest $LDFLAGS $LIBS],
[happy="yes"], [happy="no"])], [happy="no"])
if test "$happy" = "no" ; then
AC_MSG_ERROR([Could not determine alignment of $1])
fi
AS_IF([test "$cross_compiling" = "yes"],
[AC_MSG_ERROR([Can not determine alignment of $1 when cross-compiling])],
[OMPI_LOG_COMMAND([./conftest],
[AS_VAR_SET(type_var, [`cat conftestval`])],
[AC_MSG_ERROR([Could not determine alignment of $1])])])
unset happy ompi_conf
rm -rf conftest*])
$2=AS_VAR_GET([type_var])
AS_VAR_POPDEF([type_var])dnl
])

View File

@ -0,0 +1,82 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OMPI_F77_GET_FORTRAN_HANDLE_MAX()
# ---------------------------------------------------------------
# Find the maximum value of fortran integers, then calculate
# min(INT_MAX, max fortran INTEGER). This represents the maximum
# number of fortran MPI handle index.
AC_DEFUN([OMPI_F77_GET_FORTRAN_HANDLE_MAX],[
AC_CACHE_CHECK([for max Fortran MPI handle index],
[ompi_cv_f77_fortran_handle_max],
[ # Find max fortran INTEGER value. Set to sentinel value if we don't
# have a Fortran compiler (e.g., if --disable-f77 was given).
if test "$OMPI_WANT_F77_BINDINGS" = "0" ; then
ompi_fint_max=0
else
# Calculate the number of f's that we need to append to the hex
# value. Do one less than we really need becaue we assume the
# top nybble is 0x7 to avoid sign issues.
ompi_numf=`expr $OMPI_SIZEOF_FORTRAN_INTEGER \* 2 - 1`
ompi_fint_max=0x7
while test "$ompi_numf" -gt "0"; do
ompi_fint_max=${ompi_fint_max}f
ompi_numf=`expr $ompi_numf - 1`
done
fi
# Get INT_MAX. Compute a SWAG if we are cross compiling or something
# goes wrong.
rm -f conftest.out >/dev/null 2>&1
AC_RUN_IFELSE(AC_LANG_PROGRAM([[
#include <stdio.h>
#include <limits.h>
]],[[FILE *fp = fopen("conftest.out", "w");
long cint = INT_MAX;
fprintf(fp, "%ld", cint);
fclose(fp);]]),
[ompi_cint_max=`cat conftest.out`],
[ompi_cint_max=0],
[ #cross compiling is fun. compute INT_MAX same as INTEGER max
ompi_numf=`expr $ac_cv_sizeof_int \* 2 - 1`
ompi_cint_max=0x7
while test "$ompi_numf" -gt "0" ; do
ompi_cint_max=${ompi_cint_max}f
ompi_numf=`expr $ompi_numf - 1`
done])
if test "$ompi_cint_max" = "0" ; then
# wow - something went really wrong. Be conservative
ompi_cv_f77_fortran_handle_max=32767
elif test "$ompi_fint_max" = "0" ; then
# we aren't compiling Fortran - just set it to C INT_MAX
ompi_cv_f77_fortran_handle_max=$ompi_cint_max
else
# take the lesser of C INT_MAX and Fortran INTEGER
# max. The resulting value will then be storable in
# either type. There's no easy way to do this in
# the shell, so make the preprocessor do it.
ompi_cv_f77_fortran_handle_max="( $ompi_fint_max < $ompi_cint_max ? $ompi_fint_max : $ompi_cint_max )"
fi
rm -f conftest.out > /dev/null 2>&1 ])
AC_DEFINE_UNQUOTED([OMPI_FORTRAN_HANDLE_MAX],
[$ompi_cv_f77_fortran_handle_max],
[Max handle value for fortran MPI handles, effectively min(INT_MAX, max fortran INTEGER value)])
])dnl

85
config/f77_get_sizeof.m4 Normal file
View File

@ -0,0 +1,85 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OMPI_F77_GET_SIZEOF(type, variable to set)
# ------------------------------------------
AC_DEFUN([OMPI_F77_GET_SIZEOF],[
AS_VAR_PUSHDEF([type_var], [ompi_cv_f77_sizeof_$1])
AC_CACHE_CHECK([size of Fortran 77 $1], type_var,
[OMPI_F77_MAKE_C_FUNCTION([ompi_ac_size_fn], [size])
# Fortran module
cat > conftestf.f <<EOF
program fsize
external size
$1 x(2)
call size(x(1),x(2))
end
EOF
# C module
if test -f conftest.h; then
ompi_conftest_h="#include \"conftest.h\""
else
ompi_conftest_h=""
fi
cat > conftest.c <<EOF
#include <stdio.h>
#include <stdlib.h>
$ompi_conftest_h
#ifdef __cplusplus
extern "C" {
#endif
void $ompi_ac_size_fn(char *a, char *b)
{
int diff = (int) (b - a);
FILE *f=fopen("conftestval", "w");
if (!f) exit(1);
fprintf(f, "%d\n", diff);
fclose(f);
}
#ifdef __cplusplus
}
#endif
EOF
OMPI_LOG_COMMAND([$CC $CFLAGS -I. -c conftest.c],
[OMPI_LOG_COMMAND([$F77 $FFLAGS conftestf.f conftest.o -o conftest $LDFLAGS $LIBS],
[happy="yes"], [happy="no"])], [happy="no"])
if test "$happy" = "no" ; then
AC_MSG_ERROR([Could not determine size of $1])
fi
AS_IF([test "$cross_compiling" = "yes"],
[AC_MSG_ERROR([Can not determine size of $1 when cross-compiling])],
[OMPI_LOG_COMMAND([./conftest],
[AS_IF([test -f conftestval],
[AS_VAR_SET(type_var, [`cat conftestval`])],
[OMPI_LOG_MSG([conftestval not found.], 1)
AC_MSG_ERROR([Could not determine size of $1])])],
[AC_MSG_ERROR([Could not determine size of $1])])])
unset happy ompi_conftest_h
rm -rf conftest*])
$2=AS_VAR_GET(type_var)
AS_VAR_POPDEF([type_var])dnl
])dnl

View File

@ -0,0 +1,114 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University.
dnl All rights reserved.
dnl Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
dnl All rights reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OMPI_F77_GET_VALUE_TRUE()
# -------------------------------------------------------
# Determine the value of .TRUE. of this FORTRAN compiler.
AC_DEFUN([OMPI_F77_GET_VALUE_TRUE],[
# invalidate cache if result came from a run where F77 was disabled
if test "$ompi_cv_f77_true_value" = "0" ; then
unset ompi_cv_f77_true_value
fi
AC_CACHE_CHECK([FORTRAN value for .TRUE. logical type],
[ompi_cv_f77_true_value],
[if test "$1" = "none" -o "$OMPI_WANT_F77_BINDINGS" = "0" ; then
ompi_cv_f77_true_value=0
else
OMPI_F77_MAKE_C_FUNCTION([ompi_print_logical_fn], [print])
#
# C module
# We really need the confdefs.h Header file for
# the ompi_fortran_logical_t definition
#
if test \! -f confdefs.h ; then
AC_MSG_WARN([*** Problem running configure test!])
AC_MSG_WARN([*** Cannot find confdefs.h file for config test])
AC_MSG_WARN([*** See config.log for details.])
AC_MSG_ERROR([*** Cannot continue.])
fi
cat > conftest.c <<EOF
#include <stdio.h>
#include <stdlib.h>
#include "confdefs.h"
#ifdef __cplusplus
extern "C" {
#endif
void $ompi_print_logical_fn(ompi_fortran_logical_t * logical);
void $ompi_print_logical_fn(ompi_fortran_logical_t * logical)
{
FILE *f=fopen("conftestval", "w");
if (!f) exit(1);
if( SIZEOF_INT >= sizeof(ompi_fortran_logical_t) ) {
fprintf(f, "%d\n", (int)*logical);
} else if (SIZEOF_LONG >= sizeof(ompi_fortran_logical_t) ) {
fprintf(f, "%ld\n", (long) *logical);
#ifdef HAVE_LONG_LONG
} else if (SIZEOF_LONG_LONG >= sizeof(ompi_fortran_logical_t) ) {
fprintf(f, "%lld\n", (long long) *logical);
#endif
} else {
exit(1);
}
}
#ifdef __cplusplus
}
#endif
EOF
cat > conftestf.f <<EOF
program main
logical value
value=.TRUE.
CALL print(value)
end
EOF
#
# Try the compilation and run.
#
OMPI_LOG_COMMAND([$CC $CFLAGS -I. -c conftest.c],
[OMPI_LOG_COMMAND([$F77 $FFLAGS -o conftest conftest.o conftestf.f $LDFLAGS $LIBS],
[happy=1], [happy=0])],
[happy=0])
if test "$happy" = "0" ; then
AC_MSG_ERROR([Could not determine value of Fortran .TRUE.. Aborting.])
fi
AS_IF([test "$cross_compiling" = "yes"],
[AC_MSG_ERROR([Can not determine value of .TRUE. when cross-compiling])],
[OMPI_LOG_COMMAND([./conftest],
[ompi_cv_f77_true_value=`sed 's/ *//' conftestval`],
[AC_MSG_ERROR([Could not determine value of Fotran .TRUE.. Aborting.])])])
fi])
AC_DEFINE_UNQUOTED([OMPI_FORTRAN_VALUE_TRUE],
[$ompi_cv_f77_true_value],
[Fortran value for LOGICAL .TRUE. value])
unset happy ompi_print_logical_fn
rm -rf conftest*
])dnl

View File

@ -0,0 +1,36 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
AC_DEFUN([OMPI_F77_PURGE_UNSUPPORTED_KIND],[
# Purge F77 types (such as INTEGER*16) that don't match exptected datatype size.
# First arg is type, 2nd arg is config var to define.
AC_MSG_CHECKING([whether Fortran $1 has expected size])
val=`echo $1 | cut -f2 -d'*'`
type=`echo $1 | cut -f1 -d'*'`
if test "x$((OMPI_SIZEOF_FORTRAN_$type$val))" != "x$val" ; then
eval "OMPI_SIZEOF_FORTRAN_$type$val=0"
# eval "OMPI_ALIGNMENT_FORTRAN_$type$val=0"
eval "OMPI_HAVE_FORTRAN_$type$val=0"
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([yes])
fi
unset val type
])dnl

176
config/f90_check.m4 Normal file
View File

@ -0,0 +1,176 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2006 Cisco Systems, Inc.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OMPI_F90_CHECK(Fortran type, expected size)
#----------------------------------------------------------------------------
# Check Fortran type/kind combinations, including:
# - whether compiler supports or not
# - size of type
# - equal to expected size
# - range (optional)
# - precision (optional)
# Note that we do *not* check for the alignment here. This is a long,
# sordid tale.
# We have been unable to devise a F90 test that will result in a
# consistent answer. Specifically, our prior tests have been similar
# to the f77 test -- have a small chunk of f90 code compiled with the
# C code to actually compute the offsets. The f90 code was a
# struct-like entity (a "type") with multiple members -- on a
# character and the other of the target type. The C code measured the
# distance between them. But even if you use the keyword to ensure
# that the F90 compiler does not re-order this struct, you may still
# get a different alignment answer than the F77 test (!). This is
# apparently because F90 allows compilers to align types differently
# according to use (in common blocks, as standalone variables, and as
# a member of a struct). Hence, the alignment can be different
# depending on how to measure (and use) it. This was confirmed by
# various members of the Fortran committee and several Fortran
# compiler vendors.
# We check the F77 alignment based on common block usage, but this is
# only one of the available types for F90. Hence, we may actually get
# a different answer between f77 and f90 in the same compiler series
# (and some compilers do! E.g., g95 gives different answers even when
# "g95" itself is used as both the f77 and f90 compiler).
# So we gave up.
# Additionally, this was really only a sanity check anyway, because
# the way out F90 MPI layer is organized, there is no translation
# between the data and datatypes performed -- we simply invoke the F77
# layer from the F90 layer. Hence, we make no distinction between
# them, and therefore the OMPI DDT engine uses only the F77 sizes and
# alignments. So rather than display a warning to the user for a test
# that was questionable at best, we just eliminated the F90 alignment
# test, corresponding F77 comparison, and ensuring warning -- because
# it really didn't mean anything anyway.
# types to search is a comma-seperated list of values
AC_DEFUN([OMPI_F90_CHECK], [
ofc_fortran_type="$1"
ofc_expected_size="$2"
ofc_have_type=0
ofc_type_size=$ac_cv_sizeof_int
# Only check if we actually want the F90 bindings / have a F90
# compiler. This allows us to call this macro even if there is
# no F90 compiler. If we have no f90 compiler, then just set a
# bunch of defaults.
if test "$OMPI_WANT_F90_BINDINGS" = "1"; then
OMPI_F90_CHECK_TYPE([$1], [ofc_have_type=1], [ofc_have_type=0])
else
AC_MSG_CHECKING([if Fortran 90 compiler supports $ofc_fortran_type])
AC_MSG_RESULT([skipped])
fi
if test "$ofc_have_type" = "1"; then
# What is the size of this type?
# NOTE: Some Fortran compilers actually will return that a
# type exists even if it doesn't support it -- the compiler
# will automatically convert the unsupported type to a type
# that it *does* support. For example, if you try to use
# INTEGER*16 and the compiler doesn't support it, it may well
# automatically convert it to INTEGER*8 for you (!). So we
# have to check the actual size of the type once we determine
# that the compiler doesn't error if we try to use it
# (i.e,. the compiler *might* support that type). If the size
# doesn't match the expected size, then the compiler doesn't
# really support it.
OMPI_F90_GET_SIZEOF([$1], [ofc_type_size])
if test "$ofc_expected_size" != "" -a "$ofc_type_size" != "$ofc_expected_size"; then
AC_MSG_WARN([*** Fortran 90 $ofc_fortran_type does not have expected size!])
AC_MSG_WARN([*** Expected $ofc_expected_size, got $ofc_type_size])
AC_MSG_WARN([*** Disabling MPI support for Fortran $ofc_fortran_type])
ofc_have_type=0
else
# If this type has an F77 counterpart, see if it's
# supported.
[ofc_f77_have_type=$OMPI_HAVE_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_])
if test "$ofc_f77_have_type" = "0"; then
AC_MSG_WARN([*** Corresponding Fortran 77 type ($1) not supported])
AC_MSG_WARN([*** Skipping Fortran 90 type ($1)])
else
# Check the size of this type against its F77 counterpart
[ofc_f77_sizeof=$OMPI_SIZEOF_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_])
if test "$ofc_f77_sizeof" != ""; then
AC_MSG_CHECKING([if Fortran 77 and 90 type sizes match])
if test "$ofc_f77_sizeof" != "$ofc_type_size"; then
AC_MSG_RESULT([no])
AC_MSG_WARN([*** Fortran 77 size for $1 ($ofc_f77_sizeof) does not match])
AC_MSG_WARN([*** Fortran 90 size for $1 ($ofc_type_size)])
AC_MSG_ERROR([*** Cannot continue])
else
AC_MSG_RESULT([yes])
fi
fi
# If we passed in the expected size, then also add the
# type to the relevant list of types found.
if test "$ofc_expected_size" != ""; then
ofc_letter=m4_translit(m4_bpatsubst($1, [^\(.\).+], [[\1]]), [a-z], [A-Z])
ofc_str="OMPI_F90_${ofc_letter}KINDS=\"\$OMPI_F90_${ofc_letter}KINDS $ofc_type_size \""
eval $ofc_str
fi
fi
fi
fi
# We always need these defines -- even if we don't have a given
# type, there are some places in the code where we have to have
# *something*. Note that the bpatsubst's are the same as used
# above (see comment above), but we added a translit to make them
# uppercase.
# If we got a pretty name, use that as the basis. If not, use the
# first part of the provided fortran type (e.g.,
# "logical(selected_int_kind(2))" -> logical1")
# Note that there is no need to AC_DEFINE the size of the F90
# datatype. We have ensured (above) that they are the same as the
# corresponding F77 datatypes, and that's good enough (i.e., the
# DDT engine only looks at the F77 sizes).
# Finally, note that it is necessary to use the Big Long Ugly m4
# expressions in the AC_DEFINE_UNQUOTEDs. If you don't (e.g., put
# the result of the BLUm4E in a shell variable and use that in
# AC_DEFINE_UNQUOTED), autoheader won't put them in the
# AC_CONFIG_HEADER (or AM_CONFIG_HEADER, in our case).
AC_DEFINE_UNQUOTED([OMPI_HAVE_F90_]m4_translit(m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_]), [a-z], [A-Z]),
[$ofc_have_type],
[Whether we have Fortran 90 $ofc_fortran_type or not])
# Save some in shell variables for later use. Have to use m4
# functions here (vs. $ompi_upper_var_name, defined above) because
# these need to be set at autoconf time, not configure time.
[OMPI_SIZEOF_F90_]m4_translit(m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_]), [a-z], [A-Z])[=$ofc_type_size]
AC_SUBST([OMPI_SIZEOF_F90_]m4_translit(m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_]), [a-z], [A-Z]))
# Clean up
unset ofc_fortran_type ofc_expected_size ofc_want_range ofc_pretty_name
unset ofc_have_type ofc_type_size ofc_letter ofc_str
unset ofc_type_range ofc_type_precision
unset ofc_f77_sizeof
])dnl

39
config/f90_check_type.m4 Normal file
View File

@ -0,0 +1,39 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OMPI_F90_CHECK_TYPE([type, action if found, action if not found])
# -----------------------------------------------------------------
AC_DEFUN([OMPI_F90_CHECK_TYPE],[
AS_VAR_PUSHDEF([type_var], [ompi_cv_f90_have_$1])
# Determine FORTRAN datatype size.
# First arg is type, 2nd arg is config var to define
AC_CACHE_CHECK([if Fortran 90 compiler supports $1], type_var,
[AC_LANG_PUSH([Fortran])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[program main
$1 :: x
end]])],
[AS_VAR_SET(type_var, "yes")],
[AS_VAR_SET(type_var, "no")])
AC_LANG_POP([Fortran])])
AS_IF([test "AS_VAR_GET(type_var)" = "yes"], [$2], [$3])
AS_VAR_POPDEF([type_var])dnl
])dnl

View File

@ -0,0 +1,84 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
AC_DEFUN([OMPI_F90_FIND_MODULE_INCLUDE_FLAG],[
AS_VAR_PUSHDEF([f90_inc_var], [ompi_cv_f90_module_include_flag])
if test "$OMPI_WANT_F90_BINDINGS" -eq 1 ; then
AC_CACHE_CHECK([for Fortran 90 compiler module include flag],
f90_inc_var,
[ofi_possible_flags="-I -p -M"
mkdir conftest.$$
cd conftest.$$
# Try to compile an F90 module
mkdir subdir
cd subdir
cat > conftest-module.f90 <<EOF
module OMPI_MOD_FLAG
type OMPI_MOD_FLAG_TYPE
integer :: i
end type OMPI_MOD_FLAG_TYPE
end module OMPI_MOD_FLAG
EOF
OMPI_LOG_COMMAND([$FC $FCFLAGS $FCFLAGS_f90 -c conftest-module.f90 $LDFLAGS $LIBS], ,
[cd ..
rm -rf conftest.$$
AC_MSG_RESULT([Whoops!])
AC_MSG_WARN([*** Cannot seem to compile an f90 module])
AC_MSG_ERROR([Cannot continue])])
cd ..
#
# Now try to compile a simple program usinng that module, iterating
# through the possible flags that the compiler might use
#
cat > conftest.f90 <<EOF
program f90usemodule
use OMPI_MOD_FLAG
end program f90usemodule
EOF
ofi_module_flag=
for flag in $ofi_possible_flags; do
if test "$ofi_module_flag" = ""; then
OMPI_LOG_COMMAND([$FC $FCFLAGS $FCFLAGS_f90 conftest.f90 ${flag}subdir $LDFLAGS $LIBS],
[AS_VAR_SET(f90_inc_var, [$flag])
ofi_module_flag="$flag"])
fi
done
cd ..
rm -rf conftest.$$
])
OMPI_FC_MODULE_FLAG=AS_VAR_GET(f90_inc_var)
if test "$OMPI_FC_MODULE_FLAG" = ""; then
AC_MSG_WARN([*** Could not determine the f90 compiler flag to indicate where modules reside])
AC_MSG_ERROR([*** Cannot continue])
fi
else
OMPI_FC_MODULE_FLAG=
fi
AC_SUBST(OMPI_FC_MODULE_FLAG)
AS_VAR_POPDEF([f90_inc_var])
])dnl

View File

@ -0,0 +1,62 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OMPI_F90_GET_INT_KIND(MPI name, decimal range, variable to set)
# ---------------------------------------------------------------
AC_DEFUN([OMPI_F90_GET_INT_KIND],[
AS_VAR_PUSHDEF([type_var], [ompi_cv_f90_int_kind_$2])
if test "$OMPI_WANT_F90_BINDINGS" -eq 1 ; then
AC_CACHE_CHECK([Fortran 90 kind of $1 (selected_int_kind($2))],
type_var,
[cat > conftestf.f90 <<EOF
program f90findintkind
open(8, file="conftestval")
write(8, fmt="(I5)") selected_int_kind($2)
close(8)
end program
EOF
# Try to compile
OMPI_LOG_COMMAND([$FC $FCFLAGS $FCFLAGS_f90 -o conftest conftestf.f90 $LDFLAGS $LIBS],
[happy="yes"], [happy="no"])
if test "$happy" = "no"; then
OMPI_LOG_MSG([here is the fortran 90 program:], 1)
OMPI_LOG_FILE([conftestf.f90])
AC_MSG_WARN([Could not kind of selected_int_kind($1)])
AC_MSG_WARN([See config.log for details])
AC_MSG_ERROR([Cannot continue])
fi
AS_IF([test "$cross_compiling" = "yes"],
[AC_MSG_ERROR([Can not determine kind of selected_int_kind($1) when cross-compiling])],
[OMPI_LOG_COMMAND([./conftest],
[AS_VAR_SET(type_var, [`sed 's/ *//' conftestval`])],
[AC_MSG_ERROR([Could not determine kind of selected_int_kind($1)])])])
unset happy ompi_conftest_h
rm -rf conftest*])
$3=AS_VAR_GET(type_var)
else
$3=0
fi
AS_VAR_POPDEF([type_var])dnl
])

View File

@ -0,0 +1,60 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OMPI_F90_GET_PRECISION(type, shell variable to set)
# ---------------------------------------------------
AC_DEFUN([OMPI_F90_GET_PRECISION],[
AS_VAR_PUSHDEF([type_var], [ompi_cv_f90_precision_$1])
AC_CACHE_CHECK([precision of Fortran 90 $1], type_var,
[cat > conftestf.f90 <<EOF
program f90precision
$1 :: x
open(8, file="conftestval")
write(8, fmt="(I5)") precision(x)
close(8)
end program
EOF
# Compile
OMPI_LOG_COMMAND([$FC $FCFLAGS $FCFLAGS_f90 -o conftest conftestf.f90 $LDFLAGS $LIBS], [happy="yes"], [happy="no"])
if test "$happy" = "no"; then
OMPI_LOG_MSG([here is the fortran 90 program:], 1)
OMPI_LOG_FILE([conftestf.f90])
AC_MSG_WARN([Could not determine precision of $1])
AC_MSG_WARN([See config.log for details])
AC_MSG_ERROR([Cannot continue])
fi
# If not cross compiling, try to run (if we're cross
# compiling, then the value should have been loaded by the
# cache already)
AS_IF([test "$cross_compiling" = "yes"],
[AC_MSG_ERROR([Can not determine precision of $1 when cross-compiling])],
[OMPI_LOG_COMMAND([./conftest],
[AS_VAR_SET(type_var, [`sed 's/ *//' conftestval`])],
[AC_MSG_ERROR([Could not determine precision of $1])])])
unset happy
rm -rf conftest*])
$2=AS_VAR_GET([type_var])
AS_VAR_POPDEF([type_var])dnl
])

60
config/f90_get_range.m4 Normal file
View File

@ -0,0 +1,60 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OMPI_F90_GET_RANGE(type, shell variable to set)
# -----------------------------------------------
AC_DEFUN([OMPI_F90_GET_RANGE],[
AS_VAR_PUSHDEF([type_var], [ompi_cv_f90_range_$1])
AC_CACHE_CHECK([range of Fortran 90 $1], type_var,
[cat > conftestf.f90 <<EOF
program f90range
$1 :: x
open(8, file="conftestval")
write(8, fmt="(I5)") range(x)
close(8)
end program
EOF
# Compile
OMPI_LOG_COMMAND([$FC $FCFLAGS $FCFLAGS_f90 -o conftest conftestf.f90 $LDFLAGS $LIBS], [happy="yes"], [happy="no"])
if test "$happy" = "no"; then
OMPI_LOG_MSG([here is the fortran 90 program:], 1)
OMPI_LOG_FILE([conftestf.f90])
AC_MSG_WARN([Could not determine range of $1])
AC_MSG_WARN([See config.log for details])
AC_MSG_ERROR([Cannot continue])
fi
# If not cross compiling, try to run (if we're cross
# compiling, then the value should have been loaded by the
# cache already)
AS_IF([test "$cross_compiling" = "yes"],
[AC_MSG_ERROR([Can not determine range of $1 when cross-compiling])],
[OMPI_LOG_COMMAND([./conftest],
[AS_VAR_SET(type_var, [`sed 's/ *//' conftestval`])],
[AC_MSG_ERROR([Could not determine range of $1])])])
unset happy
rm -rf conftest*])
$2=AS_VAR_GET([type_var])
AS_VAR_POPDEF([type_var])dnl
])

85
config/f90_get_sizeof.m4 Normal file
View File

@ -0,0 +1,85 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OMPI_F90_GET_SIZEOF(type, variable to set)
# ------------------------------------------
AC_DEFUN([OMPI_F90_GET_SIZEOF],[
AS_VAR_PUSHDEF([type_var], [ompi_cv_f90_sizeof_$1])
AC_CACHE_CHECK([size of Fortran 90 $1], type_var,
[OMPI_F77_MAKE_C_FUNCTION([ompi_ac_size_fn], [size])
# Fortran module
cat > conftestf.f90 <<EOF
program fsize
external size
$1 :: x(2)
call size(x(1),x(2))
end program
EOF
# C module
if test -f conftest.h; then
ompi_conftest_h="#include \"conftest.h\""
else
ompi_conftest_h=""
fi
cat > conftest.c <<EOF
#include <stdio.h>
#include <stdlib.h>
$ompi_conftest_h
#ifdef __cplusplus
extern "C" {
#endif
void $ompi_ac_size_fn(char *a, char *b)
{
int diff = (int) (b - a);
FILE *f=fopen("conftestval", "w");
if (!f) exit(1);
fprintf(f, "%d\n", diff);
}
#ifdef __cplusplus
}
#endif
EOF
OMPI_LOG_COMMAND([$CC $CFLAGS -I. -c conftest.c],
[OMPI_LOG_COMMAND([$FC $FCFLAGS $FCFLAGS_f90 conftestf.f90 conftest.o -o conftest $LDFLAGS $LIBS],
[happy="yes"], [happy="no"])], [happy="no"])
if test "$happy" = "no" ; then
OMPI_LOG_MSG([here is the fortran 90 program:], 1)
OMPI_LOG_FILE([conftestf.f90])
AC_MSG_WARN([Could not determine size of $1])
AC_MSG_WARN([See config.log for details])
AC_MSG_ERROR([Cannot continue])
fi
AS_IF([test "$cross_compiling" = "yes"],
[AC_MSG_ERROR([Can not determine size of $1 when cross-compiling])],
[OMPI_LOG_COMMAND([./conftest],
[AS_VAR_SET(type_var, [`cat conftestval`])],
[AC_MSG_ERROR([Could not determine size of $1])])])
unset happy ompi_conftest_h
rm -rf conftest*])
$2=AS_VAR_GET(type_var)
AS_VAR_POPDEF([type_var])dnl
])dnl

49
config/mca_acinclude.m4 Normal file
View File

@ -0,0 +1,49 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
dnl
dnl Tests provided by OMPI
dnl General tests
dnl
sinclude(@M4DIR@/ompi_functions.m4)
sinclude(@M4DIR@/ompi_get_version.m4)
dnl
dnl C compiler tests
dnl
sinclude(@M4DIR@/ompi_setup_cc.m4)
sinclude(@M4DIR@/ompi_check_optflags.m4)
sinclude(@M4DIR@/ompi_check_vendor.m4)
dnl
dnl C++ compiler tests
dnl
sinclude(@M4DIR@/ompi_setup_cxx.m4)
sinclude(@M4DIR@/cxx_find_template_repository.m4)
sinclude(@M4DIR@/cxx_find_template_parameters.m4)
dnl
dnl This will be replaced with s_i_n_c_l_u_d_e(configure.stub) if it
dnl exists for that component, or a blank line if it does not.
dnl
@CONFIGURE_STUB_SINCLUDE@

408
config/mca_configure.ac Normal file
View File

@ -0,0 +1,408 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# 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.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
############################################################################
# Initialization and other random setup/init stuff
############################################################################
# Init autoconf
AC_INIT(@PARAM_INIT_FILE@)
AC_PREREQ(2.57)
AC_CONFIG_AUX_DIR(@PARAM_CONFIG_AUX_DIR@)
#
# Start it up
#
OMPI_CONFIGURE_SETUP
ompi_show_title "Configuring MCA @MCA_TYPE@ @MCA_COMPONENT_NAME@ component"
ompi_show_subtitle "Initialization, setup"
#
# Init automake
# The third argument to AM_INIT_AUTOMAKE surpresses the PACKAGE and
# VERSION macros
#
AM_INIT_AUTOMAKE(@PARAM_AM_NAME@, irrelevant-version-number, 'no')
#
# GNU C and autotools are inconsistent about whether this is defined
# so let's make it true everywhere for now...
#
AC_GNU_SOURCE
# Setup the top-level MCA component config.h file
AH_TOP([/* -*- c -*-
*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*
* Open MPI configuation header file.
* MCA @MCA_TYPE@: @MCA_COMPONENT_NAME@ component
*/
#ifndef @PARAM_VAR_PREFIX@_CONFIG_H
#define @PARAM_VAR_PREFIX@_CONFIG_H
])
AH_BOTTOM([#endif /* _@PARAM_VAR_PREFIX@_CONFIG_H */])
#
# Do the normal basics of setup:
# - set CLEANFILES
# - figure out the host type
# - set the default prefix
#
OMPI_BASIC_SETUP
#
# Check to see if the user wants this @MCA_TYPE@ to be the default
#
AC_MSG_CHECKING([if want the @MCA_COMPONENT_NAME@ @MCA_TYPE@ to be the default])
want_default=0
result=no
AC_ARG_WITH(@PROCESSED_MCA_TYPE@,
AC_HELP_STRING([--with-@PROCESSED_MCA_TYPE@=name],
[if name is "@MCA_COMPONENT_NAME@", the @MCA_COMPONENT_NAME@ @MCA_TYPE@ will be the default]))
if test "$with_@PROCESSED_MCA_TYPE@" = "@MCA_COMPONENT_NAME@"; then
want_default=1
result=yes
fi
AC_DEFINE_UNQUOTED(@PARAM_VAR_PREFIX@_DEFAULT, $want_default,
[Whether the @MCA_COMPONENT_NAME@ @MCA_TYPE@ is the default @PROCESSED_MCA_TYPE@ or not])
AC_MSG_RESULT([$result])
#
# Part one of libtool magic
#
AM_ENABLE_SHARED
AM_DISABLE_STATIC
#
# Find which components should be built as run-time loadable components
# Acceptable combinations:
#
# [default -- no option given]
# --enable-mca-dso
# --enable-mca-dso=[.+,]*COMPONENT_TYPE[.+,]*
# --enable-mca-dso=[.+,]*COMPONENT_TYPE-COMPONENT_NAME[.+,]*
# --disable-mca-dso
#
AC_MSG_CHECKING([if want component to be a DSO])
AC_ARG_ENABLE(mca-dso,
AC_HELP_STRING([--enable-mca-dso=LIST],
[comma-separated list of types and/or type-component pairs that will be built as run-time loadable components (as opposed to statically linked in), if supported on this platform. The default is to build all components as DSOs; the --disable-mca-dso(=LIST) form can be used to disable building all or some types/components as DSOs. If LIST is "@MCA_TYPE@-@MCA_COMPONENT_NAME@" or "@MCA_COMPONENT_NAME@", then @MCA_COMPONENT_NAME@ will be compiled as a DSO (if supported on this platform).]))
# Manual conversion of $kind to its generic name (e.g., crmpi->cr,
# crompi->cr).
case "@MCA_TYPE@" in
crmpi)
generic_type="cr"
;;
crompi)
generic_type="cr"
;;
*)
generic_type="@MCA_TYPE@"
;;
esac
BUILD_@MCA_TYPE@_@MCA_COMPONENT_NAME@_DSO=0
msg=no
if test "$enable_shared" = "no"; then
msg=no
elif test -z "$enable_mca_dso" -o "$enable_mca_dso" = "yes" -o \
"$enable_mca_dso" = "@MCA_TYPE@" -o "$enable_mca_dso" = "$generic_type"; then
BUILD_@MCA_TYPE@_@MCA_COMPONENT_NAME@_DSO=1
msg=yes
else
ifs_save="$IFS"
IFS="${IFS}$PATH_SEPARATOR,"
for item in $enable_mca_dso; do
if test "$item" = "@MCA_TYPE@-@MCA_COMPONENT_NAME@" -o \
"$item" = "@MCA_TYPE@" -o "$item" = "$generic_type"; then
BUILD_@MCA_TYPE@_@MCA_COMPONENT_NAME@_DSO=1
msg=yes
fi
done
IFS="$ifs_save"
fi
AC_MSG_RESULT([$msg])
unset msg
###########################################################################
# Check for compilers and preprocessors
############################################################################
##################################
# Compiler characteristics
##################################
@C_COMPILER_SETUP@
@CXX_COMPILER_SETUP@
##################################
# Find Open MPI header files
##################################
# Are we building as part of the Open MPI source tree, or outside of it?
AC_ARG_WITH(openmpi,
AC_HELP_STRING([--with-openmpi=DIR],
[specify the location of the Open MPI header files and library. The default is to build within a source tree or be able to find the headers/library without additional CPPFLAGS/LDFLAGS. This option is generally only necessary when components are being configured/built outside of an Open MPI source tree]))
# Establish the top-level OMPI directory. If --with-openmpi was not
# specified, then see if we're building a) within an Open MPI source
# tree, or b) can find the Open MPI headers and library file without
# any additional CPPFLAGS/LDFLAGS.
top_ompi_srcdir=
top_ompi_builddir=
found_ompi_headers=
# Split this into multiple tests because we may have multiple
# possibilities here:
#
# - build in the Open MPI source tree
# - build outside of the Open MPI source tree, and have valid
# --with-openmpi
# - build outside of the Open MPI source tree, and not have a valid
# --with-openmpi
AC_MSG_CHECKING([for Open MPI header files])
# First case: we do not have --with-openmpi, so check and see if we're
# building inside the Open MPI source tree
if test -z "$with_openmpi"; then
# Are we within an Open MPI source tree?
if test -f "$srcdir/../../../../config/mca_configure.ac"; then
# This is needed for VPATH builds, so that it will -I the
# appropriate include directory (don't know why automake
# doesn't do this # automatically).
top_ompi_srcdir='$(top_srcdir)/../../../..'
top_ompi_builddir='$(top_builddir)/../../../..'
INCFLAGS='-I$(top_ompi_srcdir) -I$(top_ompi_builddir) -I$(top_ompi_srcdir)/opal/include -I$(top_ompi_builddir)/opal/include -I$(top_ompi_srcdir)/orte/include -I$(top_ompi_builddir)/orte/include -I$(top_ompi_srcdir)/ompi/include -I$(top_ompi_builddir)/ompi/include'" $CPPFLAGS"
found_ompi_headers=1
AC_MSG_RESULT([already in Open MPI source tree])
fi
fi
# If we haven't found the headers yet, then we know that we're *not*
# building within the Open MPI source tree.
if test -z "$found_ompi_headers"; then
top_ompi_srcdir=""
top_ompi_builddir="$top_ompi_srcdir"
fi
# Now see if a) we haven't found the headers yet, and b) we have
# --with-openmpi
if test -z "$found_ompi_headers"; then
# We're outside the Open MPI build tree, and we have been provided
# a top-level directory where the header files live.
if test -n "$with_openmpi"; then
if test -d $with_opemnpi ; then
if test -d "$with_openmpi/include/openmpi" -a \
-f "$with_openmpi/include/openmpi/include/ompi_socket_errno.h"; then
INCFLAGS="-I$with_openmpi/include/openmpi -I$with_openmpi/include"
found_ompi_headers=1
AC_MSG_RESULT([$with_openmpi/include/openmpi])
elif test -d "$with_openmpi/openmpi" -a \
-f "$with_openmpi/openmpi/include/ompi_socket_errno.h"; then
INCFLAGS="-I$with_openmpi/openmpi I$with_openmpi/openmpi"
found_ompi_headers=1
AC_MSG_RESULT([$with_openmpi/openmpi])
elif test -f "$with_openmpi/include/ompi_socket_errno.h"; then
INCFLAGS="-I$with_openmpi -I$with_openmpi/.."
found_ompi_headers=1
AC_MSG_RESULT([$with_openmpi])
else
AC_MSG_RESULT([got bogus --with-openmpi value])
AC_MSG_WARN([*** Directory $with_openmpi exists])
AC_MSG_WARN([*** But cannot seem to find Open MPI headers in it])
AC_MSG_WARN([*** Looking elsewhere...])
fi
else
AC_MSG_RESULT([got bogus --with-openmpi value])
AC_MSG_WARN([*** Directory $with_openmpi does not seem to exist])
AC_MSG_WARN([*** Trying to find Open MPI headers without it...])
fi
fi
# If we've gotten this far and haven't found the Open MPI headers
# yet, then just try compiling a C program with some of the Open
# MPI headers and see if they're found (i.e., if they're in the
# preprocessor's default search path)
if test -z "$found_ompi_headers"; then
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[#include "include/ompi_socket_errno.h"]],
[[]]),
[found_ompi_headers=1])
if test -n "$found_ompi_headers"; then
AC_MSG_RESULT([default preprocessor path])
fi
fi
fi
# If we got this far and haven't found the Open MPI headers, stick a
# fork in us, 'cause we're done.
if test -z "$found_ompi_headers"; then
AC_MSG_WARN([*** Could not find the Open MPI headers])
AC_MSG_ERROR([*** Cannot continue])
fi
AC_SUBST(top_ompi_srcdir)
AC_SUBST(top_ompi_builddir)
##################################
# @MCA_TYPE@ @MCA_COMPONENT_NAME@ component specific setup
##################################
#
# Unset all *_EXTRA_* flags
#
unset ABORT
for scope in LIBMPI WRAPPER; do
for flags in CFLAGS CXXFLAGS FFLAGS LDFLAGS LIBS; do
str="unset ${scope}_EXTRA_${flags}"
eval $str
done
done
#
# Invoke configure.stub code stubs, if they exist. Have at least one
# statement (well, m4 macro) in each "if" block so that some older sh
# flavors don't complain.
#
if test "$OMPI_WANT_DIST" = "no"; then
OMPI_LOG_MSG([Running configure stub macro])
@CONFIGURE_STUB_MACRO@
else
OMPI_LOG_MSG([Running configure dist stub macro])
@CONFIGURE_DIST_STUB_MACRO@
fi
#
# If any *_EXTRA_* flags were set, save them in $srcdir/post_configure.sh.
# This will be examined by the top-level configure script.
#
create_post_configure_file() {
if test ! -f post_configure.sh; then
cat > post_configure.sh <<EOF
# This file is automatically generated by configure.
# Manual changes will be lost!
# Generated by: `whoami`
# On machine: `hostname`
# On: `date`
EOF
fi
}
rm -f post_configure.sh
if test -n "$ABORT"; then
create_post_configure_file
echo "ABORT=\"$ABORT\"" >> post_configure.sh
AC_MSG_ERROR([*** ABORT flag is set; aborting])
fi
for scope in LIBMPI WRAPPER; do
for flags in CFLAGS CXXFLAGS FFLAGS LDFLAGS LIBS; do
str="found=\$${scope}_EXTRA_${flags}"
eval $str
if test -n "$found"; then
create_post_configure_file
echo "${scope}_EXTRA_${flags}=\"$found\"" >> post_configure.sh
fi
done
done
#
# We delayed doing it until now just so that long include paths don't
# show up in any of the configure output -- purely aesthetic.
#
CPPFLAGS="$CPPFLAGS $INCFLAGS"
CXXCPPFLAGS="$CXXCPPFLAGS $INCFLAGS"
#
# Delayed the substitution of these until now because they may have
# been modified throughout the course of this script.
#
AC_SUBST(CPPFLAGS)
AC_SUBST(CXXCPPFLAGS)
############################################################################
# libtool magic
############################################################################
ompi_show_subtitle "GNU libtool setup"
AM_PROG_LIBTOOL
AM_CONDITIONAL(OMPI_BUILD_@MCA_TYPE@_@MCA_COMPONENT_NAME@_DSO,
test "$BUILD_@MCA_TYPE@_@MCA_COMPONENT_NAME@_DSO" = "1")
############################################################################
# Party on
############################################################################
ompi_show_subtitle "Final output"
AM_CONFIG_HEADER([@PARAM_CONFIG_HEADER_FILE@])
AC_CONFIG_FILES([@PARAM_CONFIG_FILES@])
AC_OUTPUT

393
config/mca_make_configure.pl Executable file
View File

@ -0,0 +1,393 @@
#!/usr/bin/env perl
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# 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.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
use strict;
use Carp;
use Cwd;
use Getopt::Long;
use File::Basename;
############################################################################
# Local variables
############################################################################
my $ompi_topdir;
my $component_topdir;
my %config_values;
my %config_params;
my $initial_cwd = cwd();
my $announce_str = "Open MPI MCA component configure generator";
my %config_param_names = (PIFILE => "PARAM_INIT_FILE",
PCFGAUXDIR => "PARAM_CONFIG_AUX_DIR",
PC => "PARAM_WANT_C",
PCXX => "PARAM_WANT_CXX",
PVARPREFIX => "PARAM_VAR_PREFIX",
PAMNAME => "PARAM_AM_NAME",
PCFGHDRFILE => "PARAM_CONFIG_HEADER_FILE",
PCFGFILES => "PARAM_CONFIG_FILES",
PCOMPILEEXT => "PARAM_WANT_COMPILE_EXTERNAL",
);
############################################################################
# Command line arg procemcang
############################################################################
Getopt::Long::Configure("bundling", "require_order");
my $ok = Getopt::Long::GetOptions("ompidir|l=s" => \$ompi_topdir,
"componentdir|m=s" => \$component_topdir);
if (!$ok) {
print "Usage: $0 [--ompidir=DIR] [--componentdir=DIR]\n";
exit(1);
}
############################################################################
# Try to figure out the ompi and component topdirs
############################################################################
print "$announce_str starting\n";
if (!$ompi_topdir) {
$ompi_topdir = dirname($0);
}
chdir($ompi_topdir);
$ompi_topdir = cwd();
chdir($initial_cwd);
if (!$ompi_topdir || ! -f "$ompi_topdir/autogen.sh") {
croak("Unable to find OMPI base directory (try using --ompidir)");
}
if (!$component_topdir) {
$component_topdir = $initial_cwd;
if ($component_topdir eq $ompi_topdir) {
croak("Unable to determine which component to operate on");
}
}
chdir($component_topdir);
$component_topdir = cwd();
chdir($initial_cwd);
if (!$ompi_topdir || ! -d $component_topdir) {
croak("Unable to find component directory (try using --componentdir)");
}
# Print them out
print "--> Found OMPI top dir: $ompi_topdir\n";
print "--> Found component top dir: $component_topdir\n";
# If we have a configure.params file in the component topdir, we're good to
# go.
if (! -f "$component_topdir/configure.params") {
die("No configure.params in component topdir; nothing to do");
}
# Make a backup
if (-f "$component_topdir/acinclude.m4") {
printf(" *** WARNING: Replacing old acinclude.m4\n");
unlink("$component_topdir/acinclude.m4.bak");
rename("$component_topdir/acinclude.m4", "$component_topdir/acinclude.m4.bak");
}
if (-f "$component_topdir/configure.ac") {
printf(" *** WARNING: Replacing old configure.ac\n");
unlink("$component_topdir/configure.ac.bak");
rename("$component_topdir/configure.ac", "$component_topdir/configure.ac.bak");
}
############################################################################
# Set and calculate sensible default parameter values
############################################################################
# Unchangeable values
# MCA_TYPE: calculate
$config_values{"MCA_TYPE"} = dirname($component_topdir);
$config_values{"MCA_TYPE"} = basename($config_values{"MCA_TYPE"});
# PROCESSED_MCA_TYPE: For "special" MCA types, like "crompi" and
# "crmpi".
$config_values{"PROCESSED_MCA_TYPE"} = $config_values{"MCA_TYPE"};
if ($config_values{"PROCESSED_MCA_TYPE"} eq "crompi" ||
$config_values{"PROCESSED_MCA_TYPE"} eq "crmpi") {
$config_values{"PROCESSED_MCA_TYPE"} = "cr";
}
# MCA_NAME: calculate
$config_values{"MCA_COMPONENT_NAME"} = basename($component_topdir);
# Parameter (changeable) values
# PARAM_COMPILE_EXTERNAL: set
$config_params{$config_param_names{PCOMPILEEXT}} = 0;
# PARAM_CONFIG_AUX_DIR: set
if (-d "$component_topdir/config") {
$config_params{$config_param_names{PCFGAUXDIR}} = "config";
} else {
$config_params{$config_param_names{PCFGAUXDIR}} = ".";
}
$config_params{$config_param_names{PC}} = 1;
$config_params{$config_param_names{PCXX}} = 0;
# PARAM_VAR_PREFIX: calculate
$config_params{$config_param_names{PVARPREFIX}} =
"MCA_" . $config_values{"MCA_TYPE"} .
"_" . $config_values{"MCA_COMPONENT_NAME"};
# PARAM_AM_NAME: calculate
$config_params{$config_param_names{PAMNAME}} =
lc($config_values{"MCA_TYPE"}) .
"-" . lc($config_values{"MCA_COMPONENT_NAME"});
# PARAM_CONFIG_HEADER_FILE: calculate
$config_params{$config_param_names{PCFGHDRFILE}} =
"src/" . lc($config_values{"MCA_TYPE"}) .
"_" . lc($config_values{"MCA_COMPONENT_NAME"}) . "_config.h";
# Is there a config.stub file in the component topdir?
if (-f "$component_topdir/configure.stub") {
$config_values{CONFIGURE_STUB_SINCLUDE} = "#
# Component-specific tests
#
sinclude(configure.stub)\n";
$config_values{CONFIGURE_STUB_MACRO} =
"ompi_show_subtitle \"MCA " . $config_values{"MCA_TYPE"} . " " .
$config_values{"MCA_COMPONENT_NAME"} . "-specific setup\"
MCA_CONFIGURE_STUB";
# See if there's a CONFIGURE_DIST_STUB in configure.stub
open(STUB, "$component_topdir/configure.stub");
my $found = 0;
while (<STUB>) {
$found = 1
if ($_ =~ /MCA_CONFIGURE_DIST_STUB/);
}
close(STUB);
if ($found == 1) {
$config_values{CONFIGURE_DIST_STUB_MACRO} =
"ompi_show_subtitle \"MCA " . $config_values{"MCA_TYPE"} . " " .
$config_values{"MCA_COMPONENT_NAME"} .
"-specific setup (dist specific!)\"
MCA_CONFIGURE_DIST_STUB";
} else {
$config_values{CONFIGURE_DIST_STUB_MACRO} = "true";
}
} else {
$config_values{CONFIGURE_STUB_SINCLUDE} = "";
$config_values{CONFIGURE_STUB_MACRO} = "true";
$config_values{CONFIGURE_DIST_STUB_MACRO} = "true";
}
############################################################################
# Read in the configure.params file (possibly overriding the defaults
# set above)
############################################################################
my $found = 0;
my @names = values %config_param_names;
open(PARAMS, "$component_topdir/configure.params") ||
die("Could not open configure.params in $component_topdir");
while (<PARAMS>) {
chomp;
# Ignore comments and blank lines
my $line = $_;
$line =~ s/^[ \t]+(.*)[ \t]+$/\1/;
$line =~ s/(.*)[\#]+.*/\1/;
next if (length($line) == 0);
# So we have a key=value line
# Split into componenty, and remove quotes
my ($key, $value) = split(/=/, $line);
$key =~ s/^[ \t]+(.*)[ \t]+$/\1/;
$value =~ s/^[ \t]+(.*)[ \t]+$/\1/;
$value =~ s/^[\"](.*)[\"]$/\1/;
$value =~ s/^[\'](.*)[\']$/\1/;
for (my $i = 0; $i <= $#names; ++$i) {
if ($key eq $names[$i]) {
if (!$found) {
printf("--> Found parameter override(s):\n");
$found = 1;
}
printf(" $key = $value\n");
$config_params{$key} = $value;
last;
}
}
}
# Print out the values
print "--> Final configuration values:\n";
foreach my $key (sort keys(%config_param_names)) {
print " $config_param_names{$key} = " .
$config_params{$config_param_names{$key}} . "\n";
}
# Do some error checking on the values that we've determined
if (! -f $config_params{PARAM_INIT_FILE}) {
print "*** WARNING: PARAM_INIT_FILE does not exist:\n";
print "*** WARNING: $config_params{PARAM_INIT_FILE}\n";
print "*** WARNING: resulting configure script will not run properly!\n";
exit(1);
}
my @files = split(/ /, $config_params{PARAM_CONFIG_FILES});
foreach my $file (@files) {
if (! -f "$file.in" && ! -f "$file.am") {
print "*** WARNING: PARAM_CONFIG_FILES file does not exist:\n";
print "*** WARNING: $file.[in|am]\n";
print "*** WARNING: resulting configure script may not run correctly!!\n";
exit(1);
}
}
if (! -d $config_params{PARAM_CONFIG_AUX_DIR}) {
print "*** WARNING: PARAM_CONFIG_AUX_DIR does not exit:\n";
print "*** WARNING: $config_params{PARAM_CONFIG_AUX_DIR}\n";
print "*** WARNING: Taking the liberty of trying to make it...\n";
if (!mkdir($config_params{PARAM_CONFIG_AUX_DIR})) {
print "*** ERROR: Failed to make AUX_DIR: $config_params{PARAM_CONFIG_AUX_DIR}\n";
print "*** ERROR: Cannot continue\n";
exit(1);
}
}
# If we want to be able to compile outside the Open MPI tree, we need
# to copy some files to the auxdir
if ($config_params{PARAM_WANT_COMPILE_EXTERNAL} != 0) {
my $auxdir = $config_params{PARAM_CONFIG_AUX_DIR};
open (ACINCLUDE, "$ompi_topdir/config/mca_acinclude.m4");
{
while (<ACINCLUDE>) {
chomp;
my $filename = $_;
if ($filename =~ /^.*sinclude\(\@M4DIR\@\/(.+)\).*$/) {
$filename =~ s/^.*sinclude\(\@M4DIR\@\/(.+)\).*$/\1/;
unlink("$auxdir/$filename")
if (-f "$auxdir/$filename");
print "--> Copying m4 file: $filename ==> $auxdir\n";
system("cp -f $ompi_topdir/config/$filename $config_params{PARAM_CONFIG_AUX_DIR}");
}
}
close(ACINCLUDE);
}
}
############################################################################
# Read in the configure.ac template
############################################################################
sub make_template {
my ($src, $dest, $mode) = @_;
my $template;
my $search;
my $replace;
# Read in the template file
print "--> Reading template file: $src\n";
open(TEMPLATE, $src) ||
die("Cannot open template file: $src");
while (<TEMPLATE>) {
$template .= $_;
}
close(TEMPLATE);
# Transform the template
# If we want C or C++, substitute in the right setup macros
$search = "\@C_COMPILER_SETUP\@";
$replace = $config_params{$config_param_names{"PC"}} ?
"OMPI_SETUP_CC" : "";
$template =~ s/$search/$replace/;
$search = "\@CXX_COMPILER_SETUP\@";
$replace = $config_params{$config_param_names{"PCXX"}} ?
"OMPI_SETUP_CXX" : "";
$template =~ s/$search/$replace/;
# If we want to be able to compile outside the Open MPI tree, set
# the right include path for the M4 files
$search = "\@M4DIR\@";
$replace = ($config_params{PARAM_WANT_COMPILE_EXTERNAL} == 1) ?
$config_params{PARAM_CONFIG_AUX_DIR} : "../../../../config";
$template =~ s/$search/$replace/g;
# Do all the parameters. This is done last so that any of the
# above can use paramter values in their values, and expect to
# have their respective values substituted in (i.e., a [semi]
# recursive substitution).
print "--> Filling in the template...\n";
foreach my $key (sort keys(%config_values)) {
$search = "@" . $key . "@";
$template =~ s/$search/$config_values{$key}/g;
}
foreach my $key (sort keys(%config_param_names)) {
next if ($key eq "PC" || $key eq "PCXX");
$search = "@" . $config_param_names{$key} . "@";
$template =~
s/$search/$config_params{$config_param_names{$key}}/g;
}
# Write it out
print "--> Writing output file: $dest\n";
open(OUTPUT, ">$dest") ||
die("Cannot open output flie: $dest");
print OUTPUT $template;
close(OUTPUT);
chmod($dest, $mode);
}
# Read and fill in the templates
make_template("$ompi_topdir/config/mca_configure.ac",
"$component_topdir/configure.ac", 0644);
make_template("$ompi_topdir/config/mca_acinclude.m4",
"$component_topdir/acinclude.m4", 0644);
############################################################################
# All done
############################################################################
print "\n$announce_str finished\n";
exit(0);

View File

@ -0,0 +1,103 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
AC_DEFUN([OMPI_CASE_SENSITIVE_FS_SETUP],[
#
# Arguments: none
#
# Dependencies: None
#
# See if we are on a case sensitive filesystem. Some filesystems
# (like HFS+ on MacOS X and MS Windows) are not case sensitive - mpicc
# and mpiCC are the same file.
#
# Sets prefix_OS_HAVE_CASE_SENSITIVE_FS to 1 if filesystem is case
# sensitive (ie, mpicc and mpiCC will be different files) or 0 if
# filesystem is not case sensitive (ie, mpicc and mpiCC will be
# the same file).
#
#
have_cs_fs=1
AC_MSG_CHECKING([if build filesystem is case sensitive])
cat > conf_fs_test.$$ <<EOF
lowercase
EOF
cat > CONF_FS_TEST.$$ <<EOF
uppercase
EOF
if test "`cat conf_fs_test.$$`" = "lowercase"; then
have_cs_fs=1
AC_MSG_RESULT([yes])
else
have_cs_fs=0
AC_MSG_RESULT([no])
fi
rm -f conf_fs_test.$$ CONF_FS_TEST.$$
#
# Now see what the user wants to do...
#
AC_MSG_CHECKING([if configuring for case sensitive filesystem])
AC_ARG_WITH(cs_fs,
AC_HELP_STRING([--with-cs-fs],
[Destination FS is case sensitive (default: set to value of the build FS's case sensitivity)]))
if test "$with_cs_fs" = "yes"; then
OMPI_WANT_CS_FS=1
elif test -z "$with_cs_fs"; then
OMPI_WANT_CS_FS=$have_cs_fs
else
OMPI_WANT_CS_FS=0
fi
if test "$OMPI_WANT_CS_FS" = "1"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(CASE_SENSITIVE_FS, test "$OMPI_WANT_CS_FS" = "1")
if test "$OMPI_WANT_CS_FS" = "0"; then
cat <<EOF
*******************************************************************************
NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
*******************************************************************************
Because Open MPI is being installed on a non-case sensitive file
system, the C++ wrapper compiler will be named mpic++ instead of the
traditional mpiCC.
Please update any makefiles appropriately.
*******************************************************************************
NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
*******************************************************************************
EOF
fi
# Clean up
unset have_cs_fs])dnl

33
config/ompi_check_alps.m4 Normal file
View File

@ -0,0 +1,33 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# 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.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# OMPI_CHECK_ALPS(prefix, [action-if-found], [action-if-not-found])
# --------------------------------------------------------
AC_DEFUN([OMPI_CHECK_ALPS],[
AC_ARG_WITH([alps],
[AC_HELP_STRING([--with-alps],
[Build ALPS scheduler component (default: no)])])
if test "$with_alps" = "yes" ; then
ompi_check_alps_happy="yes"
fi
AS_IF([test "$ompi_check_alps_happy" = "yes"],
[$2],
[$3])
])

View File

@ -0,0 +1,517 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
# 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.
# Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
#
# Search the generated warnings for
# keywords regarding skipping or ignoring certain attributes
# Intel: ignore
# Sun C++: skip
#
AC_DEFUN([_OMPI_ATTRIBUTE_FAIL_SEARCH],[
AC_REQUIRE([AC_PROG_GREP])
if test -s conftest.err ; then
for i in ignore skip ; do
$GREP -iq $i conftest.err
if test "$?" = "0" ; then
ompi_cv___attribute__[$1]=0
break;
fi
done
fi
])
#
# Check for one specific attribute by compiling with C and C++
# and possibly using a cross-check.
#
# If the cross-check is defined, a static function "usage" should be
# defined, which is to be called from main (to circumvent warnings
# regarding unused function in main file)
# static int usage (int * argument);
#
# The last argument is for specific CFLAGS, that need to be set
# for the compiler to generate a warning on the cross-check.
# This may need adaption for future compilers / CFLAG-settings.
#
AC_DEFUN([_OMPI_CHECK_SPECIFIC_ATTRIBUTE], [
AC_MSG_CHECKING([for __attribute__([$1])])
AC_CACHE_VAL(ompi_cv___attribute__[$1], [
#
# Try to compile using the C compiler, then C++
#
AC_TRY_COMPILE([$2],[],
[
#
# In case we did succeed: Fine, but was this due to the
# attribute being ignored/skipped? Grep for IgNoRe/skip in conftest.err
# and if found, reset the ompi_cv__attribute__var=0
#
ompi_cv___attribute__[$1]=1
_OMPI_ATTRIBUTE_FAIL_SEARCH([$1])
],
[ompi_cv___attribute__[$1]=0])
if test "$ompi_cv___attribute__[$1]" = "1" ; then
AC_LANG_PUSH(C++)
AC_TRY_COMPILE([
extern "C" {
$2
}],[],
[
ompi_cv___attribute__[$1]=1
_OMPI_ATTRIBUTE_FAIL_SEARCH([$1])
],[ompi_cv___attribute__[$1]=0])
AC_LANG_POP(C++)
fi
#
# If the attribute is supported by both compilers,
# try to recompile a *cross-check*, IFF defined.
#
if test '(' "$ompi_cv___attribute__[$1]" = "1" -a "[$3]" != "" ')' ; then
ac_c_werror_flag_safe=$ac_c_werror_flag
ac_c_werror_flag="yes"
CFLAGS_safe=$CFLAGS
CFLAGS="$CFLAGS [$4]"
AC_TRY_COMPILE([$3],
[
int i=4711;
i=usage(&i);
],
[ompi_cv___attribute__[$1]=0],
[
#
# In case we did NOT succeed: Fine, but was this due to the
# attribute being ignored? Grep for IgNoRe in conftest.err
# and if found, reset the ompi_cv__attribute__var=0
#
ompi_cv___attribute__[$1]=1
_OMPI_ATTRIBUTE_FAIL_SEARCH([$1])
])
ac_c_werror_flag=$ac_c_werror_flag_safe
CFLAGS=$CFLAGS_safe
fi
])
if test "$ompi_cv___attribute__[$1]" = "1" ; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
])
#
# Test the availability of __attribute__ and with the help
# of _OMPI_CHECK_SPECIFIC_ATTRIBUTE for the support of
# particular attributes. Compilers, that do not support an
# attribute most often fail with a warning (when the warning
# level is set).
# The compilers output is parsed in _OMPI_ATTRIBUTE_FAIL_SEARCH
#
# To add a new attributes __NAME__ add the
# ompi_cv___attribute__NAME
# add a new check with _OMPI_CHECK_SPECIFIC_ATTRIBUTE (possibly with a cross-check)
# _OMPI_CHECK_SPECIFIC_ATTRIBUTE([name], [int foo (int arg) __attribute__ ((__name__));], [], [])
# and define the corresponding
# AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_NAME, [$ompi_cv___attribute__NAME],
# [Whether your compiler has __attribute__ NAME or not])
# and decide on a correct macro (in opal/include/opal_config_bottom.h):
# # define __opal_attribute_NAME(x) __attribute__(__NAME__)
#
# Please use the "__"-notation of the attribute in order not to
# clash with predefined names or macros (e.g. const, which some compilers
# do not like..)
#
AC_DEFUN([OMPI_CHECK_ATTRIBUTES], [
AC_MSG_CHECKING(for __attribute__)
AC_CACHE_VAL(ompi_cv___attribute__, [
AC_TRY_COMPILE(
[#include <stdlib.h>
/* Check for the longest available __attribute__ (since gcc-2.3) */
struct foo {
char a;
int x[2] __attribute__ ((__packed__));
};
],
[],
[ompi_cv___attribute__=1],
[ompi_cv___attribute__=0],
)
if test "$ompi_cv___attribute__" = "1" ; then
AC_TRY_COMPILE(
[#include <stdlib.h>
/* Check for the longest available __attribute__ (since gcc-2.3) */
struct foo {
char a;
int x[2] __attribute__ ((__packed__));
};
],
[],
[ompi_cv___attribute__=1],
[ompi_cv___attribute__=0],
)
fi
])
AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE, [$ompi_cv___attribute__],
[Whether your compiler has __attribute__ or not])
#
# Now that we know the compiler support __attribute__ let's check which kind of
# attributed are supported.
#
if test "$ompi_cv___attribute__" = "0" ; then
AC_MSG_RESULT([no])
ompi_cv___attribute__aligned=0
ompi_cv___attribute__always_inline=0
ompi_cv___attribute__cold=0
ompi_cv___attribute__const=0
ompi_cv___attribute__deprecated=0
ompi_cv___attribute__format=0
ompi_cv___attribute__hot=0
ompi_cv___attribute__malloc=0
ompi_cv___attribute__may_alias=0
ompi_cv___attribute__no_instrument_function=0
ompi_cv___attribute__nonnull=0
ompi_cv___attribute__noreturn=0
ompi_cv___attribute__packed=0
ompi_cv___attribute__pure=0
ompi_cv___attribute__sentinel=0
ompi_cv___attribute__unused=0
ompi_cv___attribute__visibility=0
ompi_cv___attribute__warn_unused_result=0
ompi_cv___attribute__weak_alias=0
else
AC_MSG_RESULT([yes])
_OMPI_CHECK_SPECIFIC_ATTRIBUTE([aligned],
[struct foo { char text[4]; } __attribute__ ((__aligned__(8)));],
[],
[])
#
# Ignored by PGI-6.2.5; -- recognized by output-parser
#
_OMPI_CHECK_SPECIFIC_ATTRIBUTE([always_inline],
[int foo (int arg) __attribute__ ((__always_inline__));],
[],
[])
_OMPI_CHECK_SPECIFIC_ATTRIBUTE([cold],
[
int foo(int arg1, int arg2) __attribute__ ((__cold__));
int foo(int arg1, int arg2) { return arg1 * arg2 + arg1; }
],
[],
[])
_OMPI_CHECK_SPECIFIC_ATTRIBUTE([const],
[
int foo(int arg1, int arg2) __attribute__ ((__const__));
int foo(int arg1, int arg2) { return arg1 * arg2 + arg1; }
],
[],
[])
_OMPI_CHECK_SPECIFIC_ATTRIBUTE([deprecated],
[
int foo(int arg1, int arg2) __attribute__ ((__deprecated__));
int foo(int arg1, int arg2) { return arg1 * arg2 + arg1; }
],
[],
[])
ATTRIBUTE_CFLAGS=
case "$ompi_c_vendor" in
gnu)
ATTRIBUTE_CFLAGS="-Wall"
;;
intel)
# we want specifically the warning on format string conversion
ATTRIBUTE_CFLAGS="-we181"
;;
esac
_OMPI_CHECK_SPECIFIC_ATTRIBUTE([format],
[
int this_printf (void *my_object, const char *my_format, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
],
[
static int usage (int * argument);
extern int this_printf (int arg1, const char *my_format, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
static int usage (int * argument) {
return this_printf (*argument, "%d", argument); /* This should produce a format warning */
}
/* The autoconf-generated main-function is int main(), which produces a warning by itself */
int main(void);
],
[$ATTRIBUTE_CFLAGS])
_OMPI_CHECK_SPECIFIC_ATTRIBUTE([hot],
[
int foo(int arg1, int arg2) __attribute__ ((__hot__));
int foo(int arg1, int arg2) { return arg1 * arg2 + arg1; }
],
[],
[])
_OMPI_CHECK_SPECIFIC_ATTRIBUTE([malloc],
[
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
int * foo(int arg1) __attribute__ ((__malloc__));
int * foo(int arg1) { return (int*) malloc(arg1); }
],
[],
[])
#
# Attribute may_alias: No suitable cross-check available, that works for non-supporting compilers
# Ignored by intel-9.1.045 -- turn off with -wd1292
# Ignored by PGI-6.2.5; ignore not detected due to missing cross-check
#
_OMPI_CHECK_SPECIFIC_ATTRIBUTE([may_alias],
[int * p_value __attribute__ ((__may_alias__));],
[],
[])
_OMPI_CHECK_SPECIFIC_ATTRIBUTE([no_instrument_function],
[int * foo(int arg1) __attribute__ ((__no_instrument_function__));],
[],
[])
#
# Attribute nonnull:
# Ignored by intel-compiler 9.1.045 -- recognized by cross-check
# Ignored by PGI-6.2.5 (pgCC) -- recognized by cross-check
#
ATTRIBUTE_CFLAGS=
case "$ompi_c_vendor" in
gnu)
ATTRIBUTE_CFLAGS="-Wall"
;;
intel)
# we do not want to get ignored attributes warnings, but rather real warnings
ATTRIBUTE_CFLAGS="-wd1292"
;;
esac
_OMPI_CHECK_SPECIFIC_ATTRIBUTE([nonnull],
[
int square(int *arg) __attribute__ ((__nonnull__));
int square(int *arg) { return *arg; }
],
[
static int usage(int * argument);
int square(int * argument) __attribute__ ((__nonnull__));
int square(int * argument) { return (*argument) * (*argument); }
static int usage(int * argument) {
return square( ((void*)0) ); /* This should produce an argument must be nonnull warning */
}
/* The autoconf-generated main-function is int main(), which produces a warning by itself */
int main(void);
],
[$ATTRIBUTE_CFLAGS])
_OMPI_CHECK_SPECIFIC_ATTRIBUTE([noreturn],
[
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
void fatal(int arg1) __attribute__ ((__noreturn__));
void fatal(int arg1) { exit(arg1); }
],
[],
[])
_OMPI_CHECK_SPECIFIC_ATTRIBUTE([packed],
[
struct foo {
char a;
int x[2] __attribute__ ((__packed__));
};
],
[],
[])
_OMPI_CHECK_SPECIFIC_ATTRIBUTE([pure],
[
int square(int arg) __attribute__ ((__pure__));
int square(int arg) { return arg * arg; }
],
[],
[])
#
# Attribute sentinel:
# Ignored by the intel-9.1.045 -- recognized by cross-check
# intel-10.0beta works fine
# Ignored by PGI-6.2.5 (pgCC) -- recognized by output-parser and cross-check
# Ignored by pathcc-2.2.1 -- recognized by cross-check (through grep ignore)
#
ATTRIBUTE_CFLAGS=
case "$ompi_c_vendor" in
gnu)
ATTRIBUTE_CFLAGS="-Wall"
;;
intel)
# we do not want to get ignored attributes warnings
ATTRIBUTE_CFLAGS="-wd1292"
;;
esac
_OMPI_CHECK_SPECIFIC_ATTRIBUTE([sentinel],
[
int my_execlp(const char * file, const char *arg, ...) __attribute__ ((__sentinel__));
],
[
static int usage(int * argument);
int my_execlp(const char * file, const char *arg, ...) __attribute__ ((__sentinel__));
static int usage(int * argument) {
void * last_arg_should_be_null = argument;
return my_execlp ("lala", "/home/there", last_arg_should_be_null); /* This should produce a warning */
}
/* The autoconf-generated main-function is int main(), which produces a warning by itself */
int main(void);
],
[$ATTRIBUTE_CFLAGS])
_OMPI_CHECK_SPECIFIC_ATTRIBUTE([unused],
[
int square(int arg1 __attribute__ ((__unused__)), int arg2);
int square(int arg1, int arg2) { return arg2; }
],
[],
[])
#
# Ignored by PGI-6.2.5 (pgCC) -- recognized by the output-parser
#
_OMPI_CHECK_SPECIFIC_ATTRIBUTE([visibility],
[
int square(int arg1) __attribute__ ((__visibility__("hidden")));
],
[],
[])
#
# Attribute warn_unused_result:
# Ignored by the intel-compiler 9.1.045 -- recognized by cross-check
# Ignored by pathcc-2.2.1 -- recognized by cross-check (through grep ignore)
#
ATTRIBUTE_CFLAGS=
case "$ompi_c_vendor" in
gnu)
ATTRIBUTE_CFLAGS="-Wall"
;;
intel)
# we do not want to get ignored attributes warnings
ATTRIBUTE_CFLAGS="-wd1292"
;;
esac
_OMPI_CHECK_SPECIFIC_ATTRIBUTE([warn_unused_result],
[
int foo(int arg) __attribute__ ((__warn_unused_result__));
int foo(int arg) { return arg + 3; }
],
[
static int usage(int * argument);
int foo(int arg) __attribute__ ((__warn_unused_result__));
int foo(int arg) { return arg + 3; }
static int usage(int * argument) {
foo (*argument); /* Should produce an unused result warning */
return 0;
}
/* The autoconf-generated main-function is int main(), which produces a warning by itself */
int main(void);
],
[$ATTRIBUTE_CFLAGS])
_OMPI_CHECK_SPECIFIC_ATTRIBUTE([weak_alias],
[
int foo(int arg);
int foo(int arg) { return arg + 3; }
int foo2(int arg) __attribute__ ((__weak__, __alias__("foo")));
],
[],
[])
fi
# Now that all the values are set, define them
AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_ALIGNED, [$ompi_cv___attribute__aligned],
[Whether your compiler has __attribute__ aligned or not])
AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_ALWAYS_INLINE, [$ompi_cv___attribute__always_inline],
[Whether your compiler has __attribute__ always_inline or not])
AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_COLD, [$ompi_cv___attribute__cold],
[Whether your compiler has __attribute__ cold or not])
AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_CONST, [$ompi_cv___attribute__const],
[Whether your compiler has __attribute__ const or not])
AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_DEPRECATED, [$ompi_cv___attribute__deprecated],
[Whether your compiler has __attribute__ deprecated or not])
AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_FORMAT, [$ompi_cv___attribute__format],
[Whether your compiler has __attribute__ format or not])
AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_HOT, [$ompi_cv___attribute__hot],
[Whether your compiler has __attribute__ hot or not])
AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_MALLOC, [$ompi_cv___attribute__malloc],
[Whether your compiler has __attribute__ malloc or not])
AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_MAY_ALIAS, [$ompi_cv___attribute__may_alias],
[Whether your compiler has __attribute__ may_alias or not])
AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_NO_INSTRUMENT_FUNCTION, [$ompi_cv___attribute__no_instrument_function],
[Whether your compiler has __attribute__ no_instrument_function or not])
AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_NONNULL, [$ompi_cv___attribute__nonnull],
[Whether your compiler has __attribute__ nonnull or not])
AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_NORETURN, [$ompi_cv___attribute__noreturn],
[Whether your compiler has __attribute__ noreturn or not])
AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_PACKED, [$ompi_cv___attribute__packed],
[Whether your compiler has __attribute__ packed or not])
AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_PURE, [$ompi_cv___attribute__pure],
[Whether your compiler has __attribute__ pure or not])
AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_SENTINEL, [$ompi_cv___attribute__sentinel],
[Whether your compiler has __attribute__ sentinel or not])
AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_UNUSED, [$ompi_cv___attribute__unused],
[Whether your compiler has __attribute__ unused or not])
AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_VISIBILITY, [$ompi_cv___attribute__visibility],
[Whether your compiler has __attribute__ visibility or not])
AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_WARN_UNUSED_RESULT, [$ompi_cv___attribute__warn_unused_result],
[Whether your compiler has __attribute__ warn unused result or not])
AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_WEAK_ALIAS, [$ompi_cv___attribute__weak_alias],
[Whether your compiler has __attribute__ weak alias or not])
])

View File

@ -0,0 +1,67 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# 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.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# new bproc is LANL versions >= 3.2.0
# old bproc is all Scyld versions and LANL version < 3.2.0
# OMPI_CHECK_BPROC(prefix, [action-if-new-bproc], [action-if-old-bproc],
# [action-if-not-found])
# --------------------------------------------------------
AC_DEFUN([OMPI_CHECK_BPROC],[
AC_ARG_WITH([bproc],
[AC_HELP_STRING([--with-bproc],
[Directory where the BProc software is installed])])
AS_IF([test ! -z "$with_bproc" -a "$with_bproc" = "no"],[$4], [
ompi_check_bproc_save_CPPFLAGS="$CPPFLAGS"
ompi_check_bproc_save_LDFLAGS="$LDFLAGS"
ompi_check_bproc_save_LIBS="$LIBS"
AS_IF([test ! -z "$with_bproc" -a "$with_bproc" != "yes"],
[CPPFLAGS="$CPPFLAGS -I$with_bproc/include"
LDFLAGS="$LDFLAGS -L$with_bproc/lib"])
AC_CHECK_HEADERS([sys/bproc.h],
[AC_CHECK_LIB([bproc],
[bproc_numnodes],
[ompi_check_bproc_happy="yes"],
[ompi_check_bproc_happy="no"])],
[ompi_check_bproc_happy="no"])
# Check for Scyld bproc or an old version of LANL Bproc (pre 3.2.0)
AS_IF([test "$ompi_check_bproc_happy" = "yes"],
[AC_CHECK_HEADERS([sys/bproc_common.h],[ompi_check_bproc_happy="new"],
[ompi_check_bproc_happy="old"],
[#include <stdint.h>
#include <sys/socket.h>])])
CPPFLAGS="$ompi_check_bproc_save_CPPFLAGS"
LDFLAGS="$ompi_check_bproc_save_LDFLAGS"
LIBS="$ompi_check_bproc_save_LIBS"
AS_IF([test "$ompi_check_bproc_happy" != "no"],
[AS_IF([test ! -z "$with_bproc" -a "$with_bproc" != "yes"],
[$1_CPPFLAGS="$$1_CPPFLAGS -I$with_bproc/include"
$1_LDFLAGS="$$1_LDFLAGS -L$with_bproc/lib"])
$1_LIBS="$$1_LIBS -lbproc"
AS_IF([test "$ompi_check_bproc_happy" = "new"], [$2], [$3])],
[AS_IF([test ! -z "$with_bproc"],
[AC_MSG_ERROR([BProc support request but not found. Perhaps
you need to specify the location of the BProc libraries.])])
$4])
])
])

View File

@ -0,0 +1,53 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
dnl There was some mentioning of broken qsort happened for Solaris that could
dnl cause qsort to return a bad pointer which could cause some badness.
dnl The problem should have been corrected with these patches from SunSolve.
dnl Solaris 10 should be free from this problem.
dnl
dnl 5.8_sparc #108827-27 or later
dnl 5.8_x86 #108828-28 or later
dnl 5.9_sparc #112874-20 or later
dnl 5.9_x86 #114432-07 or later
dnl
dnl For users who could not patch their systems or are convinced that their
dnl native qsort is broken, they could specify this configure flag to use
dnl the opal_qsort instead.
# check for broken qsort
# OMPI_CHECK_BROKEN_QSORT(prefix, [action-if-found], [action-if-not-found])
# --------------------------------------------------------
AC_DEFUN([OMPI_CHECK_BROKEN_QSORT],[
AC_ARG_WITH([broken-qsort],
[AC_HELP_STRING([--with-broken-qsort],
[Build with FreeBSD qsort instead of native qsort (default: no)])])
AC_MSG_CHECKING([for broken qsort])
if test "$with_broken_qsort" = "yes"; then
result="yes"
define_result=1
else
result="no"
define_result=0
fi
AC_MSG_RESULT([$result])
AC_DEFINE_UNQUOTED([OMPI_HAVE_BROKEN_QSORT], [$define_result],
[whether qsort is broken or not])
])

View File

@ -0,0 +1,55 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2006 Los Alamos National Security, LLC. All rights
dnl reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OMPI_CHECK_COMPILER_WORKS(language, headers, body,
# [action-if-found], [action-if-not-found])
# ----------------------------------------------------
# Try to compile and run a simple application in 'language'. A
# warning is always printed if the application fails to run.
# Action-if-found is evaluated if the application runs successfully
# (or compiles if cross-compiling), and action-if-not-found is
# evaluated if the application fails to run.
#
# headers are any headers needed to compile the body (e.g., #include
# statements), and body is the program to compile. It should include
# a clean exit from the application (e.g., "return 0" in C/C++, empty in
# fortran).
AC_DEFUN([OMPI_CHECK_COMPILER_WORKS],
[ AS_VAR_PUSHDEF([lang_var], [ompi_cv_$1_works])
AC_CACHE_CHECK([if $1 compiler works], lang_var,
[AC_LANG_PUSH($1)
AC_RUN_IFELSE([AC_LANG_PROGRAM([$2], [$3])],
[AS_VAR_SET(lang_var, ["yes"])],
[AS_VAR_SET(lang_var, ["no"])],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([$2], [$3])],
[AS_VAR_SET(lang_var, ["links (cross compiling)"])],
[AS_VAR_SET(lang_var, ["no"])])])
AC_LANG_POP($1)])
AS_IF([test "AS_VAR_GET(lang_var)" = "no"],
[cat <<EOF >&2
**********************************************************************
* It appears that your $1 compiler is unable to produce working
* executables. A simple test application failed to properly
* execute. Note that this is likely not a problem with Open MPI,
* but a problem with the local compiler installation. More
* information (including exactly what command was given to the
* compiler and what error resulted when the command was executed) is
* available in the config.log file in this directory.
**********************************************************************
EOF
$5], [$4])
AS_VAR_POPDEF([lang_var])dnl
])

View File

@ -0,0 +1,47 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OMPI_CHECK_FUNC_LIB(func, lib, [action-if-found], [action-if-not-found])
# ------------------------------
# Try to find function func, first with the present LIBS, second with
# lib added to LIBS. If func is found with the libraries listed in
# LIBS, no modification to LIBS is made. If func is in lib (but not
# in LIBS) then lib is added to LIBS. If func is not in lib, then
# LIBS is not modified.
AC_DEFUN([OMPI_CHECK_FUNC_LIB],[
AS_VAR_PUSHDEF([ompi_var], [ompi_cv_func_lib_$1_$2])dnl
AC_CACHE_CHECK([if we need -l$2 for $1],
ompi_var,
[AC_LINK_IFELSE([AC_LANG_FUNC_LINK_TRY([$1])],
[AS_VAR_SET(ompi_var, "no")],
[LIBS_save="$LIBS"
LIBS="$LIBS -l$2"
AC_LINK_IFELSE([AC_LANG_FUNC_LINK_TRY([$1])],
[AS_VAR_SET(ompi_var, "yes")],
[AS_VAR_SET(ompi_var, "not found")])
LIBS="$LIBS_save"])])
AS_IF([test "AS_VAR_GET(ompi_var)" = "yes"],
[LIBS="$LIBS -l$2"])
# see if we actually have $1. Use AC_CHECK_FUNCS so that it
# does the glibc "not implemented" check. Will use the current LIBS,
# so will check in -l$2 if we decided we needed it above
AC_CHECK_FUNCS([$1], $3, $4)
AS_VAR_POPDEF([ompi_var])dnl
])

155
config/ompi_check_gm.m4 Normal file
View File

@ -0,0 +1,155 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# 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.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
AC_DEFUN([_OMPI_CHECK_GM_CONFIG],[
u_OMPI_CHECK_GM_CONFIG_SAVE_CPPFLAGS="$CPPFLAGS"
u_OMPI_CHECK_GM_CONFIG_SAVE_LDFLAGS="$LDFLAGS"
u_OMPI_CHECK_GM_CONFIG_SAVE_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $$1_CPPFLAGS"
LDFLAGS="$LDFLAGS $$1_LDFLAGS"
LIBS="$LIBS $$1_LIBS"
#
# See if we have GM_API_VERSION. If we do, use it. If not, find the
# highest one available. It seems that GM_API_VERSION was introduced
# somewhere after 1.3 but before 1.6. :-\
#
AC_MSG_CHECKING(for GM_API_VERSION)
AC_TRY_COMPILE([#include<gm.h>],
[int foo = GM_API_VERSION;],
have_gm_api_ver_msg=yes gm_api_ver=GM_API_VERSION,
have_gm_api_ver_msg=no gm_api_ver="")
AC_MSG_RESULT([$have_gm_api_ver_msg])
if test "$gm_api_ver" = ""; then
found=0
for val in 5 4 3; do
if test "$found" = "0"; then
var="GM_API_VERSION_1_$val"
AC_MSG_CHECKING(for $var)
AC_TRY_COMPILE([#include<gm.h>],
[int foo = $var;],
msg=yes found=1 gm_api_ver=$var,
msg=no found=0 gm_api_ver="")
AC_MSG_RESULT($msg)
fi
done
fi
if test "$gm_api_ver" = ""; then
AC_MSG_WARN([*** Could not find a supported GM_API_VERSION])
AC_MSG_ERROR([*** Cannot continue])
fi
AC_DEFINE_UNQUOTED([OMPI_MCA_]m4_translit([$1], [a-z], [A-Z])[_API_VERSION], $gm_api_ver,
[Version of the GM API to use])
unset gm_api_ver have_gm_api_ver_msg found val msg
#
# Do we have gm_put()?
# gm_put() was introduced in gm 2.0, and is exactly identical to gm
# 1.6's gm_directed_send_with_callback(). The name was simply changed
# for consistency/symmtery with gm_get().
#
AC_MSG_CHECKING([for gm_put()])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include<gm.h>
]],
[[gm_put(0, 0, 0, 0, 0, 0, 0, 0, 0);]])],
[HAVE_RDMA_PUT=1 MSG=yes],
[HAVE_RDMA_PUT=0 MSG="no, use gm_directed_send_with_callback()"])
AC_DEFINE_UNQUOTED([OMPI_MCA_]m4_translit([$1], [a-z], [A-Z])[_HAVE_RDMA_PUT], $HAVE_RDMA_PUT,
[Whether we have gm_put() or gm_directed_send_with_callback()])
AC_MSG_RESULT([$MSG])
#
# Do we have gm_get()?
# gm_get() was introduced in gm 2.0.
#
AC_MSG_CHECKING([for gm_get()])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include<gm.h>
]],
[[gm_get(0, 0, 0, 0, 0, 0, 0, 0, 0);]])],
[HAVE_RDMA_GET=1 MSG=yes],
[HAVE_RDMA_GET=0 MSG=no])
AC_DEFINE_UNQUOTED([OMPI_MCA_]m4_translit([$1], [a-z], [A-Z])[_HAVE_RDMA_GET], $HAVE_RDMA_GET,
[Whether we have get_get() or not])
AC_MSG_RESULT([$MSG])
# Now test to see if the targetted GM is a broken one broken gm builds
AC_MSG_CHECKING([for broken GM 2.x RDMA gets build])
AC_TRY_COMPILE([
#include <gm.h>
], [
#if GM_API_VERSION_2_0 && \
((GM_API_VERSION_2_1_0 && GM_API_VERSION < 0x20102) || \
GM_API_VERSION < 0x2000c)
#error GM build is broken
#endif ],
[ mca_gm_broken=0 gm_build_broken=no ],
[ mca_gm_broken=1 gm_build_broken=yes ])
AC_MSG_RESULT( [$gm_build_broken] )
AC_DEFINE_UNQUOTED( [OMPI_MCA_]m4_translit([$1], [a-z], [A-Z])[_GET_BROKEN], $mca_gm_broken,
[The GM build has or not a broker gm_get function] )
unset gm_build_broken mca_gm_broken
AC_DEFINE_UNQUOTED( [OMPI_MCA_]m4_translit([$1], [a-z], [A-Z])[_SUPPORT_REGISTERING], 1,
[The OS support or not the virtal page registration] )
CPPFLAGS="$u_OMPI_CHECK_GM_CONFIG_SAVE_CPPFLAGS"
LDFLAGS="$u_OMPI_CHECK_GM_CONFIG_SAVE_LDFLAGS"
LIBS="$u_OMPI_CHECK_GM_CONFIG_SAVE_LIBS"
])dnl
# OMPI_CHECK_GM(prefix, [action-if-found], [action-if-not-found])
# --------------------------------------------------------
# check if GM support can be found. sets prefix_{CPPFLAGS,
# LDFLAGS, LIBS} as needed and runs action-if-found if there is
# support, otherwise executes action-if-not-found
AC_DEFUN([OMPI_CHECK_GM],[
AC_ARG_WITH([gm],
[AC_HELP_STRING([--with-gm(=DIR)],
[Build GM (Myrinet) support, searching for libraries in DIR])])
AC_ARG_WITH([gm-libdir],
[AC_HELP_STRING([--with-gm-libdir=DIR],
[Search for GM (Myrinet) libraries in DIR])])
AS_IF([test "$with_gm" != "no"],
[AS_IF([test ! -z "$with_gm" -a "$with_gm" != "yes"],
[ompi_check_gm_dir="$with_gm"])
AS_IF([test ! -z "$with_gm_libdir" -a "$with_gm_libdir" != "yes"],
[ompi_check_gm_libdir="$with_gm_libdir"])
OMPI_CHECK_PACKAGE([$1],
[gm.h],
[gm],
[gm_init],
[],
[$ompi_check_gm_dir],
[$ompi_check_gm_libdir],
[ompi_check_gm_happy="yes"],
[ompi_check_gm_happy="no"])],
[ompi_check_gm_happy="no"])
AS_IF([test "$ompi_check_gm_happy" = "yes"],
[_OMPI_CHECK_GM_CONFIG($1)
$2],
[AS_IF([test ! -z "$with_gm" -a "$with_gm" != "no"],
[AC_MSG_ERROR([GM support requested but not found. Aborting])])
$3])
])

59
config/ompi_check_icc.m4 Normal file
View File

@ -0,0 +1,59 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
AC_DEFUN([OMPI_CHECK_ICC_VARARGS],[
dnl
dnl On EM64T, icc-8.1 before version 8.1.027 segfaulted, since
dnl va_start was miscompiled...
dnl
AC_MSG_CHECKING([whether icc-8.1 for EM64T works with variable arguments])
AC_TRY_RUN([
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
void func (int c, char * f, ...)
{
va_list arglist;
va_start (arglist, f);
/* vprintf (f, arglist); */
va_end (arglist);
}
int main ()
{
FILE *f;
func (4711, "Help %d [%s]\n", 10, "ten");
f=fopen ("conftestval", "w");
if (!f) exit (1);
return 0;
}
],[ompi_ac_icc_varargs=`test -f conftestval`],[ompi_ac_icc_varargs=1],[ompi_ac_icc_varargs=1])
if test "$ompi_ac_icc_varargs" = "1"; then
AC_MSG_WARN([*** Problem running configure test!])
AC_MSG_WARN([*** Your icc-8.1 compiler seems to miscompile va_start!])
AC_MSG_WARN([*** Please upgrade compiler to at least version 8.1.027])
AC_MSG_ERROR([*** Cannot continue.])
fi
AC_MSG_RESULT([yes])
rm -rf conftest*])dnl

View File

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

View File

@ -0,0 +1,52 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# 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.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# 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
#
# $HEADER$
#
# OMPI_CHECK_LOADLEVELER(prefix, [action-if-found], [action-if-not-found])
# --------------------------------------------------------
AC_DEFUN([OMPI_CHECK_LOADLEVELER],[
AC_ARG_WITH([loadleveler],
[AC_HELP_STRING([--with-loadleveler],
[Directory where the loadleveler software is installed])])
AS_IF([test "$with_loadleveler" = "no"],
[ompi_check_loadleveler_happy="no"],
[ompi_check_loadleveler_happy="yes"
AS_IF([test ! -z "$with_loadleveler" -a "$with_loadleveler" != "yes"],
[ompi_check_loadleveler_dir="$with_loadleveler"],
[ompi_check_loadleveler_dir=""])])
AS_IF([test "$ompi_check_loadleveler_happy" = "yes"],
[OMPI_CHECK_PACKAGE([$1],
[llapi.h],
[llapi],
[ll_query],
[],
[$ompi_check_loadleveler_dir],
[],
[ompi_check_loadleveler_happy="yes"],
[ompi_check_loadleveler_happy="no"])])
AS_IF([test "$ompi_check_loadleveler_happy" = "yes"],
[$2],
[AS_IF([test ! -z "$with_loadleveler" -a "$with_loadleveler" != "no"],
[AC_MSG_ERROR([LOADLEVELER support requested but not found. Aborting])])
$3])
])

95
config/ompi_check_lsf.m4 Normal file
View File

@ -0,0 +1,95 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# 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.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# 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
#
# $HEADER$
#
# check for lsf
# OMPI_CHECK_LSF(prefix, [action-if-found], [action-if-not-found])
# --------------------------------------------------------
AC_DEFUN([OMPI_CHECK_LSF],[
AC_ARG_WITH([lsf],
[AC_HELP_STRING([--with-lsf(=DIR)],
[Build LSF support])])
AC_ARG_WITH([lsf-libdir],
[AC_HELP_STRING([--with-lsf-libdir=DIR],
[Search for LSF libraries in DIR])])
# Defaults
ompi_check_lsf_dir_msg="compiler default"
ompi_check_lsf_libdir_msg="linker default"
# Save directory names if supplied
AS_IF([test ! -z "$with_lsf" -a "$with_lsf" != "yes"],
[ompi_check_lsf_dir="$with_lsf"
ompi_check_lsf_dir_msg="$ompi_check_lsf_dir (from --with-lsf)"])
AS_IF([test ! -z "$with_lsf_libdir" -a "$with_lsf_libdir" != "yes"],
[ompi_check_lsf_libdir="$with_lsf_libdir"
ompi_check_lsf_libdir_msg="$ompi_check_lsf_libdir (from --with-lsf-libdir)"])
# If no directories were specified, look for LSF_LIBDIR,
# LSF_INCLUDEDIR, and/or LSF_ENVDIR.
AS_IF([test -z "$ompi_check_lsf_dir" -a -z "$ompi_check_lsf_libdir"],
[AS_IF([test ! -z "$LSF_ENVDIR" -a -z "$LSF_LIBDIR" -a -f "$LSF_ENVDIR/lsf.conf"],
[LSF_LIBDIR=`egrep ^LSF_LIBDIR= $LSF_ENVDIR/lsf.conf | cut -d= -f2-`])
AS_IF([test ! -z "$LSF_ENVDIR" -a -z "$LSF_INCLUDEDIR" -a -f "$LSF_ENVDIR/lsf.conf"],
[LSF_INCLUDEDIR=`egrep ^LSF_INCLUDEDIR= $LSF_ENVDIR/lsf.conf | cut -d= -f2-`])
AS_IF([test ! -z "$LSF_LIBDIR"],
[ompi_check_lsf_libdir=$LSF_LIBDIR
ompi_check_lsf_libdir_msg="$LSF_LIBDIR (from \$LSF_LIBDIR)"])
AS_IF([test ! -z "$LSF_INCLUDEDIR"],
[ompi_check_lsf_dir=`dirname $LSF_INCLUDEDIR`
ompi_check_lsf_dir_msg="$ompi_check_lsf_dir (from \$LSF_INCLUDEDIR)"])])
AS_IF([test "$with_lsf" = "no"],
[ompi_check_lsf_happy="no"],
[ompi_check_lsf_happy="yes"])
ompi_check_lsf_$1_save_CPPFLAGS="$CPPFLAGS"
ompi_check_lsf_$1_save_LDFLAGS="$LDFLAGS"
ompi_check_lsf_$1_save_LIBS="$LIBS"
AS_IF([test "$ompi_check_lsf_happy" = "yes"],
[AC_MSG_CHECKING([for LSF dir])
AC_MSG_RESULT([$ompi_check_lsf_dir_msg])
AC_MSG_CHECKING([for LSF library dir])
AC_MSG_RESULT([$ompi_check_lsf_libdir_msg])
OMPI_CHECK_PACKAGE([$1],
[lsf/lsbatch.h],
[bat],
[lsb_launch],
[-llsf],
[$ompi_check_lsf_dir],
[$ompi_check_lsf_libdir],
[ompi_check_lsf_happy="yes"],
[ompi_check_lsf_happy="no"])])
CPPFLAGS="$ompi_check_lsf_$1_save_CPPFLAGS"
LDFLAGS="$ompi_check_lsf_$1_save_LDFLAGS"
LIBS="$ompi_check_lsf_$1_save_LIBS"
# Reset for the next time we're called
ompi_check_lsf_dir=
ompi_check_lsf_libdir=
AS_IF([test "$ompi_check_lsf_happy" = "yes"],
[$2],
[AS_IF([test ! -z "$with_lsf" -a "$with_lsf" != "no"],
[AC_MSG_WARN([LSF support requested (via --with-lsf) but not found.])
AC_MSG_ERROR([Aborting.])])
$3])
])

137
config/ompi_check_mx.m4 Normal file
View File

@ -0,0 +1,137 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2004-2007 The University of Tennessee and The University
# of Tennessee Research Foundation. All rights
# reserved.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# _OMPI_CHECK_MX_MAPPER()
# ------------------------
# Check if the MX library provide the necessary functions in order to
# figure out the mapper version and MAC for each board.
AC_DEFUN([_OMPI_CHECK_MX_MAPPER],[
AC_CACHE_CHECK([for mx_open_board],
[ompi_cv_func_mx_open_board],
[AC_LINK_IFELSE([AC_LANG_PROGRAM(
[
#include <mx_extensions.h>
#include <mx_io.h>
#include <mx_internals/mx__fops.h>
], [
mx_open_board(0, NULL);
])],
[ompi_cv_func_mx_open_board="yes"],
[ompi_cv_func_mx_open_board="no"])])
AC_CACHE_CHECK([for mx__get_mapper_state],
[ompi_cv_func_mx__get_mapper_state],
[AC_LINK_IFELSE([AC_LANG_PROGRAM(
[
#include <mx_extensions.h>
#include <mx_io.h>
#include <mx_internals/mx__driver_interface.h>
], [
mx__get_mapper_state(NULL, NULL);
])],
[ompi_cv_func_mx__get_mapper_state="yes"],
[ompi_cv_func_mx__get_mapper_state="no"])])
AS_IF([test "$ompi_cv_func_mx_open_board" = "yes" -a "$ompi_cv_func_mx__get_mapper_state" = "yes"],
[mx_provide_mapper_state=1
$2],
[mx_provide_mapper_state=0
$3])
AC_DEFINE_UNQUOTED([MX_HAVE_MAPPER_STATE], [$mx_provide_mapper_state],
[MX installation provide access to the mx_open_board and mx__get_mapper_state functions])
])
# OMPI_CHECK_MX(prefix, [action-if-found], [action-if-not-found])
# --------------------------------------------------------
# check if MX support can be found. sets prefix_{CPPFLAGS,
# LDFLAGS, LIBS} as needed and runs action-if-found if there is
# support, otherwise executes action-if-not-found
AC_DEFUN([OMPI_CHECK_MX],[
AC_ARG_WITH([mx],
[AC_HELP_STRING([--with-mx(=DIR)],
[Build MX (Myrinet Express) support, searching for libraries in DIR])])
AC_ARG_WITH([mx-libdir],
[AC_HELP_STRING([--with-mx-libdir=DIR],
[Search for MX (Myrinet Express) libraries in DIR])])
ompi_check_mx_$1_save_CPPFLAGS="$CPPFLAGS"
ompi_check_mx_$1_save_LDFLAGS="$LDFLAGS"
ompi_check_mx_$1_save_LIBS="$LIBS"
AS_IF([test "$with_mx" != "no"],
[AS_IF([test ! -z "$with_mx" -a "$with_mx" != "yes"],
[ompi_check_mx_dir="$with_mx"])
AS_IF([test ! -z "$with_mx_libdir" -a "$with_mx_libdir" != "yes"],
[ompi_check_mx_libdir="$with_mx_libdir"])
OMPI_CHECK_PACKAGE([$1],
[myriexpress.h],
[myriexpress],
[mx_finalize],
[],
[$ompi_check_mx_dir],
[$ompi_check_mx_libdir],
[ompi_check_mx_happy="yes"],
[ompi_check_mx_happy="no"])],
[ompi_check_mx_happy="no"])
CPPFLAGS="$CPPFLAGS $$1_CPPFLAGS"
LDFLAGS="$LDFLAGS $$1_LDFLAGS"
LIBS="$LIBS $$1_LIBS"
# need at least version 1.0
AS_IF([test "ompi_check_mx_happy" = "yes"],
[AC_CACHE_CHECK([for MX version 1.0 or later],
[ompi_cv_mx_version_ok],
[AC_PREPROC_IFELSE(
[AC_LANG_PROGRAM([
#include <myriexpress.h>
],[
#if MX_API < 0x300
#error "Version less than 0x300"
#endif
])],
[ompi_cv_mx_version_ok="yes"],
[ompi_cv_mx_version_ok="no"])])])
AS_IF([test "$ompi_cv_mx_version_ok" = "no"], [ompi_check_mx_happy="no"])
AS_IF([test "$ompi_check_mx_happy" = "yes"],
[AC_CHECK_HEADERS([mx_extensions.h],
[AC_CHECK_FUNCS([mx_forget mx_register_unexp_handler])
_OMPI_CHECK_MX_MAPPER()],
[AC_MSG_WARN([The MX support for Open MPI will be compiled without the
MX extensions, which may result in lower performance. Please upgrade
to at least MX 1.2.0 to enable the MX extensions.])])])
CPPFLAGS="$ompi_check_mx_$1_save_CPPFLAGS"
LDFLAGS="$ompi_check_mx_$1_save_LDFLAGS"
LIBS="$ompi_check_mx_$1_save_LIBS"
AS_IF([test "$ompi_check_mx_happy" = "yes" -a "$enable_progress_threads" = "yes"],
[AC_MSG_WARN([MX driver does not currently support progress threads. Disabling BTL.])
ompi_check_mx_happy="no"])
AS_IF([test "$ompi_check_mx_happy" = "yes"],
[$2],
[AS_IF([test ! -z "$with_mx" -a "$with_mx" != "no"],
[AC_MSG_ERROR([MX support requested but not found. Aborting])])
$3])
])

231
config/ompi_check_openib.m4 Normal file
View File

@ -0,0 +1,231 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# 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.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2006-2008 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights
# reserved.
# Copyright (c) 2006-2008 Mellanox Technologies. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# OMPI_CHECK_OPENIB(prefix, [action-if-found], [action-if-not-found])
# --------------------------------------------------------
# check if OPENIB support can be found. sets prefix_{CPPFLAGS,
# LDFLAGS, LIBS} as needed and runs action-if-found if there is
# support, otherwise executes action-if-not-found
AC_DEFUN([OMPI_CHECK_OPENIB],[
OMPI_VAR_SCOPE_PUSH([$1_msg])
#
# Openfabrics support
#
AC_ARG_WITH([openib],
[AC_HELP_STRING([--with-openib(=DIR)],
[Build OpenFabrics support, searching for libraries in DIR])])
AC_ARG_WITH([openib-libdir],
[AC_HELP_STRING([--with-openib-libdir=DIR],
[Search for OpenFabrics libraries in DIR])])
#
# ConnectX XRC support
#
AC_ARG_ENABLE([connectx-xrc],
[AC_HELP_STRING([--enable-openib-connectx-xrc],
[Enable ConnectX XRC support. If you do not have InfiniBand ConnectX adapters, you may disable the ConnectX XRC support. If you do not know which InfiniBand adapter is installed on your cluster, leave this option enabled (default: enabled)])],
[enable_connectx_xrc="$enableval"], [enable_connectx_xrc="yes"])
#
# Openfabrics IBCM
#
AC_ARG_ENABLE([openib-ibcm],
[AC_HELP_STRING([--enable-openib-ibcm],
[Enable Open Fabrics IBCM support in openib BTL (default: disabled)])],
[enable_openib_ibcm="$enableval"], [enable_openib_ibcm="no"])
#
# Openfabrics RDMACM
#
AC_ARG_ENABLE([openib-rdmacm],
[AC_HELP_STRING([--enable-openib-rdmacm],
[Enable Open Fabrics RDMACM support in openib BTL (default: enabled)])],
[enable_openib_rdmacm="$enableval"], [enable_openib_rdmacm="yes"])
AS_IF([test ! -z "$with_openib" -a "$with_openib" != "yes"],
[ompi_check_openib_dir="$with_openib"])
AS_IF([test ! -z "$with_openib_libdir" -a "$with_openib_libdir" != "yes"],
[ompi_check_openib_libdir="$with_openib_libdir"])
AS_IF([test "$with_openib" = "no"],
[ompi_check_openib_happy="no"],
[ompi_check_openib_happy="yes"])
ompi_check_openib_$1_save_CPPFLAGS="$CPPFLAGS"
ompi_check_openib_$1_save_LDFLAGS="$LDFLAGS"
ompi_check_openib_$1_save_LIBS="$LIBS"
AS_IF([test "$ompi_check_openib_happy" = "yes"],
[AS_IF([test "$THREAD_TYPE" != "posix" -a "$memory_ptmalloc2_happy" = "yes"],
[AS_IF([test "$enable_ptmalloc2_internal" = "yes"],
[AC_MSG_WARN([POSIX threads are disabled, but])
AC_MSG_WARN([--enable-ptmalloc2-internal was specified. This will])
AC_MSG_WARN([cause memory corruption with OpenFabrics.])
AC_MSG_WARN([Not building component.])
ompi_check_openib_happy="no"],
[AC_MSG_WARN([POSIX threads are disabled, but the ptmalloc2 memory])
AC_MSG_WARN([manager is being built. Compiling MPI applications with])
AC_MSG_WARN([-lopenmpi-malloc will result in memory corruption; Open])
AC_MSG_WARN([MPI will disable the openib BTL at run-time if such a])
AC_MSG_WARN([combination is detected.])
AC_MSG_WARN([You have been warned.])])])])
AS_IF([test "$ompi_check_openib_happy" = "yes"],
[AC_CHECK_HEADERS(
fcntl.h sys/poll.h,
[],
[AC_MSG_WARN([fcntl.h sys/poll.h not found. Can not build component.])
ompi_check_openib_happy="no"])])
AS_IF([test "$ompi_check_openib_happy" = "yes"],
[OMPI_CHECK_PACKAGE([$1],
[infiniband/verbs.h],
[ibverbs],
[ibv_open_device],
[],
[$ompi_check_openib_dir],
[$ompi_check_openib_libdir],
[ompi_check_openib_happy="yes"],
[ompi_check_openib_happy="no"])])
CPPFLAGS="$CPPFLAGS $$1_CPPFLAGS"
LDFLAGS="$LDFLAGS $$1_LDFLAGS"
LIBS="$LIBS $$1_LIBS"
AS_IF([test "$ompi_check_openib_happy" = "yes"],
[AC_CACHE_CHECK(
[number of arguments to ibv_create_cq],
[ompi_cv_func_ibv_create_cq_args],
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <infiniband/verbs.h> ]],
[[ibv_create_cq(NULL, 0, NULL, NULL, 0);]])],
[ompi_cv_func_ibv_create_cq_args=5],
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <infiniband/verbs.h> ]],
[[ibv_create_cq(NULL, 0, NULL);]])],
[ompi_cv_func_ibv_create_cq_args=3],
[ompi_cv_func_ibv_create_cq_args="unknown"])])])
AS_IF([test "$ompi_cv_func_ibv_create_cq_args" = "unknown"],
[AC_MSG_WARN([Can not determine number of args to ibv_create_cq.])
AC_MSG_WARN([Not building component.])
ompi_check_openib_happy="no"],
[AC_DEFINE_UNQUOTED([OMPI_IBV_CREATE_CQ_ARGS],
[$ompi_cv_func_ibv_create_cq_args],
[Number of arguments to ibv_create_cq])])])
# Set these up so that we can do an AC_DEFINE below
# (unconditionally)
$1_have_xrc=0
$1_have_rdmacm=0
$1_have_ibcm=0
# If we have the openib stuff available, find out what we've got
AS_IF([test "$ompi_check_openib_happy" = "yes"],
[AC_CHECK_DECLS([IBV_EVENT_CLIENT_REREGISTER], [], [],
[#include <infiniband/verbs.h>])
AC_CHECK_FUNCS([ibv_get_device_list ibv_resize_cq])
# struct ibv_device.transport_type was added in OFED v1.2
AC_CHECK_MEMBERS([struct ibv_device.transport_type], [], [],
[#include <infiniband/verbs.h>])
# ibv_create_xrc_rcv_qp was added in OFED 1.3
if test "$enable_connectx_xrc" = "yes"; then
AC_CHECK_FUNCS([ibv_create_xrc_rcv_qp], [$1_have_xrc=1])
fi
# Do we have a recent enough RDMA CM? Need to have the
# rdma_get_peer_addr (inline) function (originally appeared
# in OFED v1.3).
if test "$enable_openib_rdmacm" = "yes"; then
AC_CHECK_HEADERS([rdma/rdma_cma.h],
[AC_CHECK_LIB([rdmacm], [rdma_create_id],
[AC_MSG_CHECKING([for rdma_get_peer_addr])
$1_msg=no
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "rdma/rdma_cma.h"
]], [[void *ret = (void*) rdma_get_peer_addr((struct rdma_cm_id*)0);]])],
[$1_have_rdmacm=1
$1_msg=yes])
AC_MSG_RESULT([$$1_msg])])])
if test "1" = "$$1_have_rdmacm"; then
$1_LIBS="-lrdmacm $$1_LIBS"
fi
fi
# Do we have IB CM? (note that OFED IB CM depends on RDMA
# CM, so no need to add it into the other-libraries
# argument to AC_CHECK_ LIB). Note that we only want IBCM
# starting with OFED 1.2 or so, so check for
# ib_cm_open_device (introduced in libibcm 1.0/OFED 1.2).
if test "$enable_openib_ibcm" = "yes"; then
AC_CHECK_HEADERS([infiniband/cm.h],
[AC_CHECK_LIB([ibcm], [ib_cm_open_device],
[$1_have_ibcm=1
$1_LIBS="-libcm $$1_LIBS"])])
fi
])
AC_MSG_CHECKING([if ConnectX XRC support is enabled])
AC_DEFINE_UNQUOTED([OMPI_HAVE_CONNECTX_XRC], [$$1_have_xrc],
[Enable features required for ConnectX XRC support])
if test "1" = "$$1_have_xrc"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([if OpenFabrics RDMACM support is enabled])
AC_DEFINE_UNQUOTED([OMPI_HAVE_RDMACM], [$$1_have_rdmacm],
[Whether RDMA CM is available or not])
if test "1" = "$$1_have_rdmacm"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([if OpenFabrics IBCM support is enabled])
AC_DEFINE_UNQUOTED([OMPI_HAVE_IBCM], [$$1_have_ibcm],
[Whether IB CM is available or not])
if test "1" = "$$1_have_ibcm"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
CPPFLAGS="$ompi_check_openib_$1_save_CPPFLAGS"
LDFLAGS="$ompi_check_openib_$1_save_LDFLAGS"
LIBS="$ompi_check_openib_$1_save_LIBS"
AS_IF([test "$ompi_check_openib_happy" = "yes"],
[$2],
[AS_IF([test ! -z "$with_openib" -a "$with_openib" != "no"],
[AC_MSG_WARN([OpenFabrics support requested (via --with-openib) but not found.])
AC_MSG_WARN([If you are using libibverbs v1.0 (i.e., OFED v1.0 or v1.1), you *MUST* have both the libsysfs headers and libraries installed. Later versions of libibverbs do not require libsysfs.])
AC_MSG_ERROR([Aborting.])])
$3])
OMPI_VAR_SCOPE_POP
])

View File

@ -0,0 +1,63 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2007-2008 Sun Microsystems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
AC_DEFUN([OMPI_CHECK_OPTFLAGS],[
# Modularize this setup so that sub-configure.in scripts can use this
# same setup code.
##################################
# Optimization flags
##################################
# If the user did not specify optimization flags, add some (the value
# from $OPTFLAGS)
co_arg="$1"
co_found=0
for co_word in $co_arg; do
case $co_word in
-g) co_found=1 ;;
-g[1-3]) co_found=1 ;;
+K[0-5]) co_found=1 ;;
-O) co_found=1 ;;
-O[0-9]) co_found=1 ;;
-xO) co_found=1 ;;
-xO[0-9]) co_found=1 ;;
-fast) co_found=1 ;;
# The below Sun Studio flags require or
# trigger -xO optimization
-xvector*) co_found=1 ;;
-xdepend=yes) co_found=1 ;;
esac
done
if test "$co_found" = "0"; then
co_result="$OPTFLAGS $co_arg"
else
co_result="$co_arg"
fi
# Clean up
unset co_found co_word co_arg
])

View File

@ -0,0 +1,170 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# 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.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# _OMPI_CHECK_PACKAGE_HEADER(prefix, header, dir-prefix,
# [action-if-found], [action-if-not-found])
# --------------------------------------------------------------------
AC_DEFUN([_OMPI_CHECK_PACKAGE_HEADER], [
# This is stolen from autoconf to peek under the covers to get the
# cache variable for the library check. one should not copy this
# code into other places unless you want much pain and suffering
AS_VAR_PUSHDEF([ompi_Header], [ac_cv_header_$2])
# so this sucks, but there's no way to get through the progression
# of header includes without killing off the cache variable and trying
# again...
unset ompi_Header
ompi_check_package_header_happy="no"
AS_IF([test "$3" = "/usr" -o "$3" = "/usr/local"],
[ # try as is...
AC_VERBOSE([looking for header without includes])
AC_CHECK_HEADER([$2], [ompi_check_package_header_happy="yes"],
[ompi_check_package_header_happy="no"])
AS_IF([test "$ompi_check_package_header_happy" = "no"],
[# no go on the as is - reset the cache and try again
unset ompi_Header])])
AS_IF([test "$ompi_check_package_header_happy" = "no"],
[AS_IF([test "$3" != ""],
[$1_CPPFLAGS="$$1_CPPFLAGS -I$3/include"
CPPFLAGS="$CPPFLAGS -I$3/include"])
AC_CHECK_HEADER([$2], [$4], [$5])],
[$4])
unset ompi_check_package_header_happy])
dnl AS_VAR_POPDEF([ompi_Header])dnl
])
# _OMPI_CHECK_PACKAGE_LIB(prefix, library, function, extra-libraries,
# dir-prefix, libdir,
# [action-if-found], [action-if-not-found]])
# --------------------------------------------------------------------
AC_DEFUN([_OMPI_CHECK_PACKAGE_LIB], [
# This is stolen from autoconf to peek under the covers to get the
# cache variable for the library check. one should not copy this
# code into other places unless you want much pain and suffering
AS_LITERAL_IF([$2],
[AS_VAR_PUSHDEF([ompi_Lib], [ac_cv_lib_$2_$3])],
[AS_VAR_PUSHDEF([ompi_Lib], [ac_cv_lib_$2''_$3])])dnl
# see comment above
unset ompi_Lib
ompi_check_package_lib_happy="no"
AS_IF([test "$6" != ""],
[ # libdir was specified - search only there
$1_LDFLAGS="$$1_LDFLAGS -L$6"
LDFLAGS="$LDFLAGS -L$6"
AC_CHECK_LIB([$2], [$3],
[ompi_check_package_lib_happy="yes"],
[ompi_check_package_lib_happy="no"], [$4])
AS_IF([test "$ompi_check_package_lib_happy" = "no"],
[LDFLAGS="$ompi_check_package_$1_save_LDFLAGS"
$1_LDFLAGS="$ompi_check_package_$1_orig_LDFLAGS"
unset ompi_Lib])],
[ # libdir was not specified - go through search path
ompi_check_package_libdir="$5"
AS_IF([test "$ompi_check_package_libdir" = "" -o "$ompi_check_package_libdir" = "/usr" -o "$ompi_check_package_libdir" = "/usr/local"],
[ # try as is...
AC_VERBOSE([looking for library without search path])
AC_CHECK_LIB([$2], [$3],
[ompi_check_package_lib_happy="yes"],
[ompi_check_package_lib_happy="no"], [$4])
AS_IF([test "$ompi_check_package_lib_happy" = "no"],
[ # no go on the as is.. see what happens later...
LDFLAGS="$ompi_check_package_$1_save_LDFLAGS"
$1_LDFLAGS="$ompi_check_package_$1_orig_LDFLAGS"
unset ompi_Lib])])
AS_IF([test "$ompi_check_package_lib_happy" = "no"],
[AS_IF([test "$ompi_check_package_libdir" != ""],
[$1_LDFLAGS="$$1_LDFLAGS -L$ompi_check_package_libdir/lib"
LDFLAGS="$LDFLAGS -L$ompi_check_package_libdir/lib"
AC_VERBOSE([looking for library in lib])
AC_CHECK_LIB([$2], [$3],
[ompi_check_package_lib_happy="yes"],
[ompi_check_package_lib_happy="no"], [$4])
AS_IF([test "$ompi_check_package_lib_happy" = "no"],
[ # no go on the as is.. see what happens later...
LDFLAGS="$ompi_check_package_$1_save_LDFLAGS"
$1_LDFLAGS="$ompi_check_package_$1_orig_LDFLAGS"
unset ompi_Lib])])])
AS_IF([test "$ompi_check_package_lib_happy" = "no"],
[AS_IF([test "$ompi_check_package_libdir" != ""],
[$1_LDFLAGS="$$1_LDFLAGS -L$ompi_check_package_libdir/lib64"
LDFLAGS="$LDFLAGS -L$ompi_check_package_libdir/lib64"
AC_VERBOSE([looking for library in lib64])
AC_CHECK_LIB([$2], [$3],
[ompi_check_package_lib_happy="yes"],
[ompi_check_package_lib_happy="no"], [$4])
AS_IF([test "$ompi_check_package_lib_happy" = "no"],
[ # no go on the as is.. see what happens later...
LDFLAGS="$ompi_check_package_$1_save_LDFLAGS"
$1_LDFLAGS="$ompi_check_package_$1_orig_LDFLAGS"
unset ompi_Lib])])])])
AS_IF([test "$ompi_check_package_lib_happy" = "yes"],
[$1_LIBS="-l$2 $4"
$7], [$8])
AS_VAR_POPDEF([ompi_Lib])dnl
])
# OMPI_CHECK_PACKAGE(prefix,
# header,
# library,
# function,
# extra-libraries,
# dir-prefix,
# libdir-prefix,
# [action-if-found], [action-if-not-found]
# -----------------------------------------------------------
# check for package defined by header and libs, and probably
# located in dir-prefix, possibly with libs in libdir-prefix.
# Both dir-prefix and libdir-prefix can be empty. Will set
# prefix_{CPPFLAGS, LDFLAGS, LIBS} as needed
AC_DEFUN([OMPI_CHECK_PACKAGE],[
ompi_check_package_$1_save_CPPFLAGS="$CPPFLAGS"
ompi_check_package_$1_save_LDFLAGS="$LDFLAGS"
ompi_check_package_$1_save_LIBS="$LIBS"
ompi_check_package_$1_orig_CPPFLAGS="$$1_CPPFLAGS"
ompi_check_package_$1_orig_LDFLAGS="$$1_LDFLAGS"
ompi_check_package_$1_orig_LIBS="$$1_LIBS"
_OMPI_CHECK_PACKAGE_HEADER([$1], [$2], [$6],
[_OMPI_CHECK_PACKAGE_LIB([$1], [$3], [$4], [$5], [$6], [$7],
[ompi_check_package_happy="yes"],
[ompi_check_package_happy="no"])],
[ompi_check_package_happy="no"])
AS_IF([test "$ompi_check_package_happy" = "yes"],
[$8],
[$1_CPPFLAGS="$ompi_check_package_$1_orig_CPPFLAGS"
$1_LDFLAGS="$ompi_check_package_$1_orig_LDFLAGS"
$1_LIBS="$ompi_check_package_$1_orig_LIBS"
$9])
CPPFLAGS="$ompi_check_package_$1_save_CPPFLAGS"
LDFLAGS="$ompi_check_package_$1_save_LDFLAGS"
LIBS="$ompi_check_package_$1_save_LIBS"
])

View File

@ -0,0 +1,156 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# 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.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2006 The Regents of the University of California.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# OMPI_CHECK_PORTALS(prefix, [action-if-found], [action-if-not-found])
# --------------------------------------------------------
# check if PORTALS support can be found. sets prefix_{CPPFLAGS,
# LDFLAGS, LIBS} as needed and runs action-if-found if there is
# support, otherwise executes action-if-not-found
AC_DEFUN([OMPI_CHECK_PORTALS],[
# save compiler flags so that we don't alter them for later
# components.
check_portals_save_CPPFLAGS="$CPPFLAGS"
check_portals_save_LDFLAGS="$LDFLAGS"
check_portals_save_LIBS="$LIBS"
check_portals_CPPFLAGS=
check_portals_LDFLAGS=
check_portals_LIBS=
check_portals_configuration="none"
ompi_check_portals_happy="yes"
# Get some configuration information
AC_ARG_WITH([portals],
[AC_HELP_STRING([--with-portals(=DIR)],
[Build Portals support, searching for installation in DIR])])
AC_ARG_WITH([portals-config],
AC_HELP_STRING([--with-portals-config],
[configuration to use for Portals support.
One of "utcp", "xt3", "xt3-modex". (default: utcp)]))
AC_ARG_WITH([portals-libs],
[AC_HELP_STRING([--with-portals-libs=LIBS],
[Libraries to link with for portals])])
AC_MSG_CHECKING([for Portals configuration])
if test "$with_portals_config" = "" ; then
with_portals_config="utcp"
elif test "$with_portals_config" = "redstorm" ; then
with_portals_config="xt3"
elif test "$with_portals_config" = "cnl_modex" ; then
with_portals_config="xt3-modex"
fi
OMPI_PORTALS_UTCP=0
OMPI_PORTALS_CRAYXT3=0
OMPI_PORTALS_CRAYXT3_MODEX=0
case "$with_portals_config" in
"utcp")
OMPI_PORTALS_UTCP=1
OMPI_PORTALS_HAVE_EVENT_UNLINK=1
check_portals_LIBS="-lp3utcp -lp3api -lp3lib -lp3rt -lp3utcp"
check_portals_header_prefix=
AC_MSG_RESULT([utcp])
;;
"xt3")
OMPI_PORTALS_CRAYXT3=1
OMPI_PORTALS_HAVE_EVENT_UNLINK=0
check_portals_LIBS=
check_portals_header_prefix="portals/"
AC_MSG_RESULT([Cray XT3])
;;
"xt3-modex")
OMPI_PORTALS_CRAYXT3_MODEX=1
OMPI_PORTALS_HAVE_EVENT_UNLINK=0
check_portals_LIBS=
check_portals_header_prefix="portals/"
AC_MSG_RESULT([Cray XT3 - Modex])
;;
*)
# ok to call ERROR here - the user specified something invalid.
# that should be brought to his attention
AC_MSG_ERROR([unknown Portals configuration. Can not continue])
;;
esac
AC_DEFINE_UNQUOTED([OMPI_PORTALS_HAVE_EVENT_UNLINK],
[$OMPI_PORTALS_HAVE_EVENT_UNLINK],
[Does Portals send a PTL_EVENT_UNLINK event])
AC_DEFINE_UNQUOTED([OMPI_PORTALS_UTCP], [$OMPI_PORTALS_UTCP],
[Use the UTCP reference implementation of Portals])
AC_DEFINE_UNQUOTED([OMPI_PORTALS_CRAYXT3], [$OMPI_PORTALS_CRAYXT3],
[Use the Cray XT-3 implementation of Portals])
AC_DEFINE_UNQUOTED([OMPI_PORTALS_CRAYXT3_MODEX], [$OMPI_PORTALS_CRAYXT3_MODEX],
[Use the Cray XT-3 implementation of Portals using Modex])
# Add correct -I and -L flags
AS_IF([test -n "$with_portals"],
[AS_IF([test -d "$with_portals/include"],
[check_portals_CPPFLAGS="-I$with_portals/include"
CPPFLAGS="$CPPFLAGS $check_portals_CPPFLAGS"], [])
AS_IF([test -d "$with_portals/lib"],
[check_portals_LDFLAGS="-L$with_portals/lib"
LDFLAGS="$LDFLAGS $check_portals_LDFLAGS"], [])])
# Try to find all the portals libraries (this is not fun!)
if test -n "$with_portals_libs" ; then
check_portals_LIBS=""
for lib in $with_portals_libs ; do
check_portals_LIBS="$check_portals_LIBS -l$lib"
done
fi
# check for portals
LIBS="$LIBS $check_portals_LIBS"
AC_CHECK_HEADERS([${check_portals_header_prefix}portals3.h],
[AC_MSG_CHECKING([if possible to link Portals application])
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <${check_portals_header_prefix}portals3.h>],
[int i; PtlInit(&i);])],
[AC_MSG_RESULT([yes])
ompi_check_portals_happy="yes"],
[AC_MSG_RESULT([no])
ompi_check_portals_happy="no"])],
[ompi_check_portals_happy="no"])
# Deal with static-only Portals UTCP libs. See note in
# ompi/mca/common/portals/configure.m4. Then possibly cry.
if test "$with_portals_config" = "utcp" ; then
if test "$1" != "common_portals" ; then
check_portals_LIBS=
fi
fi
# reset the flags for the next test
CPPFLAGS="$check_portals_save_CPPFLAGS"
LDFLAGS="$check_portals_save_LDFLAGS"
LIBS="$check_portals_save_LIBS"
$1_CPPFLAGS="$check_portals_CPPFLAGS"
$1_LDFLAGS="$check_portals_LDFLAGS"
$1_LIBS="$check_portals_LIBS"
AS_IF([test "$ompi_check_portals_happy" = "yes"],
[$2],
[AS_IF([test ! -z "$with_portals" -a "$with_portals" != "no"],
[AC_MSG_ERROR([Portals support requested but not found. Aborting])])
$3])
])

42
config/ompi_check_ps.m4 Normal file
View File

@ -0,0 +1,42 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
dnl Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# See if there is a ps command that will produce the output we are
# interested in. If so, then save it away. Otherwise, the string is
# set to unknown.
AC_DEFUN([OMPI_PS_FLAVOR_CHECK],[
AC_MSG_CHECKING([for flavor of ps to use])
PS_FLAVOR="unknown"
ps -A -o fname > /dev/null 2>&1
if test "$?" = "0"; then
PS_FLAVOR="ps -A -o fname,pid,user"
else
ps -A -o command > /dev/null 2>&1
if test "$?" = "0"; then
PS_FLAVOR="ps -A -o command,pid,user"
fi
fi
AC_MSG_RESULT([$PS_FLAVOR])
AC_DEFINE_UNQUOTED([ORTE_CLEAN_PS_CMD], ["$PS_FLAVOR"], [Specific ps command to use in orte-clean])
])

70
config/ompi_check_psm.m4 Normal file
View File

@ -0,0 +1,70 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# 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.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2006 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2006 QLogic Corp. All rights reserved.
#
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# OMPI_CHECK_PSM(prefix, [action-if-found], [action-if-not-found])
# --------------------------------------------------------
# check if PSM support can be found. sets prefix_{CPPFLAGS,
# LDFLAGS, LIBS} as needed and runs action-if-found if there is
# support, otherwise executes action-if-not-found
AC_DEFUN([OMPI_CHECK_PSM],[
AC_ARG_WITH([psm],
[AC_HELP_STRING([--with-psm(=DIR)],
[Build PSM (QLogic InfiniPath PSM) support, searching for libraries in DIR])])
AC_ARG_WITH([psm-libdir],
[AC_HELP_STRING([--with-psm-libdir=DIR],
[Search for PSM (QLogic InfiniPath PSM) libraries in DIR])])
ompi_check_psm_$1_save_CPPFLAGS="$CPPFLAGS"
ompi_check_psm_$1_save_LDFLAGS="$LDFLAGS"
ompi_check_psm_$1_save_LIBS="$LIBS"
AS_IF([test "$with_psm" != "no"],
[AS_IF([test ! -z "$with_psm" -a "$with_psm" != "yes"],
[ompi_check_psm_dir="$with_psm"])
AS_IF([test ! -z "$with_psm_libdir" -a "$with_psm_libdir" != "yes"],
[ompi_check_psm_libdir="$with_psm_libdir"])
OMPI_CHECK_PACKAGE([$1],
[psm.h],
[psm_infinipath],
[psm_finalize],
[],
[$ompi_check_psm_dir],
[$ompi_check_psm_libdir],
[ompi_check_psm_happy="yes"],
[ompi_check_psm_happy="no"])],
[ompi_check_psm_happy="no"])
CPPFLAGS="$ompi_check_psm_$1_save_CPPFLAGS"
LDFLAGS="$ompi_check_psm_$1_save_LDFLAGS"
LIBS="$ompi_check_psm_$1_save_LIBS"
AS_IF([test "$ompi_check_psm_happy" = "yes" -a "$enable_progress_threads" = "yes"],
[AC_MSG_WARN([PSM driver does not currently support progress threads. Disabling BTL.])
ompi_check_psm_happy="no"])
AS_IF([test "$ompi_check_psm_happy" = "yes"],
[$2],
[AS_IF([test ! -z "$with_psm" -a "$with_psm" != "no"],
[AC_MSG_ERROR([PSM support requested but not found. Aborting])])
$3])
])

View File

@ -0,0 +1,90 @@
dnl
dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
AC_DEFUN([OMPI_CHECK_PTHREAD_PIDS],[
#
# Arguments: none
#
# Dependencies: None
#
# Sets:
# OMPI_THREADS_HAVE_DIFFERENT_PIDS (variable)
#
# Test for Linux-like threads in the system. We will need to handle things like
# getpid() differently in the case of a Linux-like threads model.
#
AC_MSG_CHECKING([if threads have different pids (pthreads on linux)])
CFLAGS_save="$CFLAGS"
CFLAGS="$CFLAGS $THREAD_CFLAGS"
CPPFLAGS_save="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS"
LDFLAGS_save="$LDFLAGS"
LDFLAGS="$LDFLAGS $THREAD_LDFLAGS"
LIBS_save="$LIBS"
LIBS="$LIBS $THREAD_LIBS"
AC_TRY_RUN([#include <pthread.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
void *checkpid(void *arg);
int main() {
pthread_t thr;
int pid, *retval;
pid = getpid();
pthread_create(&thr, NULL, checkpid, &pid);
pthread_join(thr, (void **) &retval);
exit(*retval);
}
static int ret;
void *checkpid(void *arg) {
int ppid = *((int *) arg);
if (ppid == getpid())
ret = 0;
else
ret = 1;
pthread_exit((void *) &ret);
}],
[MSG=no OMPI_THREADS_HAVE_DIFFERENT_PIDS=0],
[MSG=yes OMPI_THREADS_HAVE_DIFFERENT_PIDS=1],
[case $host in
*-linux*)
MSG="cross compiling - assuming yes"
OMPI_THREADS_HAVE_DIFFERENT_PIDS=1
;;
*)
MSG="cross compiling - assuming no"
OMPI_THREADS_HAVE_DIFFERENT_PIDS=0
;;
esac
])
CFLAGS="$CFLAGS_save"
CPPFLAGS="$CPPFLAGS_save"
LDFLAGS="$LDFLAGS_save"
LIBS="$LIBS_save"
AC_MSG_RESULT([$MSG])
AC_DEFINE_UNQUOTED(OMPI_THREADS_HAVE_DIFFERENT_PIDS, $OMPI_THREADS_HAVE_DIFFERENT_PIDS)
#
# if pthreads is not available, then the system does not have an insane threads
# model
#
unset MSG])dnl

53
config/ompi_check_sge.m4 Normal file
View File

@ -0,0 +1,53 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# 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.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2006-2007 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# 1. if --with-sge is given, always build
# 2. if --without-sge is given, never build
# 3. if neither is given, build if-and-only-if you find either qrsh in path or
# sge_root in environment
# OMPI_CHECK_GRIDENGINE(prefix, [action-if-found], [action-if-not-found])
# --------------------------------------------------------
AC_DEFUN([OMPI_CHECK_GRIDENGINE],[
AC_ARG_WITH([sge],
[AC_HELP_STRING([--with-sge],
[Build SGE or Grid Engine support (default: no)])])
AC_MSG_CHECKING([if user requested SGE build])
ompi_gridengine_build=
AS_IF([test "$with_sge" = "yes"],
[AC_MSG_RESULT([yes])
ompi_gridengine_build=yes],
[AS_IF([test "$with_sge" = "no"],
[AC_MSG_RESULT([no])],
[AC_MSG_RESULT([not specified; checking environment])
AC_CHECK_PROG([QRSH], [qrsh], [qrsh])
AS_IF([test "$QRSH" != ""],
[ompi_gridengine_build=yes],
[AC_MSG_CHECKING([for SGE_ROOT environment variable])
AS_IF([test "$SGE_ROOT" != ""],
[AC_MSG_RESULT([found])
ompi_gridengine_build=yes],
[AC_MSG_RESULT([not found])])])])])
AS_IF([test "$ompi_gridengine_build" = "yes"],
[$2],
[$3])
])

View File

@ -0,0 +1,71 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# 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.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# OMPI_CHECK_SLURM(prefix, [action-if-found], [action-if-not-found])
# --------------------------------------------------------
AC_DEFUN([OMPI_CHECK_SLURM],[
AC_ARG_WITH([slurm],
[AC_HELP_STRING([--with-slurm],
[Build SLURM scheduler component (default: yes)])])
if test "$with_slurm" = "no" ; then
ompi_check_slurm_happy="no"
elif test "$with_slurm" = "" ; then
# unless user asked, only build slurm component on linux, AIX,
# and OS X systems (these are the platforms that SLURM
# supports)
case $host in
*-linux*|*-aix*|*-apple-darwin*)
ompi_check_slurm_happy="yes"
;;
*)
AC_MSG_CHECKING([for SLURM srun in PATH])
OMPI_WHICH([srun], [OMPI_CHECK_SLURM_SRUN])
if test "$OMPI_CHECK_SLURM_SRUN" = ""; then
ompi_check_slurm_happy="no"
else
ompi_check_slurm_happy="yes"
fi
AC_MSG_RESULT([$ompi_check_slurm_happy])
;;
esac
else
ompi_check_slurm_happy="yes"
fi
AS_IF([test "$ompi_check_slurm_happy" = "yes"],
[AC_CHECK_FUNC([fork],
[ompi_check_slurm_happy="yes"],
[ompi_check_slurm_happy="no"])])
AS_IF([test "$ompi_check_slurm_happy" = "yes"],
[AC_CHECK_FUNC([execve],
[ompi_check_slurm_happy="yes"],
[ompi_check_slurm_happy="no"])])
AS_IF([test "$ompi_check_slurm_happy" = "yes"],
[AC_CHECK_FUNC([setpgid],
[ompi_check_slurm_happy="yes"],
[ompi_check_slurm_happy="no"])])
AS_IF([test "$ompi_check_slurm_happy" = "yes"],
[$2],
[$3])
])

144
config/ompi_check_tm.m4 Normal file
View File

@ -0,0 +1,144 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# 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.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2006-2007 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# OMPI_CHECK_TM_LIBS_FLAGS(prefix, [LIBS or LDFLAGS])
# ---------------------------------------------------
AC_DEFUN([OMPI_CHECK_TM_LIBS_FLAGS],[
ompi_check_tm_flags=`$ompi_check_tm_pbs_config --libs`
for ompi_check_tm_val in $ompi_check_tm_flags; do
if test "`echo $ompi_check_tm_val | cut -c1-2`" = "-l"; then
if test "$2" = "LIBS"; then
$1_$2="$$1_$2 $ompi_check_tm_val"
fi
else
if test "$2" = "LDFLAGS"; then
$1_$2="$$1_$2 $ompi_check_tm_val"
fi
fi
done
])
# OMPI_CHECK_TM(prefix, [action-if-found], [action-if-not-found])
# --------------------------------------------------------
AC_DEFUN([OMPI_CHECK_TM],[
AC_ARG_WITH([tm],
[AC_HELP_STRING([--with-tm],
[Directory where the tm software is installed])])
ompi_check_tm_found=no
AS_IF([test "$with_tm" = "no"],
[ompi_check_tm_happy="no"],
[ompi_check_tm_happy="yes"
AS_IF([test ! -z "$with_tm" -a "$with_tm" != "yes"],
[ompi_check_tm_dir="$with_tm"],
[ompi_check_tm_dir=""])])
AS_IF([test "$ompi_check_tm_happy" = "yes"],
[AC_MSG_CHECKING([for pbs-config])
ompi_check_tm_pbs_config="not found"
AS_IF([test "$ompi_check_tm_dir" != "" -a -d "$ompi_check_tm_dir" -a -x "$ompi_check_tm_dir/bin/pbs-config"],
[ompi_check_tm_pbs_config="$ompi_check_tm_dir/bin/pbs-config"],
[AS_IF([pbs-config --prefix >/dev/null 2>&1],
[ompi_check_tm_pbs_config="pbs-config"])])
AC_MSG_RESULT([$ompi_check_tm_pbs_config])])
# If we have pbs-config, get the flags we need from there and then
# do simplistic tests looking for the tm headers and symbols
AS_IF([test "$ompi_check_tm_happy" = "yes" -a "$ompi_check_tm_pbs_config" != "not found"],
[$1_CPPFLAGS=`$ompi_check_tm_pbs_config --cflags`
OMPI_LOG_MSG([$1_CPPFLAGS from pbs-config: $$1_CPPFLAGS], 1)
OMPI_CHECK_TM_LIBS_FLAGS([$1], [LDFLAGS])
OMPI_LOG_MSG([$1_LDFLAGS from pbs-config: $$1_LDFLAGS], 1)
OMPI_CHECK_TM_LIBS_FLAGS([$1], [LIBS])
OMPI_LOG_MSG([$1_LIBS from pbs-config: $$1_LIBS], 1)
# Now that we supposedly have the right flags, try them out.
CPPFLAGS_save="$CPPFLAGS"
LDFLAGS_save="$LDFLAGS"
LIBS_save="$LIBS"
CPPFLAGS="$CPPFLAGS $$1_CPPFLAGS"
LIBS="$LIBS $$1_LIBS"
LDFLAGS="$LDFLAGS $$1_LDFLAGS"
AC_CHECK_HEADER([tm.h],
[AC_CHECK_FUNC([tm_finalize],
[ompi_check_tm_found="yes"])])
CPPFLAGS="$CPPFLAGS_save"
LDFLAGS="$LDFLAGS_save"
LIBS="$LIBS_save"])
# If we don't have pbs-config, then we have to look around
# manually.
# Note that Torque 2.1.0 changed the name of their back-end
# library to "libtorque". So we have to check for both libpbs and
# libtorque. First, check for libpbs.
ompi_check_package_$1_save_CPPFLAGS="$CPPFLAGS"
ompi_check_package_$1_save_LDFLAGS="$LDFLAGS"
ompi_check_package_$1_save_LIBS="$LIBS"
ompi_check_package_$1_orig_CPPFLAGS="$$1_CPPFLAGS"
ompi_check_package_$1_orig_LDFLAGS="$$1_LDFLAGS"
ompi_check_package_$1_orig_LIBS="$$1_LIBS"
AS_IF([test "$ompi_check_tm_found" = "no"],
[AS_IF([test "$ompi_check_tm_happy" = "yes"],
[_OMPI_CHECK_PACKAGE_HEADER([$1],
[tm.h],
[$ompi_check_tm_dir],
[ompi_check_tm_found="yes"],
[ompi_check_tm_found="no"])])
AS_IF([test "$ompi_check_tm_found" = "yes"],
[_OMPI_CHECK_PACKAGE_LIB([$1],
[pbs],
[tm_init],
[],
[$ompi_check_tm_dir],
[$ompi_check_tm_libdir],
[ompi_check_tm_found="yes"],
[_OMPI_CHECK_PACKAGE_LIB([$1],
[torque],
[tm_init],
[],
[$ompi_check_tm_dir],
[$ompi_check_tm_libdir],
[ompi_check_tm_found="yes"],
[ompi_check_tm_found="no"])])])])
CPPFLAGS="$ompi_check_package_$1_save_CPPFLAGS"
LDFLAGS="$ompi_check_package_$1_save_LDFLAGS"
LIBS="$ompi_check_package_$1_save_LIBS"
# Did we find the right stuff?
AS_IF([test "$ompi_check_tm_happy" = "yes" -a "$ompi_check_tm_found" = "yes"],
[$2],
[AS_IF([test ! -z "$with_tm" -a "$with_tm" != "no"],
[AC_MSG_ERROR([TM support requested but not found. Aborting])])
$3])
])

117
config/ompi_check_udapl.m4 Normal file
View File

@ -0,0 +1,117 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# 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.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# OMPI_CHECK_UDAPL(prefix, [action-if-found], [action-if-not-found])
# --------------------------------------------------------
# check if uDAPL support can be found. sets prefix_{CPPFLAGS,
# LDFLAGS, LIBS} as needed and runs action-if-found if there is
# support, otherwise executes action-if-not-found
AC_DEFUN([OMPI_CHECK_UDAPL],[
AC_ARG_WITH([udapl],
[AC_HELP_STRING([--with-udapl(=DIR)],
[Build uDAPL support, searching for libraries in DIR])])
AC_ARG_WITH([udapl-libdir],
[AC_HELP_STRING([--with-udapl-libdir=DIR],
[Search for uDAPL libraries in DIR])])
# Special case for OFED/Linux: the default /etc/dat.conf that
# ships with OFED is broken in that it includes DAT providers that
# are not guarnateed to work (e.g., it includes providers for ib0,
# ib1, ib2, ib3, and bond0). Usually, a sysadmin will need to
# edit this file to configure it for the specific environment in
# which it will be used. Hence, if you run the udapl BTL on
# Linux/OFED, you'll get a bunch of warning messages about the
# providers that don't work. However, on Linux/OFED, you don't
# really want to use udapl anyway; you likely really want to use
# the openib BTL (i.e., native verbs, not udapl).
# So after exploring many different scenarios, the least evil
# solution seemed to be to disable building the udapl BTL on
# Linux/OFED *unless the user specifically asks for it.* To be
# specific: on Linux/OFED, if you do not specify
# --with-udapl(=DIR), the udapl BTL will not be built.
AS_IF([test -z "$with_udapl"],
[case $host in
*linux*)
AC_MSG_WARN([On Linux and --with-udapl was not specified])
AC_MSG_WARN([Not building the udapl BTL])
with_udapl=no
;;
esac])
AS_IF([test ! -z "$with_udapl" -a "$with_udapl" != "yes"],
[ompi_check_udapl_dir="$with_udapl"])
AS_IF([test ! -z "$with_udapl_libdir" -a "$with_udapl_libdir" != "yes"],
[ompi_check_udapl_libdir="$with_udapl_libdir"])
AS_IF([test "$with_udapl" = "no"],
[ompi_check_udapl_happy="no"],
[ompi_check_udapl_happy="yes"])
dnl Do not use ompi_check_package directly, because then we have
dnl to test for the header file twice, and caching is disabled
dnl for all ompi_check_package checks. Instead, do what
dnl ompi_check_package does, but only do the header check once.
dnl Still do the lib check twice, the second time if it turns
dnl out we need -ldapl to link (looks like udapl over GM).
ompi_check_package_$1_save_CPPFLAGS="$CPPFLAGS"
ompi_check_package_$1_save_LDFLAGS="$LDFLAGS"
ompi_check_package_$1_save_LIBS="$LIBS"
ompi_check_package_$1_orig_CPPFLAGS="$$1_CPPFLAGS"
ompi_check_package_$1_orig_LDFLAGS="$$1_LDFLAGS"
ompi_check_package_$1_orig_LIBS="$$1_LIBS"
AS_IF([test "$ompi_check_udapl_happy" = "yes"],
[_OMPI_CHECK_PACKAGE_HEADER([$1],
[dat/udat.h],
[$ompi_check_udapl_dir],
[ompi_check_udapl_happy="yes"],
[ompi_check_udapl_happy="no"])])
AS_IF([test "$ompi_check_udapl_happy" = "yes"],
[_OMPI_CHECK_PACKAGE_LIB([$1],
[dat],
[dat_registry_list_providers],
[],
[$ompi_check_udapl_dir],
[$ompi_check_udapl_libdir],
[ompi_check_udapl_happy="yes"],
[_OMPI_CHECK_PACKAGE_LIB([$1],
[dat],
[dat_registry_list_providers],
[-ldapl],
[$ompi_check_udapl_dir],
[$ompi_check_udapl_libdir],
[ompi_check_udapl_happy="yes"],
[ompi_check_udapl_happy="no"])])])
CPPFLAGS="$ompi_check_package_$1_save_CPPFLAGS"
LDFLAGS="$ompi_check_package_$1_save_LDFLAGS"
LIBS="$ompi_check_package_$1_save_LIBS"
AS_IF([test "$ompi_check_udapl_happy" = "yes"],
[$2],
[AS_IF([test ! -z "$with_udapl" -a "$with_udapl" != "no"],
[AC_MSG_ERROR([uDAPL support requested but not found. Aborting])])
$3])
])

247
config/ompi_check_vendor.m4 Normal file
View File

@ -0,0 +1,247 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OMPI_C_COMPILER_VENDOR(VENDOR_VARIABLE)
# ---------------------------------------
# Set shell variable VENDOR_VARIABLE to the name of the compiler
# vendor for the current C compiler.
#
# See comment for _OMPI_CHECK_COMPILER_VENDOR for a complete
# list of currently detected compilers.
AC_DEFUN([OMPI_C_COMPILER_VENDOR], [
AC_REQUIRE([AC_PROG_CC])
AC_CACHE_CHECK([for the C compiler vendor],
[ompi_cv_c_compiler_vendor],
[AC_LANG_PUSH(C)
_OMPI_CHECK_COMPILER_VENDOR([ompi_cv_c_compiler_vendor])
AC_LANG_POP(C)])
$1="$ompi_cv_c_compiler_vendor"
])
# OMPI_CXX_COMPILER_VENDOR(VENDOR_VARIABLE)
# ---------------------------------------
# Set shell variable VENDOR_VARIABLE to the name of the compiler
# vendor for the current C++ compiler.
#
# See comment for _OMPI_CHECK_COMPILER_VENDOR for a complete
# list of currently detected compilers.
AC_DEFUN([OMPI_CXX_COMPILER_VENDOR], [
AC_REQUIRE([AC_PROG_CXX])
AC_CACHE_CHECK([for the C++ compiler vendor],
[ompi_cv_cxx_compiler_vendor],
[AC_LANG_PUSH(C++)
_OMPI_CHECK_COMPILER_VENDOR([ompi_cv_cxx_compiler_vendor])
AC_LANG_POP(C++)])
$1="$ompi_cv_c_compiler_vendor"
])
# OMPI_IFDEF_IFELSE(symbol, [action-if-defined],
# [action-if-not-defined])
# ----------------------------------------------
# Run compiler to determine if preprocessor symbol "symbol" is
# defined by the compiler.
AC_DEFUN([OMPI_IFDEF_IFELSE], [
AC_COMPILE_IFELSE([#ifndef $1
#error "symbol $1 not defined"
choke me
#endif], [$2], [$3])])
# OMPI_IF_IFELSE(symbol, [action-if-defined],
# [action-if-not-defined])
# ----------------------------------------------
# Run compiler to determine if preprocessor symbol "symbol" is
# defined by the compiler.
AC_DEFUN([OMPI_IF_IFELSE], [
AC_COMPILE_IFELSE([#if !( $1 )
#error "condition $1 not met"
choke me
#endif], [$2], [$3])])
# _OMPI_CHECK_COMPILER_VENDOR(VENDOR_VARIABLE)
# --------------------------------------------
# Set shell variable VENDOR_VARIABLE to the name of the compiler
# vendor for the compiler for the current language. Language must be
# one of C, OBJC, or C++.
#
# thanks to http://predef.sourceforge.net/precomp.html for the list
# of defines to check.
AC_DEFUN([_OMPI_CHECK_COMPILER_VENDOR], [
ompi_check_compiler_vendor_result="unknown"
# GNU is probably the most common, so check that one as soon as
# possible. Intel pretends to be GNU, so need to check Intel
# before checking for GNU.
# Intel
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IF_IFELSE([defined(__INTEL_COMPILER) || defined(__ICC)],
[ompi_check_compiler_vendor_result="intel"])])
# GNU
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IFDEF_IFELSE([__GNUC__],
[ompi_check_compiler_vendor_result="gnu"])])
# Borland Turbo C
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IFDEF_IFELSE([__TURBOC__],
[ompi_check_compiler_vendor_result="borland"])])
# Borland C++
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IFDEF_IFELSE([__BORLANDC__],
[ompi_check_compiler_vendor_result="borland"])])
# Comeau C++
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IFDEF_IFELSE([__COMO__],
[ompi_check_compiler_vendor_result="comeau"])])
# Compaq C/C++
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IF_IFELSE([defined(__DECC) || defined(VAXC) || defined(__VAXC)],
[ompi_check_compiler_vendor_result="compaq"],
[OMPI_IF_IFELSE([defined(__osf__) && defined(__LANGUAGE_C__)],
[ompi_check_compiler_vendor_result="compaq"],
[OMPI_IFDEF_IFELSE([__DECCXX],
[ompi_check_compiler_vendor_result="compaq"])])])])
# Cray C/C++
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IFDEF_IFELSE([_CRAYC],
[ompi_check_compiler_vendor_result="cray"])])
# Diab C/C++
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IFDEF_IFELSE([__DCC__],
[ompi_check_compiler_vendor_result="diab"])])
# Digital Mars
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IF_IFELSE([defined(__DMC__) || defined(__SC__) || defined(__ZTC__)],
[ompi_check_compiler_vendor_result="digital mars"])])
# HP ANSI C / aC++
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IF_IFELSE([defined(__HP_cc) || defined(__HP_aCC)],
[ompi_check_compiler_vendor_result="hp"])])
# IBM XL C/C++
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IF_IFELSE([defined(__xlC__) || defined(__IBMC__) || defined(__IBMCPP__)],
[ompi_check_compiler_vendor_result="ibm"],
[OMPI_IF_IFELSE([defined(_AIX) && !defined(__GNUC__)],
[ompi_check_compiler_vendor_result="ibm"])])])
# KAI C++ (rest in peace)
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IFDEF_IFELSE([__KCC],
[ompi_check_compiler_vendor_result="kai"])])
# LCC
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IFDEF_IFELSE([__LCC__],
[ompi_check_compiler_vendor_result="lcc"])])
# MetaWare High C/C++
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IFDEF_IFELSE([__HIGHC__],
[ompi_check_compiler_vendor_result="metaware high"])])
# Metrowerks Codewarrior
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IFDEF_IFELSE([__MWERKS__],
[ompi_check_compiler_vendor_result="metrowerks"])])
# MIPSpro (SGI)
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IF_IFELSE([defined(sgi) || defined(__sgi)],
[ompi_check_compiler_vendor_result="sgi"])])
# MPW C++
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IF_IFELSE([defined(__MRC__) || defined(MPW_C) || defined(MPW_CPLUS)],
[ompi_check_compiler_vendor_result="mpw"])])
# Microsoft
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[# Always use C compiler when checking for Microsoft, as
# Visual C++ doesn't recognize .cc as a C++ file.
AC_LANG_PUSH(C)
OMPI_IF_IFELSE([defined(_MSC_VER) || defined(__MSC_VER)],
[ompi_check_compiler_vendor_result="microsoft"])
AC_LANG_POP(C)])
# Norcroft C
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IFDEF_IFELSE([__CC_NORCROFT],
[ompi_check_compiler_vendor_result="norcroft"])])
# Pelles C
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IFDEF_IFELSE([__POCC__],
[ompi_check_compiler_vendor_result="pelles"])])
# Portland Group
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IFDEF_IFELSE([__PGI],
[ompi_check_compiler_vendor_result="portland group"])])
# SAS/C
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IF_IFELSE([defined(SASC) || defined(__SASC) || defined(__SASC__)],
[ompi_check_compiler_vendor_result="sas"])])
# Sun Workshop C/C++
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IF_IFELSE([defined(__SUNPRO_C) || defined(__SUNPRO_CC)],
[ompi_check_compiler_vendor_result="sun"])])
# TenDRA C/C++
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IFDEF_IFELSE([__TenDRA__],
[ompi_check_compiler_vendor_result="tendra"])])
# Tiny C
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IFDEF_IFELSE([__TINYC__],
[ompi_check_compiler_vendor_result="tiny"])])
# USL C
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IFDEF_IFELSE([__USLC__],
[ompi_check_compiler_vendor_result="usl"])])
# Watcom C++
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
[OMPI_IFDEF_IFELSE([__WATCOMC__],
[ompi_check_compiler_vendor_result="watcom"])])
$1="$ompi_check_compiler_vendor_result"
unset ompi_check_compiler_vendor_result
])

View File

@ -0,0 +1,78 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# 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.
# Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2006-2007 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# OMPI_CHECK_VISIBILITY
# --------------------------------------------------------
AC_DEFUN([OMPI_CHECK_VISIBILITY],[
AC_REQUIRE([AC_PROG_GREP])
# Check if the compiler has support for visibility, like some versions of gcc, icc.
AC_ARG_ENABLE(visibility,
AC_HELP_STRING([--enable-visibility],
[enable visibility feature of certain compilers/linkers (default: enabled)]))
if test "$enable_visibility" = "no"; then
AC_MSG_CHECKING([enable symbol visibility])
AC_MSG_RESULT([no])
have_visibility=0
else
CFLAGS_orig="$CFLAGS"
CFLAGS="$CFLAGS_orig -fvisibility=hidden"
add=
AC_CACHE_CHECK([if $CC supports -fvisibility],
[ompi_cv_cc_fvisibility],
[AC_TRY_LINK([
#include <stdio.h>
__attribute__((visibility("default"))) int foo;
void bar(void) { fprintf(stderr, "bar\n"); };
],[],
[if test -s conftest.err ; then
$GREP -iq "visibility" conftest.err
if test "$?" = "0" ; then
ompi_cv_cc_fvisibility="no"
else
ompi_cv_cc_fvisibility="yes"
fi
else
ompi_cv_cc_fvisibility="yes"
fi],
[ompi_cv_cc_fvisibility="no"])
])
if test "$ompi_cv_cc_fvisibility" = "yes" ; then
add=" -fvisibility=hidden"
have_visibility=1
AC_MSG_CHECKING([enable symbol visibility])
AC_MSG_RESULT([yes])
AC_MSG_WARN([$add has been added to CFLAGS])
elif test "$enable_visibility" = "yes"; then
AC_MSG_ERROR([Symbol visibility support requested but compiler does not seem to support it. Aborting])
else
AC_MSG_CHECKING([enable symbol visibility])
AC_MSG_RESULT([no])
have_visibility=0
fi
CFLAGS="$CFLAGS_orig$add"
unset add
fi
AC_DEFINE_UNQUOTED([OMPI_C_HAVE_VISIBILITY], [$have_visibility],
[Whether C compiler supports -fvisibility])
])

View File

@ -0,0 +1,64 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# 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.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2006 Los Alamos National Security, LLC. All rights
# reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# OMPI_CHECK_XGRID(prefix, [action-if-found], [action-if-not-found])
# --------------------------------------------------------
AC_DEFUN([OMPI_CHECK_XGRID],[
AC_REQUIRE([AC_PROG_OBJC])
AC_ARG_WITH([xgrid],
[AC_HELP_STRING([--with-xgrid],
[Build support for the Apple Xgrid batch system (default: yes)])])
AS_IF([test "$with_xgrid" != "no"],
[OMPI_LANG_LINK_WITH_C([Objective C],
[AC_CACHE_CHECK([for XgridFoundation Framework],
[ompi_cv_check_xgrid_foundation],
[_OMPI_CHECK_XGRID([ompi_cv_check_xgrid_foundation="yes"],
[ompi_cv_check_xgrid_foundation="no"])])
AS_IF([test "$ompi_cv_check_xgrid_foundation" = "yes"],
[ompi_check_xgrid_happy="yes"],
[ompi_check_xgrid_happy="no"])],
[ompi_check_xgrid_happy="no"])],
[ompi_check_xgrid_happy="no"])
AS_IF([test "$ompi_check_xgrid_happy" = "yes"],
[$1_LDFLAGS="$$1_LDFLAGS -framework XgridFoundation -framework Foundation"
$2], [$3])
])
# _OMPI_CHECK_XGRID([action-if-found], [action-if-not-found])
# --------------------------------------------------------
AC_DEFUN([_OMPI_CHECK_XGRID],[
AC_LANG_PUSH(Objective C)
ompi_check_xgrid_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -framework XgridFoundation -framework Foundation"
AC_TRY_LINK([#import <Foundation/Foundation.h>
#import <XgridFoundation/XgridFoundation.h>
#import <Foundation/NSString.h>
],
[NSLog(@"%@", XGConnectionKeyIsOpened);],
[$1], [$2])
LDFLAGS="$ompi_check_xgrid_save_LDFLAGS"
AC_LANG_POP(Objective C)
])

1090
config/ompi_config_asm.m4 Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,686 @@
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
dnl OMPI_CONFIG_POSIX_THREADS()
dnl
dnl Configure posix threads, setting the following variables (but
dnl not calling AC_SUBST on them).
# ********************************************************************
#
# Internal macros - do not call from outside OMPI_CONFIG_POSIX_THREADS
#
# ********************************************************************
AC_DEFUN([OMPI_INTL_PTHREAD_TRY_LINK], [
# BEGIN: OMPI_INTL_PTHREAD_TRY_LINK
#
# Make sure that we can run a small application in C or C++, which
# ever is the current language. Do make sure that C or C++ is the
# current language.
#
# As long as this is not being run....
# pthread_t may be anything from an int to a struct -- init with self-tid.
#
AC_TRY_LINK([#include <pthread.h>],
[pthread_t th=pthread_self(); pthread_join(th, 0);
pthread_attr_init(0); pthread_cleanup_push(0, 0);
pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
[$1], [$2])
# END: OMPI_INTL_PTHREAD_TRY_LINK
])dnl
AC_DEFUN([OMPI_INTL_PTHREAD_TRY_LINK_F77], [
# BEGIN: OMPI_INTL_PTHREAD_TRY_LINK_F77
#
# Make sure that we can run a small application in Fortran, with
# pthreads living in a C object file
OMPI_F77_MAKE_C_FUNCTION([ompi_ac_thread_fn], [pthreadtest])
# Fortran module
cat > conftestf.f <<EOF
program fpthread
call pthreadtest
end
EOF
# C module
if test -f conftest.h; then
ompi_conftest_h="#include \"conftest.h\""
else
ompi_conftest_h=""
fi
cat > conftest.c <<EOF
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
$ompi_conftest_h
#ifdef __cplusplus
extern "C" {
#endif
void $ompi_ac_thread_fn()
{
pthread_t th;
pthread_create(&th, NULL, NULL, NULL);
pthread_join(th, 0);
pthread_attr_init(0);
pthread_cleanup_push(0, 0);
pthread_create(0,0,0,0);
pthread_cleanup_pop(0);
}
#ifdef __cplusplus
}
#endif
EOF
# Try the compile
OMPI_LOG_COMMAND(
[$CC $CFLAGS -I. -c conftest.c],
OMPI_LOG_COMMAND(
[$F77 $FFLAGS conftestf.f conftest.o -o conftest $LDFLAGS $LIBS],
[HAPPY=1],
[HAPPY=0]),
[HAPPY=0])
if test "$HAPPY" = "1"; then
$1
else
OMPI_LOG_MSG([here is the C program:], 1)
OMPI_LOG_FILE([conftest.c])
if test -f conftest.h; then
OMPI_LOG_MSG([here is contest.h:], 1)
OMPI_LOG_FILE([conftest.h])
fi
OMPI_LOG_MSG([here is the fortran program:], 1)
OMPI_LOG_FILE([conftestf.f])
$2
fi
unset HAPPY ompi_conftest_h
rm -rf conftest*
# END: OMPI_INTL_PTHREAD_TRY_LINK_F77
])dnl
# ********************************************************************
#
# Try to compile thread support without any special flags
#
# ********************************************************************
AC_DEFUN([OMPI_INTL_POSIX_THREADS_PLAIN_C], [
#
# C compiler
#
if test "$ompi_pthread_c_success" = "0"; then
AC_MSG_CHECKING([if C compiler and POSIX threads work as is])
if test "$HAVE_POSIX_THREADS" = "1" ; then
run_this_test=1
else
case "${host_cpu}-${host_os}" in
*solaris*)
AC_MSG_RESULT([no - Solaris, not checked])
run_this_test=0
;;
*-aix* | *-freebsd*)
if test "`echo $CPPFLAGS | $GREP 'D_THREAD_SAFE'`" = ""; then
PTRHEAD_CPPFLAGS="-D_THREAD_SAFE"
CPPFLAGS="$CPPFLAGS $PTHREAD_CPPFLAGS"
fi
run_this_test=1
;;
*)
if test "`echo $CPPFLAGS | $GREP 'D_REENTRANT'`" = ""; then
PTHREAD_CPPFLAGS="-D_REENTRANT"
CPPFLAGS="$CPPFLAGS $PTHREAD_CPPFLAGS"
fi
run_this_test=1
;;
esac
fi
if test "$run_this_test" = "1" ; then
AC_LANG_PUSH(C)
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_c_success=1,
ompi_pthread_c_success=0)
AC_LANG_POP(C)
if test "$ompi_pthread_c_success" = "1"; then
AC_MSG_RESULT([yes])
else
PTHREAD_CPPFLAGS=
CPPFLAGS="$orig_CPPFLAGS"
AC_MSG_RESULT([no])
fi
fi
fi
])dnl
AC_DEFUN([OMPI_INTL_POSIX_THREADS_PLAIN_CXX], [
#
# C++ compiler
#
if test "$ompi_pthread_cxx_success" = "0"; then
AC_MSG_CHECKING([if C++ compiler and POSIX threads work as is])
if test "$HAVE_POSIX_THREADS" = "1" ; then
run_this_test=1
else
case "${host_cpu}-${host_os}" in
*solaris*)
AC_MSG_RESULT([no - Solaris, not checked])
run_this_test=0
;;
*-aix* | *-freebsd*)
if test "`echo $CXXCPPFLAGS | $GREP 'D_THREAD_SAFE'`" = ""; then
PTRHEAD_CXXCPPFLAGS="-D_THREAD_SAFE"
CXXCPPFLAGS="$CXXCPPFLAGS $PTHREAD_CXXCPPFLAGS"
fi
run_this_test=1
;;
*)
if test "`echo $CXXCPPFLAGS | $GREP 'D_REENTRANT'`" = ""; then
PTHREAD_CXXCPPFLAGS="-D_REENTRANT"
CXXCPPFLAGS="$CXXCPPFLAGS $PTHREAD_CXXCPPFLAGS"
fi
run_this_test=1
;;
esac
fi
if test "$run_this_test" = "1" ; then
AC_LANG_PUSH(C++)
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_cxx_success=1,
ompi_pthread_cxx_success=0)
AC_LANG_POP(C++)
if test "$ompi_pthread_cxx_success" = "1"; then
AC_MSG_RESULT([yes])
else
PTHREAD_CXXCPPFLAGS=
CXXCPPFLAGS="$orig_CXXCPPFLAGS"
AC_MSG_RESULT([no])
fi
fi
fi
])dnl
AC_DEFUN([OMPI_INTL_POSIX_THREADS_PLAIN_FC], [
#
# Fortran compiler
#
if test "$ompi_pthread_f77_success" = "0" -a "$OMPI_WANT_F77_BINDINGS" = "1"; then
AC_MSG_CHECKING([if F77 compiler and POSIX threads work as is])
if test "$HAVE_POSIX_THREADS" = "1" ; then
run_this_test=1
else
case "${host_cpu}-${host_os}" in
*solaris*)
AC_MSG_RESULT([no - Solaris, not checked])
run_this_test=0
;;
*)
run_this_test=1
;;
esac
fi
if test "$run_this_test" = "1" ; then
AC_LANG_PUSH(C)
OMPI_INTL_PTHREAD_TRY_LINK_F77(ompi_pthread_f77_success=1,
ompi_pthread_f77_success=0)
AC_LANG_POP(C)
if test "$ompi_pthread_f77_success" = "1"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
fi
fi
])dnl
AC_DEFUN([OMPI_INTL_POSIX_THREADS_PLAIN], [
# BEGIN: OMPI_INTL_POSIX_THREADS_PLAIN
#
# Check if can compile without any special flags
# we throw -D_REENTRANT or -D_THREAD_SAFE in here, just in
# case. Some systems (OS X, for example) generally don't need
# the defines, but then will on one system header here or there
# why take chances?
#
# Only run C++ and Fortran if those compilers already configured
AC_PROVIDE_IFELSE([AC_PROG_CC],
[OMPI_INTL_POSIX_THREADS_PLAIN_C],
[ompi_pthread_c_success=1])
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[OMPI_INTL_POSIX_THREADS_PLAIN_CXX],
[ompi_pthread_cxx_success=1])
AC_PROVIDE_IFELSE([AC_PROG_F77],
[OMPI_INTL_POSIX_THREADS_PLAIN_FC],
[ompi_pthread_f77_success=1])
# End: OMPI_INTL_POSIX_THREADS_PLAIN
])dnl
# ********************************************************************
#
# Try to compile thread support with special compiler flags
#
# ********************************************************************
AC_DEFUN([OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS_C], [
#
# C compiler
#
if test "$ompi_pthread_c_success" = "0"; then
for pf in $pflags; do
AC_MSG_CHECKING([if C compiler and POSIX threads work with $pf])
CFLAGS="$orig_CFLAGS $pf"
AC_LANG_PUSH(C)
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_c_success=1,
ompi_pthread_c_success=0)
AC_LANG_POP(C)
if test "$ompi_pthread_c_success" = "1"; then
PTHREAD_CFLAGS="$pf"
AC_MSG_RESULT([yes])
break
else
PTHREAD_CFLAGS=
CFLAGS="$orig_CFLAGS"
AC_MSG_RESULT([no])
fi
done
fi
])
AC_DEFUN([OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS_CXX], [
#
# C++ compiler
#
if test "$ompi_pthread_cxx_success" = "0"; then
for pf in $pflags; do
AC_MSG_CHECKING([if C++ compiler and POSIX threads work with $pf])
CXXFLAGS="$orig_CXXFLAGS $pf"
AC_LANG_PUSH(C++)
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_cxx_success=1,
ompi_pthread_cxx_success=0)
AC_LANG_POP(C++)
if test "$ompi_pthread_cxx_success" = "1"; then
PTHREAD_CXXFLAGS="$pf"
AC_MSG_RESULT([yes])
break
else
PTHREAD_CXXFLAGS=
CXXFLAGS="$orig_CXXFLAGS"
AC_MSG_RESULT([no])
fi
done
fi
])
AC_DEFUN([OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS_FC], [
#
# Fortran compiler
#
if test "$ompi_pthread_f77_success" = "0" -a "$OMPI_WANT_F77_BINDINGS" = "1"; then
for pf in $pflags; do
AC_MSG_CHECKING([if F77 compiler and POSIX threads work with $pf])
FFLAGS="$orig_FFLAGS $pf"
AC_LANG_PUSH(C)
OMPI_INTL_PTHREAD_TRY_LINK_F77(ompi_pthread_f77_success=1,
ompi_pthread_f77_success=0)
AC_LANG_POP(C)
if test "$ompi_pthread_f77_success" = "1"; then
PTHREAD_FFLAGS="$pf"
AC_MSG_RESULT([yes])
break
else
PTHREAD_FFLAGS=
FFLAGS="$orig_FFLAGS"
AC_MSG_RESULT([no])
fi
done
fi
])
AC_DEFUN([OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS],[
# Begin: OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS
#
# If above didn't work, try some super-special compiler flags
# that get evaluated to the "right" things.
#
# -Kthread:
# -kthread: FreeBSD kernel threads
# -pthread: Modern GCC (most all platforms)
# -pthreads: GCC on solaris
# -mthreads:
# -mt: Solaris native compilers / HP-UX aCC
#
# Put -mt before -mthreads because HP-UX aCC will properly compile
# with -mthreads (reading as -mt), but emit a warning about unknown
# flags hreads. Stupid compilers.
case "${host_cpu}-${host_os}" in
*solaris*)
pflags="-pthread -pthreads -mt"
;;
*)
pflags="-Kthread -kthread -pthread -pthreads -mt -mthreads"
;;
esac
# Only run C++ and Fortran if those compilers already configured
AC_PROVIDE_IFELSE([AC_PROG_CC],
[OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS_C],
[ompi_pthread_c_success=1])
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS_CXX],
[ompi_pthread_cxx_success=1])
AC_PROVIDE_IFELSE([AC_PROG_F77],
[OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS_FC],
[ompi_pthread_f77_success=1])
# End: OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS
])dnl
# ********************************************************************
#
# Try to compile thread support with extra libs
#
# ********************************************************************
AC_DEFUN([OMPI_INTL_POSIX_THREADS_LIBS_C],[
#
# C compiler
#
if test "$ompi_pthread_c_success" = "0"; then
for pl in $plibs; do
AC_MSG_CHECKING([if C compiler and POSIX threads work with $pl])
case "${host_cpu}-${host-_os}" in
*-aix* | *-freebsd*)
if test "`echo $CPPFLAGS | $GREP 'D_THREAD_SAFE'`" = ""; then
PTRHEAD_CPPFLAGS="-D_THREAD_SAFE"
CPPFLAGS="$CPPFLAGS $PTHREAD_CPPFLAGS"
fi
;;
*)
if test "`echo $CPPFLAGS | $GREP 'D_REENTRANT'`" = ""; then
PTHREAD_CPPFLAGS="-D_REENTRANT"
CPPFLAGS="$CPPFLAGS $PTHREAD_CPPFLAGS"
fi
;;
esac
LIBS="$orig_LIBS $pl"
AC_LANG_PUSH(C)
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_c_success=1,
ompi_pthread_c_success=0)
AC_LANG_POP(C)
if test "$ompi_pthread_c_success" = "1"; then
PTHREAD_LIBS="$pl"
AC_MSG_RESULT([yes])
else
PTHREAD_CPPFLAGS=
CPPFLAGS="$orig_CPPFLAGS"
LIBS="$orig_LIBS"
AC_MSG_RESULT([no])
fi
done
fi
])dnl
AC_DEFUN([OMPI_INTL_POSIX_THREADS_LIBS_CXX],[
#
# C++ compiler
#
if test "$ompi_pthread_cxx_success" = "0"; then
if test ! "$ompi_pthread_c_success" = "0" -a ! "$PTHREAD_LIBS" = "" ; then
AC_MSG_CHECKING([if C++ compiler and POSIX threads work with $PTHREAD_LIBS])
case "${host_cpu}-${host-_os}" in
*-aix* | *-freebsd*)
if test "`echo $CXXCPPFLAGS | $GREP 'D_THREAD_SAFE'`" = ""; then
PTRHEAD_CXXCPPFLAGS="-D_THREAD_SAFE"
CXXCPPFLAGS="$CXXCPPFLAGS $PTHREAD_CXXCPPFLAGS"
fi
;;
*)
if test "`echo $CXXCPPFLAGS | $GREP 'D_REENTRANT'`" = ""; then
PTHREAD_CXXCPPFLAGS="-D_REENTRANT"
CXXCPPFLAGS="$CXXCPPFLAGS $PTHREAD_CXXCPPFLAGS"
fi
;;
esac
LIBS="$orig_LIBS $PTHREAD_LIBS"
AC_LANG_PUSH(C++)
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_cxx_success=1,
ompi_pthread_cxx_success=0)
AC_LANG_POP(C++)
if test "$ompi_pthread_cxx_success" = "1"; then
AC_MSG_RESULT([yes])
else
CXXCPPFLAGS="$orig_CXXCPPFLAGS"
LIBS="$orig_LIBS"
AC_MSG_RESULT([no])
AC_MSG_ERROR([Can not find working threads configuration. aborting])
fi
else
for pl in $plibs; do
AC_MSG_CHECKING([if C++ compiler and POSIX threads work with $pl])
case "${host_cpu}-${host-_os}" in
*-aix* | *-freebsd*)
if test "`echo $CXXCPPFLAGS | $GREP 'D_THREAD_SAFE'`" = ""; then
PTRHEAD_CXXCPPFLAGS="-D_THREAD_SAFE"
CXXCPPFLAGS="$CXXCPPFLAGS $PTHREAD_CXXCPPFLAGS"
fi
;;
*)
if test "`echo $CXXCPPFLAGS | $GREP 'D_REENTRANT'`" = ""; then
PTHREAD_CXXCPPFLAGS="-D_REENTRANT"
CXXCPPFLAGS="$CXXCPPFLAGS $PTHREAD_CXXCPPFLAGS"
fi
;;
esac
LIBS="$orig_LIBS $pl"
AC_LANG_PUSH(C++)
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_cxx_success=1,
ompi_pthread_cxx_success=0)
AC_LANG_POP(C++)
if test "$ompi_pthread_cxx_success" = "1"; then
PTHREAD_LIBS="$pl"
AC_MSG_RESULT([yes])
else
PTHREAD_CXXCPPFLAGS=
CXXCPPFLAGS="$orig_CXXCPPFLAGS"
LIBS="$orig_LIBS"
AC_MSG_RESULT([no])
fi
done
fi
fi
])dnl
AC_DEFUN([OMPI_INTL_POSIX_THREADS_LIBS_FC],[
#
# Fortran compiler
#
if test "$ompi_pthread_f77_success" = "0" -a "$OMPI_WANT_F77_BINDINGS" = "1"; then
if test ! "$ompi_pthread_c_success" = "0" -a ! "$PTHREAD_LIBS" = "" ; then
AC_MSG_CHECKING([if F77 compiler and POSIX threads work with $PTHREAD_LIBS])
LIBS="$orig_LIBS $PTHREAD_LIBS"
AC_LANG_PUSH(C)
OMPI_INTL_PTHREAD_TRY_LINK_F77(ompi_pthread_f77_success=1,
ompi_pthread_f77_success=0)
AC_LANG_POP(C)
if test "$ompi_pthread_f77_success" = "1"; then
AC_MSG_RESULT([yes])
else
LIBS="$orig_LIBS"
AC_MSG_RESULT([no])
AC_MSG_ERROR([Can not find working threads configuration. aborting])
fi
else
for pl in $plibs; do
AC_MSG_CHECKING([if F77 compiler and POSIX threads work with $pl])
LIBS="$orig_LIBS $pl"
AC_LANG_PUSH(C)
OMPI_INTL_PTHREAD_TRY_LINK_F77(ompi_pthread_f77_success=1,
ompi_pthread_f77_success=0)
AC_LANG_POP(C)
if test "$ompi_pthread_f77_success" = "1"; then
PTHREAD_LIBS="$pl"
AC_MSG_RESULT([yes])
break
else
LIBS="$orig_LIBS"
AC_MSG_RESULT([no])
fi
done
fi
fi
])dnl
AC_DEFUN([OMPI_INTL_POSIX_THREADS_LIBS],[
# Begin: OMPI_INTL_POSIX_THREADS_LIBS
#
# if we can't find a super-special compiler flags, try some libraries.
# we throw -D_REENTRANT or -D_THREAD_SAFE in here, just in case. Some
# systems (OS X, for example) generally don't need the defines, but
# then will on one system header here or there why take chances?
#
# libpthreads: AIX - must check before libpthread
# liblthread: LinuxThreads on FreeBSD
# libpthread: The usual place (like we can define usual!)
plibs="-lpthreads -llthread -lpthread"
# Only run C++ and Fortran if those compilers already configured
AC_PROVIDE_IFELSE([AC_PROG_CC],
[OMPI_INTL_POSIX_THREADS_LIBS_C],
[ompi_pthread_c_success=1])
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[OMPI_INTL_POSIX_THREADS_LIBS_CXX],
[ompi_pthread_cxx_success=1])
AC_PROVIDE_IFELSE([AC_PROG_F77],
[OMPI_INTL_POSIX_THREADS_LIBS_FC],
[ompi_pthread_f77_success=1])
# End: OMPI_INTL_POSIX_THREADS_LIBS]
)dnl
#********************************************************************
#
# External macro (aka, the real thing)
#
#********************************************************************
AC_DEFUN([OMPI_CONFIG_POSIX_THREADS],[
AC_REQUIRE([AC_PROG_GREP])
ompi_pthread_c_success=0
ompi_pthread_f77_success=0
ompi_pthread_cxx_success=0
orig_CFLAGS="$CFLAGS"
orig_FFLAGS="$FFLAGS"
orig_CXXFLAGS="$CXXFLAGS"
orig_CPPFLAGS="$CPPFLAGS"
orig_CXXCPPFLAGS="$CXXCPPFLAGS"
orig_LDFLAGS="$LDFLAGS"
orig_LIBS="$LIBS"
PTRHEAD_CFLAGS=
PTHREAD_FFLAGS=
PTHREAD_CXXFLAGS=
PTHREAD_CPPFLAGS=
PTHREAD_CXXCPPFLAGS=
PTHREAD_LDFLAGS=
PTHREAD_LIBS=
# Try with the basics, mam.
OMPI_INTL_POSIX_THREADS_PLAIN
# Try the super-special compiler flags.
OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS
# Try the normal linking methods (that's no fun)
OMPI_INTL_POSIX_THREADS_LIBS
#
# check to see if we can set error checking mutexes
#
# LinuxThreads
AC_MSG_CHECKING([for PTHREAD_MUTEX_ERRORCHECK_NP])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <pthread.h>]],
[[pthread_mutexattr_settype(NULL, PTHREAD_MUTEX_ERRORCHECK_NP);]])],
[result="yes" defval=1], [result="no" defval=0])
AC_MSG_RESULT([$result])
AC_DEFINE_UNQUOTED([OMPI_HAVE_PTHREAD_MUTEX_ERRORCHECK_NP], [$defval],
[If PTHREADS implementation supports PTHREAD_MUTEX_ERRORCHECK_NP])
# Mac OS X
AC_MSG_CHECKING([for PTHREAD_MUTEX_ERRORCHECK])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <pthread.h>]],
[[pthread_mutexattr_settype(NULL, PTHREAD_MUTEX_ERRORCHECK);]])],
[result="yes" defval=1], [result="no" defval=0])
AC_MSG_RESULT([$result])
AC_DEFINE_UNQUOTED([OMPI_HAVE_PTHREAD_MUTEX_ERRORCHECK], [$defval],
[If PTHREADS implementation supports PTHREAD_MUTEX_ERRORCHECK])
CFLAGS="$orig_CFLAGS"
FFLAGS="$orig_FFLAGS"
CXXFLAGS="$orig_CXXFLAGS"
CPPFLAGS="$orig_CPPFLAGS"
CXXCPPFLAGS="$orig_CXXCPPFLAGS"
LDFLAGS="$orig_LDFLAGS"
LIBS="$orig_LIBS"
if test "$OMPI_WANT_F77_BINDINGS" != "1"; then
ompi_pthread_f77_success=1
fi
if test "$ompi_pthread_c_success" = "1" -a \
"$ompi_pthread_cxx_success" = "1" -a \
"$ompi_pthread_f77_success" = "1"; then
internal_useless=1
$1
else
internal_useless=1
$2
fi
unset ompi_pthread_c_success ompi_pthread_f77_success ompi_pthread_cxx_success
unset internal_useless
])dnl

View File

@ -0,0 +1,250 @@
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
dnl OMPI_CONFIG_SOLARIS_THREADS()
dnl
# ********************************************************************
#
# Internal macros - do not call from outside OMPI_CONFIG_SOLARIS_THREADS
#
# ********************************************************************
AC_DEFUN([OMPI_INTL_SOLARIS_TRY_LINK], [
# BEGIN: OMPI_INTL_SOLARIS_TRY_LINK
#
# Make sure that we can run a small application in C or C++, which
# ever is the current language. Do make sure that C or C++ is the
# current language.
AC_TRY_LINK([#include <thread.h>],
[thread_t th; thr_join(th, 0, 0);
thr_create(0,0,0,0,0,0); ],
[$1], [$2])
# END: OMPI_INTL_SOLARIS_TRY_LINK
])dnl
AC_DEFUN([OMPI_INTL_SOLARIS_TRY_LINK_F77], [
# BEGIN: OMPI_INTL_SOLARIS_TRY_LINK_F77
#
# Make sure that we can run a small application in Fortran, with
# pthreads living in a C object file
# Fortran module
cat > conftestf.f <<EOF
program fpthread
INTEGER i
i = 1
end
EOF
# C module
if test -f conftest.h; then
ompi_conftest_h="#include \"conftest.h\""
else
ompi_conftest_h=""
fi
cat > conftest.c <<EOF
#include <stdio.h>
#include <stdlib.h>
#include <thread.h>
$ompi_conftest_h
#ifdef __cplusplus
extern "C" {
#endif
void ompi_pthread()
{
thread_t th;
thr_join(th, 0, 0);
thr_create(0,0,0,0,0,0);
}
#ifdef __cplusplus
}
#endif
EOF
# Try the compile
OMPI_LOG_COMMAND(
[$CC $CFLAGS -I. -c conftest.c],
OMPI_LOG_COMMAND(
[$F77 $FFLAGS conftestf.f conftest.o -o conftest $LDFLAGS $LIBS],
[HAPPY=1],
[HAPPY=0]),
[HAPPY=0])
if test "$HAPPY" = "1"; then
$1
else
OMPI_LOG_MSG([here is the C program:], 1)
OMPI_LOG_FILE([conftest.c])
if test -f conftest.h; then
OMPI_LOG_MSG([here is contest.h:], 1)
OMPI_LOG_FILE([conftest.h])
fi
OMPI_LOG_MSG([here is the fortran program:], 1)
OMPI_LOG_FILE([conftestf.f])
$2
fi
unset HAPPY ompi_conftest_h
rm -rf conftest*
# END: OMPI_INTL_SOLARIS_TRY_LINK_F77
])dnl
AC_DEFUN([OMPI_CONFIG_SOLARIS_THREADS_C], [
if test "$BASECC" = "cc"; then
STHREAD_CFLAGS="-mt"
style="Workshop/Forte"
else
STHREAD_CPPFLAGS="-D_REENTRANT"
STHREAD_LIBS="-lthread"
style="-lthread"
fi
AC_MSG_CHECKING([if C compiler and Solaris threads work])
CFLAGS="$STHREAD_CFLAGS $CFLAGS_orig"
CPPFLAGS="$STHREAD_CPPFLAGS $CPPFLAGS_orig"
LDFLAGS="$STHREAD_LDFLAGS $LDFLAGS_orig"
LIBS="$STHREAD_LIBS $LIBS_orig"
AC_LANG_PUSH(C)
OMPI_INTL_SOLARIS_TRY_LINK(ompi_sthread_c_success=1,
ompi_sthread_c_success=0)
AC_LANG_POP(C)
if test "$ompi_sthread_c_success" = "1"; then
AC_MSG_RESULT([yes - $style])
else
AC_MSG_RESULT([no])
fi
])dnl
AC_DEFUN([OMPI_CONFIG_SOLARIS_THREADS_CXX], [
if test "$BASECXX" = "CC"; then
STHREAD_CXXFLAGS="-mt"
style="Workshop/Forte"
elif test "$BASECXX" = "KCC"; then
STHREAD_CXXFLAGS="--backend -mt"
style="KCC"
else
STHREAD_CXXCPPFLAGS="-D_REENTRANT"
STHREAD_LIBS="-lthread"
style="-lthread"
fi
CXXFLAGS="$STHREAD_CXXFLAGS $CXXFLAGS_orig"
CXXCPPFLAGS="$STHREAD_CXXPPFLAGS $CXXPPFLAGS_orig"
LDFLAGS="$STHREAD_LDFLAGS $LDFLAGS_orig"
LIBS="$STHREAD_LIBS $LIBS_orig"
AC_MSG_CHECKING([if C++ compiler and Solaris threads work])
AC_LANG_PUSH(C++)
OMPI_INTL_SOLARIS_TRY_LINK(ompi_sthread_cxx_success=1,
ompi_sthread_cxx_success=0)
AC_LANG_POP(C++)
if test "$ompi_sthread_cxx_success" = "1"; then
AC_MSG_RESULT([yes - $style])
else
AC_MSG_RESULT([no])
fi
])dnl
AC_DEFUN([OMPI_CONFIG_SOLARIS_THREADS_FC], [
if test "$OMPI_WANT_F77_BINDINGS" = "1"; then
if test "$BASEFC" = "f77"; then
STHREAD_FFLAGS="-mt"
style="Workshop/Forte"
else
STHREAD_LIBS="-lthread"
style="-lthread"
fi
FFLAGS="$STHREAD_FFLAGS $FFLAGS_orig"
CFLAGS="$STHREAD_CFLAGS $CFLAGS_orig"
CPPFLAGS="$STHREAD_CPPFLAGS $CPPFLAGS_orig"
LDFLAGS="$STHREAD_LDFLAGS $LDFLAGS_orig"
LIBS="$STHREAD_LIBS $LIBS_orig"
AC_MSG_CHECKING([if F77 compiler and Solaris threads work])
AC_LANG_PUSH(C)
OMPI_INTL_SOLARIS_TRY_LINK_F77(ompi_sthread_f77_success=1,
ompi_sthread_f77_success=0)
AC_LANG_POP(C)
if test "$ompi_sthread_f77_success" = "1"; then
AC_MSG_RESULT([yes - $style])
else
AC_MSG_RESULT([no])
fi
else
ompi_sthread_f77_success=1
fi
])dnl
AC_DEFUN([OMPI_CONFIG_SOLARIS_THREADS],[
ompi_sthread_c_success=0
ompi_sthread_f77_success=0
ompi_sthread_cxx_success=0
orig_CFLAGS="$CFLAGS"
orig_FFLAGS="$FFLAGS"
orig_CXXFLAGS="$CXXFLAGS"
orig_CPPFLAGS="$CPPFLAGS"
orig_CXXCPPFLAGS="$CXXCPPFLAGS"
orig_LDFLAGS="$LDFLAGS"
orig_LIBS="$LIBS"
STHREAD_CFLAGS=
STHREAD_FFLAGS=
STHREAD_CXXFLAGS=
STHREAD_CPPFLAGS=
STHREAD_CXXCPPFLAGS=
STHREAD_LDFLAGS=
STHREAD_LIBS=
# Only run C++ and Fortran if those compilers already configured
AC_PROVIDE_IFELSE([AC_PROG_CC],
[OMPI_CONFIG_SOLARIS_THREADS_C],
[ompi_sthread_c_success=1])
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[OMPI_CONFIG_SOLARIS_THREADS_CXX],
[ompi_sthread_cxx_success=1])
AC_PROVIDE_IFELSE([AC_PROG_F77],
[OMPI_CONFIG_SOLARIS_THREADS_FC],
[ompi_sthread_f77_success=1])
CFLAGS="$orig_CFLAGS"
FFLAGS="$orig_FFLAGS"
CXXFLAGS="$orig_CXXFLAGS"
CPPFLAGS="$orig_CPPFLAGS"
CXXCPPFLAGS="$orig_CXXCPPFLAGS"
LDFLAGS="$orig_LDFLAGS"
LIBS="$orig_LIBS"
if test "$ompi_sthread_c_success" = "1" -a \
"$ompi_sthread_cxx_success" = "1" -a \
"$ompi_sthread_f77_success" = "1"; then
internal_useless=1
$1
else
internal_useless=1
$2
fi
unset ompi_sthread_c_success ompi_sthread_f77_success ompi_sthread_cxx_success
unset internal_useless
])dnl

View File

@ -0,0 +1,156 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
AC_DEFUN([OMPI_CONFIG_SUBDIR],[
#
# Invoke configure in a specific subdirectory.
#
# $1 is the directory to invoke in
# $2 is the list of arguments to pass
# $3 is actions to execute upon success
# $4 is actions to execute upon failure
#
subdir_dir="$1"
subdir_args="$2"
subdir_success="$3"
subdir_failure="$4"
#
# Sanity checks
#
if test "$subdir_dir" != ":" -a -d $srcdir/$subdir_dir; then
AC_MSG_NOTICE([OMPI configuring in $subdir_dir])
#
# Gotta check where srcdir is for VPATH builds. If srcdir is not
# ., then we need to mkdir the subdir. Otherwise, we can just cd
# into it.
#
case $srcdir in
.)
;;
*)
{ case $subdir_dir in
[[\\/]]* | ?:[[\\/]]* ) total_dir=;;
*) total_dir=.;;
esac
temp=$subdir_dir
for dir_part in `IFS='/\\'; set X $temp; shift; echo "$[@]"`; do
case $dir_part in
# Skip DOS drivespec
?:) total_dir=$dir_part ;;
*) total_dir=$total_dir/$dir_part
test -d "$total_dir" ||
mkdir "$total_dir" ||
AC_MSG_ERROR([cannot create $subdir_dir])
;;
esac
done; }
if test -d ./$subdir_dir; then :;
else
AC_MSG_ERROR([cannot create `pwd`/$subdir_dir])
fi
;;
esac
#
# Move into the target directory
#
subdir_parent=`pwd`
cd $subdir_dir
#
# Make a "../" for each directory in $subdir_dir.
#
subdir_dots=`[echo $subdir_dir | sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g]'`
#
# Construct the --srcdir argument
#
case $srcdir in
.)
# In place
subdir_srcdir="$srcdir"
;;
[[\\/]* | ?:[\\/]*] )
# Absolute path
subdir_srcdir="$srcdir/$subdir_dir"
;;
*)
# Relative path
subdir_srcdir="$subdir_dots$srcdir/$subdir_dir"
;;
esac
#
# Construct the --cache-file argument
#
dnl case $cache_file in
dnl [[\\/]* | ?:[\\/]*] )
dnl # Absolute path
dnl subdir_cache_file="$cache_file"
dnl ;;
dnl *)
dnl # Relative path
dnl subdir_cache_file="$subdir_dots$cache_file"
dnl ;;
dnl esac
# BWB - subdir caching is a pain since we change CFLAGS and all that.
# Just disable it for now
subdir_cache_file="/dev/null"
#
# Invoke the configure script in the subdirectory
#
export CFLAGS CPPFLAGS
export CXXFLAGS CXXCPPFLAGS
export FFLAGS
export LDFLAGS LIBS
sub_configure="$SHELL '$subdir_srcdir/configure'"
AC_MSG_NOTICE([running $sub_configure $subdir_args --cache-file=$subdir_cache_file --srcdir=$subdir_srcdir])
eval "$sub_configure $subdir_args \
--cache-file=\"\$subdir_cache_file\" --srcdir=\"$subdir_srcdir\""
if test "$?" = "0"; then
eval $subdir_success
AC_MSG_NOTICE([$sub_configure succeeded for $subdir_dir])
else
eval $subdir_failure
AC_MSG_NOTICE([$sub_configure *failed* for $subdir_dir])
fi
#
# Go back to the topdir
#
cd $subdir_parent
fi
#
# Clean up
#
unset subdir_parent sub_configure subdir_dir subdir_srcdir subdir_cache_file
unset subdir_args subdir_dots total_dir dir_part temp])dnl

View File

@ -0,0 +1,77 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
AC_DEFUN([OMPI_CONFIG_SUBDIR_ARGS],[
#
# Invoke configure in subdirectories.
#
# $1 is the name of the variable to assign the output to
#
#
# Make a list of command line args --eliminate the --srcdir and
# --cache-file args, because we need to replace them with our own
# values when invoking the sub-configure script.
#
subdirs_args=
subdirs_skip=no
eval "set x $ac_configure_args"
shift
for subdirs_arg
do
if test "$subdirs_skip" = "yes"; then
subdirs_skip=no
else
case $subdirs_arg in
-cache-file | --cache-file | -cache | --cache)
subdirs_skip=yes
;;
--config-cache | -C)
;;
-cache-file=* | --cache-file=*)
;;
-srcdir | --srcdir)
subdirs_skip=yes
;;
-srcdir=* | --srcdir=*)
;;
*)
case $subdir_arg in
*\'*) subdir_arg=`echo "$subdir_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
subdirs_args="$subdirs_args '$subdirs_arg'"
;;
esac
fi
done
#
# Assign the output
#
subdirs_str=$1=\"$subdirs_args\"
eval "$subdirs_str"
#
# Clean up
#
unset subdirs_str subdirs_skip subdirs_args subdirs_arg])dnl

View File

@ -0,0 +1,295 @@
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
AC_DEFUN([OMPI_CONFIG_THREADS],[
#
# Arguments: none
#
# Dependencies: None
#
# Modifies:
# none - see called tests
#
# configure threads
#
# create templates
AH_TEMPLATE([OMPI_HAVE_SOLARIS_THREADS],
[Do we have native Solaris threads])
AH_TEMPLATE([OMPI_HAVE_POSIX_THREADS],
[Do we have POSIX threads])
#
# Check for thread types - add your type here...
#
OMPI_CONFIG_POSIX_THREADS(HAVE_POSIX_THREADS=1, HAVE_POSIX_THREADS=0)
AC_MSG_CHECKING([for working POSIX threads package])
if test "$HAVE_POSIX_THREADS" = "1" ; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
export HAVE_POSIX_THREADS
OMPI_CONFIG_SOLARIS_THREADS(HAVE_SOLARIS_THREADS=1, HAVE_SOLARIS_THREADS=0)
AC_MSG_CHECKING([for working Solaris threads package])
if test "$HAVE_SOLARIS_THREADS" = "1" ; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
export HAVE_SOLARIS_THREADS
#
# Ask what threading we want (allow solaris / posix right now)
#
AC_MSG_CHECKING([for type of thread support])
AC_ARG_WITH(threads,
AC_HELP_STRING([--with-threads],
[Set thread type (solaris / posix)]),
[THREAD_TYPE=$withval])
if test "$THREAD_TYPE" = "solaris"; then
if test "$HAVE_SOLARIS_THREADS" = "0"; then
AC_MSG_WARN(["*** You have chosen Solaris threads, which are not"])
AC_MSG_WARN(["*** available on your system "])
AC_MSG_ERROR(["*** Can not continue"])
fi
elif test "$THREAD_TYPE" = "posix"; then
if test "$HAVE_POSIX_THREADS" = "0"; then
AC_MSG_WARN(["*** You have chosen POSIX threads, which are not"])
AC_MSG_WARN(["*** available on your system "])
AC_MSG_ERROR(["*** Can not continue"])
fi
elif test "$THREAD_TYPE" = "no"; then
THREAD_TYPE="none"
elif test -z "$THREAD_TYPE" -o "$THREAD_TYPE" = "yes"; then
# Actual logic here - properly set THREAD_TYPE - we go for system
# optimized where ever possible
case "$host" in
*solaris*)
if test "$HAVE_SOLARIS_THREADS" = "1"; then
THREAD_TYPE="solaris"
elif test "$HAVE_POSIX_THREADS" = "1"; then
THREAD_TYPE="posix"
else
THEAD_TYPE="none found"
fi
;;
*)
if test "$HAVE_POSIX_THREADS" = "1"; then
THREAD_TYPE="posix"
else
THREAD_TYPE="none found"
fi
;;
esac
else
AC_MSG_WARN(["*** You have specified a thread type that I do not"])
AC_MSG_WARN(["*** understand. Valid options are posix and solaris"])
AC_MSG_ERROR(["*** Can not continue."])
fi
AC_MSG_RESULT($THREAD_TYPE)
#
# Ok, now run the configuration for that thread package.
#
# Blah - this should be made better, but I don't know how...
#
AH_TEMPLATE([OMPI_THREADS_HAVE_DIFFERENT_PIDS],
[Do threads have different pids (pthreads on linux)])
if test "$THREAD_TYPE" = "solaris"; then
AC_DEFINE(OMPI_HAVE_SOLARIS_THREADS, 1)
AC_DEFINE(OMPI_HAVE_POSIX_THREADS, 0)
AC_DEFINE(OMPI_THREADS_HAVE_DIFFERENT_PIDS, 0)
THREAD_CFLAGS="$STHREAD_CFLAGS"
THREAD_FFLAGS="$STHREAD_FFLAGS"
THREAD_CXXFLAGS="$STHREAD_CXXFLAGS"
THREAD_CPPFLAGS="$STHREAD_CPPFLAGS"
THREAD_CXXCPPFLAGS="$STHREAD_CXXCPPFLAGS"
THREAD_LDFLAGS="$STHREAD_LDFLAGS"
THREAD_LIBS="$STHREAD_LIBS"
elif test "$THREAD_TYPE" = "posix"; then
AC_DEFINE(OMPI_HAVE_SOLARIS_THREADS, 0)
AC_DEFINE(OMPI_HAVE_POSIX_THREADS, 1)
THREAD_CFLAGS="$PTHREAD_CFLAGS"
THREAD_FFLAGS="$PTHREAD_FFLAGS"
THREAD_CXXFLAGS="$PTHREAD_CXXFLAGS"
THREAD_CPPFLAGS="$PTHREAD_CPPFLAGS"
THREAD_CXXCPPFLAGS="$PTHREAD_CXXCPPFLAGS"
THREAD_LDFLAGS="$PTHREAD_LDFLAGS"
THREAD_LIBS="$PTHREAD_LIBS"
OMPI_CHECK_PTHREAD_PIDS
else
AC_DEFINE(OMPI_HAVE_SOLARIS_THREADS, 0)
AC_DEFINE(OMPI_HAVE_POSIX_THREADS, 0)
AC_DEFINE(OMPI_THREADS_HAVE_DIFFERENT_PIDS, 0)
TRHEAD_CFLAGS=
THREAD_FFLAGS=
THREAD_CXXFLAGS=
THREAD_CPPFLAGS=
THREAD_CXXCPPFLAGS=
THREAD_LDFLAGS=
THREAD_LIBS=
if test "$THREAD_TYPE" != "none" ; then
cat <<EOF
************************************************************************
Open MPI was unable to find threading support on your system. The
OMPI development team is considering requiring threading support for
proper OMPI execution. This is in part because we are not aware of
any OpenFabrics users that do not have thread support -- so we need
you to e-mail the Open MPI Users mailing list to tell us if this is a
problem for you.
************************************************************************
EOF
fi
fi
AM_CONDITIONAL(OMPI_HAVE_POSIX_THREADS, test "$THREAD_TYPE" = "posix")
AM_CONDITIONAL(OMPI_HAVE_SOLARIS_THREADS, test "$THREAD_TYPE" = "solaris")
#
# Now configure the whole MPI and progress thread gorp
#
AC_MSG_CHECKING([if want MPI thread support])
AC_ARG_ENABLE([mpi-threads],
AC_HELP_STRING([--enable-mpi-threads],
[Enable threads for MPI applications (default: disabled)]),
[enable_mpi_threads="$enableval"])
if test "$enable_mpi_threads" = "" ; then
dnl # no argument given either way. Default to whether
dnl # we have threads or not
dnl if test "$THREAD_TYPE" != "none" ; then
dnl OMPI_ENABLE_MPI_THREADS=1
dnl enable_mpi_threads="yes"
dnl else
dnl OMPI_ENABLE_MPI_THREADS=0
dnl enable_mpi_threads="no"
dnl fi
# no argument - default to no
OMPI_ENABLE_MPI_THREADS=0
enable_mpi_threads="no"
elif test "$enable_mpi_threads" = "no" ; then
OMPI_ENABLE_MPI_THREADS=0
else
# they want MPI threads. Make sure we have threads
if test "$THREAD_TYPE" != "none" ; then
OMPI_ENABLE_MPI_THREADS=1
enable_mpi_threads="yes"
else
AC_MSG_ERROR([User requested MPI threads, but no threading model supported])
fi
fi
AC_DEFINE_UNQUOTED([OMPI_ENABLE_MPI_THREADS], [$OMPI_ENABLE_MPI_THREADS],
[Whether we should enable support for multiple user threads])
AC_MSG_RESULT([$enable_mpi_threads])
AC_MSG_CHECKING([if want asynchronous progress thread support])
AC_ARG_ENABLE([progress-threads],
AC_HELP_STRING([--enable-progress-threads],
[Enable threads asynchronous communication progress (default: disabled)]),
[enable_progress_threads="$enableval"])
if test "$enable_progress_threads" = "" ; then
# no argument given either way. Default to no.
OMPI_ENABLE_PROGRESS_THREADS=0
enable_progress_threads="no"
elif test "$enable_progress_threads" = "no" ; then
OMPI_ENABLE_PROGRESS_THREADS=0
enable_progress_threads="no"
else
# they want threaded progress
if test "$THREAD_TYPE" != "none" ; then
OMPI_ENABLE_PROGRESS_THREADS=1
enable_progress_threads="yes"
else
AC_MSG_ERROR([User requested progress threads, but no threading model supported])
fi
fi
AC_DEFINE_UNQUOTED([OMPI_ENABLE_PROGRESS_THREADS], [$OMPI_ENABLE_PROGRESS_THREADS],
[Whether we should use progress threads rather than polling])
AC_MSG_RESULT([$enable_progress_threads])
#
# Fault Tolerance Thread
#
# --enable-ft-thread
# #if OPAL_ENABLE_FT_THREAD == 0 /* Disabled */
# #if OPAL_ENABLE_FT_THREAD == 1 /* Enabled */
#
AC_MSG_CHECKING([if want fault tolerance thread])
AC_ARG_ENABLE([ft_thread],
[AC_HELP_STRING([--disable-ft-thread],
[Disable fault tolerance thread running inside all processes. Requires progress and/or MPI threads (default: enabled)])],
[enable_ft_thread="$enableval"],
[enable_ft_thread="undef"])
# if they do not want FT support, then they do not want this thread either
if test "$ompi_want_ft" = "0"; then
ompi_want_ft_thread=0
AC_MSG_RESULT([Disabled (fault tolerance disabled --without-ft)])
# if --disable-ft-thread
elif test "$enable_ft_thread" = "no"; then
ompi_want_ft_thread=0
AC_MSG_RESULT([Disabled])
# if default, and no progress or MPI threads
elif test "$enable_ft_thread" = "undef" -a "$enable_progress_threads" = "no" -a "$enable_mpi_threads" = "no" ; then
ompi_want_ft_thread=0
AC_MSG_RESULT([Disabled (Progress and MPI Threads Disabled)])
# if default, and either progress or MPI threads enabled
else
# Default: Enable
# Make sure we have at least Progress Threads or MPI Threads enabled
if test "$enable_progress_threads" = "no" -a "$enable_mpi_threads" = "no"; then
AC_MSG_RESULT([Must enable progress or MPI threads to use this option])
AC_MSG_ERROR([Cannot continue])
else
AC_MSG_RESULT([yes])
ompi_want_ft_thread=1
AC_MSG_WARN([**************************************************])
AC_MSG_WARN([*** Fault Tolerance with a thread in Open MPI *])
AC_MSG_WARN([*** is an experimental, research quality option. *])
AC_MSG_WARN([*** It requires progress or MPI threads, and *])
AC_MSG_WARN([*** care should be used when enabling these *])
AC_MSG_WARN([*** options. *])
AC_MSG_WARN([**************************************************])
fi
fi
AC_DEFINE_UNQUOTED([OPAL_ENABLE_FT_THREAD], [$ompi_want_ft_thread],
[Enable fault tolerance thread in Open PAL])
AM_CONDITIONAL(WANT_FT_THREAD, test "$ompi_want_ft_thread" = "1")
])dnl

View File

@ -0,0 +1,704 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2006-2008 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
AC_DEFUN([OMPI_CONFIGURE_OPTIONS],[
ompi_show_subtitle "Configuration options"
#
# Is this a developer copy?
#
if test -d .svn -o -d .hg; then
OMPI_DEVEL=1
else
OMPI_DEVEL=0
fi
#
# Code coverage options
#
AC_MSG_CHECKING([whether to run code coverage])
AC_ARG_ENABLE(coverage,
AC_HELP_STRING([--enable-coverage],
[enable code coverage files to be generated]))
if test "$enable_coverage" = "yes"; then
if test "$enable_shared" = "yes"; then
AC_MSG_WARN([Code coverage can run only with static libraries. Please
run configure with --enable-static --disable-shared if
you want code coverage. Also ensure that you execute
make clean too ensure removal of all leftover shared
mpi libraries])
AC_MSG_ERROR([Cannot continue processing])
fi
AC_MSG_RESULT([yes])
WANT_COVERAGE=1
else
AC_MSG_RESULT([no])
WANT_COVERAGE=0
fi
#
# Branch Probabilities options
#
AC_MSG_CHECKING([whether to compile with branch probabilities])
AC_ARG_ENABLE(branch-probabilities,
AC_HELP_STRING([--enable-branch-probabilities],
[enable profile arcs and branch probability optimization]))
if test "$enable_branch_probabilities" = "yes"; then
AC_MSG_RESULT([yes])
WANT_BRANCH_PROBABILITIES=1
else
AC_MSG_RESULT([no])
WANT_BRANCH_PROBABILITIES=0
fi
#
# Memory debugging
#
AC_MSG_CHECKING([whether to debug memory usage])
AC_ARG_ENABLE(mem-debug,
AC_HELP_STRING([--enable-mem-debug],
[enable memory debugging (debugging only) (default: disabled)]))
if test "$enable_mem_debug" = "yes"; then
AC_MSG_RESULT([yes])
WANT_MEM_DEBUG=1
else
AC_MSG_RESULT([no])
WANT_MEM_DEBUG=0
fi
#################### Early development override ####################
if test "$WANT_MEM_DEBUG" = "0" -a -z "$enable_mem_debug" -a "$OMPI_DEVEL" = 1; then
WANT_MEM_DEBUG=1
echo "--> developer override: enable mem profiling by default"
fi
#################### Early development override ####################
AC_DEFINE_UNQUOTED(OMPI_ENABLE_MEM_DEBUG, $WANT_MEM_DEBUG,
[Whether we want the memory profiling or not])
#
# Memory profiling
#
AC_MSG_CHECKING([whether to profile memory usage])
AC_ARG_ENABLE(mem-profile,
AC_HELP_STRING([--enable-mem-profile],
[enable memory profiling (debugging only) (default: disabled)]))
if test "$enable_mem_profile" = "yes"; then
AC_MSG_RESULT([yes])
WANT_MEM_PROFILE=1
else
AC_MSG_RESULT([no])
WANT_MEM_PROFILE=0
fi
#################### Early development override ####################
if test "$WANT_MEM_PROFILE" = "0" -a -z "$enable_mem_profile" -a "$OMPI_DEVEL" = 1; then
WANT_MEM_PROFILE=1
echo "--> developer override: enable mem profiling by default"
fi
#################### Early development override ####################
AC_DEFINE_UNQUOTED(OMPI_ENABLE_MEM_PROFILE, $WANT_MEM_PROFILE,
[Whether we want the memory profiling or not])
#
# Developer picky compiler options
#
AC_MSG_CHECKING([if want developer-level compiler pickyness])
AC_ARG_ENABLE(picky,
AC_HELP_STRING([--enable-picky],
[enable developer-level compiler pickyness when building Open MPI (default: disabled)]))
if test "$enable_picky" = "yes"; then
AC_MSG_RESULT([yes])
WANT_PICKY_COMPILER=1
else
AC_MSG_RESULT([no])
WANT_PICKY_COMPILER=0
fi
#################### Early development override ####################
if test "$WANT_PICKY_COMPILER" = "0" -a -z "$enable_picky" -a "$OMPI_DEVEL" = 1; then
WANT_PICKY_COMPILER=1
echo "--> developer override: enable picky compiler by default"
fi
#################### Early development override ####################
#
# Developer debugging
#
AC_MSG_CHECKING([if want developer-level debugging code])
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug],
[enable developer-level debugging code (not for general MPI users!) (default: disabled)]))
if test "$enable_debug" = "yes"; then
AC_MSG_RESULT([yes])
WANT_DEBUG=1
else
AC_MSG_RESULT([no])
WANT_DEBUG=0
fi
#################### Early development override ####################
if test "$WANT_DEBUG" = "0" -a -z "$enable_debug" -a "$OMPI_DEVEL" = 1; then
WANT_DEBUG=1
echo "--> developer override: enable debugging code by default"
fi
#################### Early development override ####################
if test "$WANT_DEBUG" = "0"; then
CFLAGS="-DNDEBUG $CFLAGS"
CXXFLAGS="-DNDEBUG $CXXFLAGS"
fi
AC_DEFINE_UNQUOTED(OMPI_ENABLE_DEBUG, $WANT_DEBUG,
[Whether we want developer-level debugging code or not])
AC_ARG_ENABLE(debug-symbols,
AC_HELP_STRING([--disable-debug-symbols],
[Disable adding compiler flags to enable debugging symbols if --enable-debug is specified. For non-debugging builds, this flag has no effect.]))
#
# Sparse Groups
#
AC_MSG_CHECKING([if want sparse process groups])
AC_ARG_ENABLE(sparse-groups,
AC_HELP_STRING([--enable-sparse-groups],
[enable sparse process groups (default: not enabled)]))
if test "$enable_sparse_groups" = "yes"; then
AC_MSG_RESULT([yes])
GROUP_SPARSE=1
else
AC_MSG_RESULT([no])
GROUP_SPARSE=0
fi
AC_DEFINE_UNQUOTED([OMPI_GROUP_SPARSE],$GROUP_SPARSE,
[Wether we want sparse process groups])
#
# Fortran 77
#
AC_MSG_CHECKING([if want Fortran 77 bindings])
AC_ARG_ENABLE(mpi-f77,
AC_HELP_STRING([--enable-mpi-f77],
[enable f77 MPI bindings (default: enabled)]))
if test "$enable_mpi_f77" != "no"; then
AC_MSG_RESULT([yes])
OMPI_WANT_F77_BINDINGS=1
else
AC_MSG_RESULT([no])
OMPI_WANT_F77_BINDINGS=0
fi
#
# Fortran 90
#
AC_MSG_CHECKING([if want Fortran 90 bindings])
AC_ARG_ENABLE(mpi-f90,
AC_HELP_STRING([--enable-mpi-f90],
[enable f90 MPI bindings (default: enabled)]))
if test "$enable_mpi_f90" != "no"; then
AC_MSG_RESULT([yes])
OMPI_WANT_F90_BINDINGS=1
else
AC_MSG_RESULT([no])
OMPI_WANT_F90_BINDINGS=0
fi
AC_MSG_CHECKING([desired Fortran 90 bindings "size"])
AC_ARG_WITH(mpi-f90-size,
AC_HELP_STRING([--with-mpi-f90-size=SIZE],
[specify the types of functions in the Fortran 90 MPI module, where SIZE is one of: trivial (MPI-2 F90-specific functions only), small (trivial + all MPI functions without choice buffers), medium (small + all MPI functions with one choice buffer), large (medium + all MPI functions with 2 choice buffers, but only when both buffers are the same type). Default SIZE is "small".]))
if test "$OMPI_WANT_F90_BINDINGS" = "0"; then
AC_MSG_RESULT([disabled (Fortran 90 bindings disabled)])
elif test "$with_mpi_f90_size" = "no"; then
OMPI_WANT_F90_BINDINGS=0
AC_MSG_RESULT([disabling F90 MPI module (used specified)])
else
# Default value
if test "$with_mpi_f90_size" = ""; then
with_mpi_f90_size=small
fi
# Check for each of the sizes
if test "$with_mpi_f90_size" = "trivial"; then
OMPI_F90_BUILD_SIZE=trivial
elif test "$with_mpi_f90_size" = "small"; then
OMPI_F90_BUILD_SIZE=small
elif test "$with_mpi_f90_size" = "medium"; then
OMPI_F90_BUILD_SIZE=medium
elif test "$with_mpi_f90_size" = "large"; then
OMPI_F90_BUILD_SIZE=large
else
AC_MSG_RESULT([Unrecognized size: $with_mpi_f90_size])
AC_MSG_ERROR([Cannot continue])
fi
fi
AM_CONDITIONAL([OMPI_WANT_BUILD_F90_TRIVIAL],
[test "$OMPI_F90_BUILD_SIZE" = "trivial"])
AM_CONDITIONAL([OMPI_WANT_BUILD_F90_SMALL],
[test "$OMPI_F90_BUILD_SIZE" = "small"])
AM_CONDITIONAL([OMPI_WANT_BUILD_F90_MEDIUM],
[test "$OMPI_F90_BUILD_SIZE" = "medium"])
AM_CONDITIONAL([OMPI_WANT_BUILD_F90_LARGE],
[test "$OMPI_F90_BUILD_SIZE" = "large"])
AC_SUBST(OMPI_F90_BUILD_SIZE)
AC_MSG_RESULT([$OMPI_F90_BUILD_SIZE])
#
# MPI profiling
#
AC_MSG_CHECKING([whether to enable PMPI])
AC_ARG_ENABLE(mpi-profile,
AC_HELP_STRING([--enable-mpi-profile],
[enable MPI profiling (default: enabled)]))
if test "$enable_mpi_profile" != "no"; then
AC_MSG_RESULT([yes])
WANT_MPI_PROFILING=1
MPIF_H_PMPI_W_FUNCS=", PMPI_WTICK, PMPI_WTIME"
else
AC_MSG_RESULT([no])
WANT_MPI_PROFILING=0
MPIF_H_PMPI_W_FUNCS=
fi
AC_SUBST(MPIF_H_PMPI_W_FUNCS)
#
# C++
#
AC_MSG_CHECKING([if want C++ bindings])
AC_ARG_ENABLE(mpi-cxx,
AC_HELP_STRING([--enable-mpi-cxx],
[enable C++ MPI bindings (default: enabled)]))
if test "$enable_mpi_cxx" != "no"; then
AC_MSG_RESULT([yes])
WANT_MPI_CXX_SUPPORT=1
else
AC_MSG_RESULT([no])
WANT_MPI_CXX_SUPPORT=0
fi
AC_MSG_CHECKING([if want MPI::SEEK_SET support])
AC_ARG_ENABLE([mpi-cxx-seek],
[AC_HELP_STRING([--enable-mpi-cxx-seek],
[enable support for MPI::SEEK_SET, MPI::SEEK_END, and MPI::SEEK_POS in C++ bindings (default: enabled)])])
if test "$enable_mpi_cxx_seek" != "no" ; then
AC_MSG_RESULT([yes])
OMPI_WANT_MPI_CXX_SEEK=1
else
AC_MSG_RESULT([no])
OMPI_WANT_MPI_CXX_SEEK=0
fi
AC_DEFINE_UNQUOTED([OMPI_WANT_MPI_CXX_SEEK], [$OMPI_WANT_MPI_CXX_SEEK],
[do we want to try to work around C++ bindings SEEK_* issue?])
#
# Do we want to disable weak symbols for some reason?
#
AC_MSG_CHECKING([if want to enable weak symbol support])
AC_ARG_ENABLE(weak-symbols,
AC_HELP_STRING([--enable-weak-symbols],
[use weak symbols, if available (default: enabled)]))
if test "$enable_weak_symbols" != "no"; then
AC_MSG_RESULT([yes])
WANT_WEAK_SYMBOLS=1
else
AC_MSG_RESULT([no])
WANT_WEAK_SYMBOLS=0
fi
#
# Do we want to disable MPI parameter checking at run-time?
#
AC_MSG_CHECKING([if want run-time MPI parameter checking])
AC_ARG_WITH(mpi-param-check,
AC_HELP_STRING([--with-mpi-param-check(=VALUE)],
[behavior of MPI function parameter checking. Valid values are: always, never, runtime. If --with-mpi-param-check is specified with no VALUE argument, it is equivalent to a VALUE of "always"; --without-mpi-param-check is equivalent to "never" (default: runtime).]))
mpi_param_check=ompi_mpi_param_check
if test "$with_mpi_param_check" = "no" -o \
"$with_mpi_param_check" = "never"; then
mpi_param_check=0
AC_MSG_RESULT([never])
elif test "$with_mpi_param_check" = "yes" -o \
"$with_mpi_param_check" = "always"; then
mpi_param_check=1
AC_MSG_RESULT([always])
elif test "$with_mpi_param_check" = "runtime" -o \
-z "$with_mpi_params_check"; then
AC_MSG_RESULT([runtime])
else
AC_MSG_RESULT([unknown])
AC_MSG_WARN([*** Unrecognized --with-mpi-param-check value])
AC_MSG_WARN([*** See "configure --help" output])
AC_MSG_WARN([*** Defaulting to "runtime"])
fi
AC_DEFINE_UNQUOTED(MPI_PARAM_CHECK, $mpi_param_check,
[Whether we want to check MPI parameters always, never, or decide at run-time])
#
# Do we want to install all of OMPI's header files?
#
AC_MSG_CHECKING([if want to install OMPI header files])
AC_ARG_WITH(devel-headers,
AC_HELP_STRING([--with-devel-headers],
[normal MPI users/applications do not need this (mpi.h and mpif.h are ALWAYS installed). Developer headers are only necessary for MCA module authors (default: disabled).]))
if test "$with_devel_headers" = "yes"; then
AC_MSG_RESULT([yes])
WANT_INSTALL_HEADERS=1
else
AC_MSG_RESULT([no])
WANT_INSTALL_HEADERS=0
fi
AM_CONDITIONAL(WANT_INSTALL_HEADERS, test "$WANT_INSTALL_HEADERS" = 1)
#
# Do we want the pretty-print stack trace feature?
#
AC_MSG_CHECKING([if want pretty-print stacktrace])
AC_ARG_ENABLE([pretty-print-stacktrace],
[AC_HELP_STRING([--enable-pretty-print-stacktrace],
[Pretty print stacktrace on process signal (default: enabled)])])
if test "$enable_pretty_print_stacktrace" = "no" ; then
AC_MSG_RESULT([no])
WANT_PRETTY_PRINT_STACKTRACE=0
else
AC_MSG_RESULT([yes])
WANT_PRETTY_PRINT_STACKTRACE=1
fi
AC_DEFINE_UNQUOTED([OMPI_WANT_PRETTY_PRINT_STACKTRACE],
[$WANT_PRETTY_PRINT_STACKTRACE],
[if want pretty-print stack trace feature])
#
# Do we want to enable peruse interface?
#
AC_MSG_CHECKING([if peruse support is required])
AC_ARG_ENABLE(peruse,
AC_HELP_STRING([--enable-peruse],
[Support PERUSE interface (default: disabled)]))
if test "$enable_peruse" = "yes"; then
AC_MSG_RESULT([yes])
WANT_PERUSE=1
else
AC_MSG_RESULT([no])
WANT_PERUSE=0
fi
AC_DEFINE_UNQUOTED([OMPI_WANT_PERUSE],
[$WANT_PERUSE],
[if the peruse interface should be enabled])
AM_CONDITIONAL(WANT_PERUSE, test "$WANT_PERUSE" = "1")
#
# What is the max array rank that we want to support in the f90 bindings?
#
OMPI_FORTRAN_MAX_ARRAY_RANK=4
AC_MSG_CHECKING([max supported array dimension in F90 MPI bindings])
AC_ARG_WITH(f90-max-array-dim,
AC_HELP_STRING([--with-f90-max-array-dim=<DIM>],
[The maximum array dimension supported in the F90 MPI bindings (default: $OMPI_FORTRAN_MAX_ARRAY_RANK).]))
if test ! -z "$with_f90_max_array_dim" -a "$with_f90_max_array_dim" != "no"; then
# Ensure it's a number; hopefully a integer...
expr $with_f90_max_array_dim + 1 > /dev/null 2> /dev/null
if test "$?" = "0"; then
OMPI_FORTRAN_MAX_ARRAY_RANK="$with_f90_max_array_dim"
fi
fi
AC_MSG_RESULT([$OMPI_FORTRAN_MAX_ARRAY_RANK])
AC_SUBST(OMPI_FORTRAN_MAX_ARRAY_RANK)
# do we want PTY support?
AC_MSG_CHECKING([if pty support should be enabled])
AC_ARG_ENABLE(pty-support,
AC_HELP_STRING([--enable-pty-support],
[Enable/disable PTY support for STDIO forwarding. (default: enabled)]))
if test "$enable_pty_support" = "no" ; then
AC_MSG_RESULT([no])
OMPI_ENABLE_PTY_SUPPORT=0
else
AC_MSG_RESULT([yes])
OMPI_ENABLE_PTY_SUPPORT=1
fi
AC_DEFINE_UNQUOTED([OMPI_ENABLE_PTY_SUPPORT], [$OMPI_ENABLE_PTY_SUPPORT],
[Whether user wants PTY support or not])
#
# Do we want to allow DLOPEN?
#
AC_MSG_CHECKING([if user wants dlopen support])
AC_ARG_ENABLE([dlopen],
[AC_HELP_STRING([--enable-dlopen],
[Whether build should attempt to use dlopen (or
similar) to dynamically load components.
Disabling dlopen implies --disable-mca-dso.
(default: enabled)])])
if test "$enable_dlopen" = "no" ; then
enable_mca_dso="no"
enable_mca_static="yes"
OMPI_ENABLE_DLOPEN_SUPPORT=0
AC_MSG_RESULT([no])
else
OMPI_ENABLE_DLOPEN_SUPPORT=1
AC_MSG_RESULT([yes])
fi
#
# Heterogeneous support
#
AC_MSG_CHECKING([if heterogeneous support should be enabled])
AC_ARG_ENABLE([heterogeneous],
[AC_HELP_STRING([--enable-heterogeneous],
[Enable features required for heterogeneous
platform support (default: disabled)])])
if test "$enable_heterogeneous" = "yes" ; then
AC_MSG_RESULT([yes])
ompi_want_heterogeneous=1
else
AC_MSG_RESULT([no])
ompi_want_heterogeneous=0
fi
AC_DEFINE_UNQUOTED([OMPI_ENABLE_HETEROGENEOUS_SUPPORT],
[$ompi_want_heterogeneous],
[Enable features required for heterogeneous support])
#
# Internal trace file logging (debugging)
#
AC_MSG_CHECKING([if want trace file debugging])
AC_ARG_ENABLE([trace],
[AC_HELP_STRING([--enable-trace],
[Enable internal tracing of OMPI/ORTE/OPAL calls -- used only for developer debugging, not tracing of MPI applications (default: disabled)])])
if test "$enable_trace" = "yes"; then
AC_MSG_RESULT([yes])
opal_want_trace=1
else
AC_MSG_RESULT([no])
opal_want_trace=0
fi
AC_DEFINE_UNQUOTED([OPAL_ENABLE_TRACE], [$opal_want_trace],
[Enable run-time tracing of internal functions])
#
# Minimal RTE support
#
AC_MSG_CHECKING([if want full RTE support])
AC_ARG_WITH([rte-support],
[AC_HELP_STRING([--without-rte-support],
[Build without RTE support for systems that do not require it (default: full RTE support built)])])
if test "$with_rte_support" = "no"; then
AC_MSG_RESULT([no])
orte_without_full_support=1
list_of_frameworks="errmgr,ess-singleton,ess-hnp,ess-tool,ess-env,filem,grpcomm-basic,grpcomm-bad,iof,odls,oob,plm,ras,rmaps,rml,routed,snapc,btl-sm,coll-sm,common-sm,mpool-sm,dpm-orte,pubsub-orte"
if test -z $enable_mca_no_build ; then
enable_mca_no_build="$list_of_frameworks"
else
enable_mca_no_build="$enable_mca_no_build,$list_of_frameworks"
fi
else
AC_MSG_RESULT([yes])
orte_without_full_support=0
fi
AC_DEFINE_UNQUOTED([ORTE_DISABLE_FULL_SUPPORT], [$orte_without_full_support],
[Build full RTE support])
AM_CONDITIONAL(ORTE_DISABLE_FULL_SUPPORT, test "$with_rte_support" = "no")
#
# Cross-compile data
#
AC_ARG_WITH([cross],
[AC_HELP_STRING([--with-cross=FILE],
[Specify configure values that can not be determined in a cross-compilation environment. See the Open MPI FAQ.])])
if test "$with_cross" = "yes" ; then
AC_MSG_ERROR([--with-cross argument must include FILE option])
elif test "$with_cross" = "no" ; then
AC_MSG_ERROR([--without-cross is not a valid argument])
elif test "$with_cross" != "" ; then
if test ! -r $with_cross ; then
AC_MSG_ERROR([could not find cross-compile data file $with_cross])
fi
# eval into environment
OMPI_LOG_MSG([Loading cross-compile file $with_cross, with contents below])
OMPI_LOG_FILE([$with_cross])
. "$with_cross"
fi
#
# --with-ft=TYPE
# TYPE:
# - LAM (synonym for 'cr' currently)
# - cr
# /* General FT sections */
# #if OPAL_ENABLE_FT == 0 /* FT Disabled globaly */
# #if OPAL_ENABLE_FT == 1 /* FT Enabled globaly */
# /* CR Specific sections */
# #if OPAL_ENABLE_FT_CR == 0 /* FT Ckpt/Restart Disabled */
# #if OPAL_ENABLE_FT_CR == 1 /* FT Ckpt/Restart Enabled */
#
AC_MSG_CHECKING([if want fault tolerance])
AC_ARG_WITH(ft,
[AC_HELP_STRING([--with-ft=TYPE],
[Specify the type of fault tolerance to enable. Options: LAM (LAM/MPI-like), cr (Checkpoint/Restart) (default: disabled)])],
[ompi_want_ft=1],
[ompi_want_ft=0])
if test "$with_ft" = "no" -o "$ompi_want_ft" = "0"; then
ompi_want_ft=0
ompi_want_ft_cr=0
AC_MSG_RESULT([Disabled fault tolerance])
else
ompi_want_ft=1
ompi_want_ft_cr=0
ompi_want_ft_type=none
# Default value
if test "$with_ft" = "" -o "$with_ft" = "yes"; then
ompi_want_ft_type=cr
ompi_want_ft_cr=1
elif test "$with_ft" = "LAM"; then
ompi_want_ft_type=lam
ompi_want_ft_cr=1
elif test "$with_ft" = "lam"; then
ompi_want_ft_type=lam
ompi_want_ft_cr=1
elif test "$with_ft" = "CR"; then
ompi_want_ft_type=cr
ompi_want_ft_cr=1
elif test "$with_ft" = "cr"; then
ompi_want_ft_type=cr
ompi_want_ft_cr=1
else
AC_MSG_RESULT([Unrecognized FT TYPE: $with_ft])
AC_MSG_ERROR([Cannot continue])
fi
AC_MSG_RESULT([Enabled $with_ft ($ompi_want_ft_type)])
AC_MSG_WARN([**************************************************])
AC_MSG_WARN([*** Fault Tolerance Integration into Open MPI is *])
AC_MSG_WARN([*** a research quality implementation, and care *])
AC_MSG_WARN([*** should be used when choosing to enable it. *])
AC_MSG_WARN([**************************************************])
fi
AC_DEFINE_UNQUOTED([OPAL_ENABLE_FT], [$ompi_want_ft],
[Enable fault tolerance general components and logic])
AC_DEFINE_UNQUOTED([OPAL_ENABLE_FT_CR], [$ompi_want_ft_cr],
[Enable fault tolerance checkpoint/restart components and logic])
AM_CONDITIONAL(WANT_FT, test "$ompi_want_ft" = "1")
#
# Do we want to install binaries?
#
AC_ARG_ENABLE([binaries],
[AC_HELP_STRING([--enable-binaries],
[Build and install binaries required for Open MPI, such as the wrapper compilers. Useful for multi-lib installations. (default: enabled)])])
AM_CONDITIONAL([OMPI_INSTALL_BINARIES], [test "$enable_binaries" != "no"])
AC_ARG_ENABLE([script-wrapper-compilers],
[AC_HELP_STRING([--enable-script-wrapper-compilers],
[Use less featured script-based wrapper compilers instead of the standard C-based wrapper compilers. This option ignores the --disable-binaries option and is mainly useful in cross-compile environments])])
AM_CONDITIONAL([OMPI_WANT_SCRIPT_WRAPPER_COMPILERS],
[test "$enable_script_wrapper_compilers" = "yes"])
AC_CONFIG_FILES([ompi/tools/wrappers/ompi_wrapper_script], [chmod +x ompi/tools/wrappers/ompi_wrapper_script])
#
# Do we want to disable IPv6 support?
#
AC_MSG_CHECKING([if want IPv6 support])
AC_ARG_ENABLE([ipv6],
[AC_HELP_STRING([--disable-ipv6],
[Disable IPv6 support (default: enabled, but only if the underlying system supports it)])])
if test "$enable_ipv6" = "no"; then
AC_MSG_RESULT([no])
opal_want_ipv6=0
else
AC_MSG_RESULT([yes (if underlying system supports it)])
opal_want_ipv6=1
fi
AC_DEFINE_UNQUOTED([OPAL_ENABLE_IPV6], [$opal_want_ipv6],
[Enable IPv6 support, but only if the underlying system supports it])
#
# Do we want orterun's --prefix behavior to be enabled by default?
#
AC_MSG_CHECKING([if want orterun "--prefix" behavior to be enabled by default])
AC_ARG_ENABLE([orterun-prefix-by-default],
[AC_HELP_STRING([--enable-orterun-prefix-by-default],
[Make "orterun ..." behave exactly the same as "orterun --prefix \$prefix" (where \$prefix is the value given to --prefix in configure)])])
AC_ARG_ENABLE([mpirun-prefix-by-default],
[AC_HELP_STRING([--enable-mpirun-prefix-by-default],
[Synonym for --enable-orterun-prefix-by-default])])
if test "$enable_orterun_prefix_by_default" = ""; then
enable_orterun_prefix_by_default=$enable_mpirun_prefix_by_default
fi
if test "$enable_orterun_prefix_by_default" = "yes"; then
AC_MSG_RESULT([yes])
orte_want_orterun_prefix_by_default=1
else
AC_MSG_RESULT([no])
orte_want_orterun_prefix_by_default=0
fi
AC_DEFINE_UNQUOTED([ORTE_WANT_ORTERUN_PREFIX_BY_DEFAULT],
[$orte_want_orterun_prefix_by_default],
[Whether we want orterun to effect "--prefix $prefix" by default])
#
# Package/brand string
#
AC_MSG_CHECKING([for package/brand string])
AC_ARG_WITH([package-string],
[AC_HELP_STRING([--with-package-string=STRING],
[Use a branding string throughout Open MPI])])
if test "$with_package_string" = "" -o "$with_package_string" = "no"; then
with_package_string="Open MPI $OMPI_CONFIGURE_USER@$OMPI_CONFIGURE_HOST Distribution"
fi
AC_DEFINE_UNQUOTED([OPAL_PACKAGE_STRING], ["$with_package_string"],
[package/branding string for Open MPI])
AC_MSG_RESULT([$with_package_string])
#
# Ident string
#
AC_MSG_CHECKING([for ident string])
AC_ARG_WITH([ident-string],
[AC_HELP_STRING([--with-ident-string=STRING],
[Embed an ident string into Open MPI object files])])
if test "$with_ident_string" = "" -o "$with_ident_string" = "no"; then
with_ident_string="%VERSION%"
fi
with_ident_string="`echo $with_ident_string | sed -e 's/%VERSION%/'$OMPI_VERSION/`"
AC_DEFINE_UNQUOTED([OPAL_IDENT_STRING], ["$with_ident_string"],
[ident string for Open MPI])
AC_MSG_RESULT([$with_ident_string])
])

119
config/ompi_contrib.m4 Normal file
View File

@ -0,0 +1,119 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2007-2008 Cisco, Inc. All rights reserved.
dnl Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
######################################################################
#
# OMPI_CONTRIB
#
# configure the contributed software components. Currently fairly
# hard-wired, but someday should be much more like OMPI_MCA. See
# https://svn.open-mpi.org/trac/ompi/ticket/1162.
#
# USAGE:
# OMPI_CONTRIB()
#
######################################################################
AC_DEFUN([OMPI_CONTRIB],[
dnl for OMPI_CONFIGURE_USER env variable
AC_REQUIRE([OMPI_CONFIGURE_SETUP])
# Option to not build some of the contributed software packages
AC_ARG_ENABLE([contrib-no-build],
[AC_HELP_STRING([--enable-contrib-no-build=LIST],
[Comma-separated list of contributed package NAMEs that will not be built. Example: "--enable-contrib-no-build=libnbc,vt" will disable building both the "libnbc" and "vt" contributed software packages.])])
# Parse the list to see what we should not build
ompi_show_subtitle "Configuring contributed software packages"
AC_MSG_CHECKING([which contributed software packages should be disabled])
if test "$enable_contrib_no_build" = "yes"; then
AC_MSG_RESULT([yes])
AC_MSG_ERROR([*** The enable-contrib-no-build flag requires an explicit list
*** of packages to not build. For example, --enable-contrib-no-build=vt])
else
ifs_save="$IFS"
IFS="${IFS}$PATH_SEPARATOR,"
msg=
for item in $enable_contrib_no_build; do
str="`echo DISABLE_contrib_${item}=1 | sed s/-/_/g`"
eval $str
msg="$item $msg"
done
IFS="$ifs_save"
fi
AC_MSG_RESULT([$msg])
unset msg
# List of contrib subdirs to traverse into
OMPI_CONTRIB_SUBDIRS=
OMPI_CONTRIB_DIST_SUBDIRS=
# Cycle through each of the hard-coded software packages and
# configure them if not disabled. May someday be expanded to have
# autogen find the packages instead of this hard-coded list
# (https://svn.open-mpi.org/trac/ompi/ticket/1162).
# m4_define([contrib_software_list], [libnbc, vt])
m4_define([contrib_software_list], [vt])
m4_foreach(software, [contrib_software_list],
[m4_include([ompi/contrib/]software[/configure.m4])
_OMPI_CONTRIB_CONFIGURE(software)])
# Setup the top-level glue
AC_SUBST(OMPI_CONTRIB_SUBDIRS)
AC_SUBST(OMPI_CONTRIB_DIST_SUBDIRS)
])dnl
######################################################################
#
# _OMPI_CONTRIB_SOFTWARE
#
# Setup a specific contributed software package. This is a subroutine
# because the work to setup each package is essentially the same.
# Currently assumes that there is a configure.m4 file in the
# contributed software directory. May someday be expanded to handle
# other things.
#
# USAGE:
# _OMPI_CONTRIB_SOFTARE([package_name])
#
######################################################################
AC_DEFUN([_OMPI_CONTRIB_CONFIGURE],[
ompi_show_subsubsubtitle "$1 (m4 configuration macro)"
OMPI_CONTRIB_HAPPY=0
if test "$DISABLE_contrib_$1" = "" -a "$DISABLE_contrib_all" = ""; then
OMPI_contrib_$1_CONFIG([OMPI_CONTRIB_HAPPY=1], [])
AC_MSG_CHECKING([if contributed component $1 can compile])
if test "$OMPI_CONTRIB_HAPPY" = "1"; then
OMPI_CONTRIB_SUBDIRS="$OMPI_CONTRIB_SUBDIRS contrib/$1"
OMPI_CONTRIB_DIST_SUBDIRS="$OMPI_CONTRIB_DIST_SUBDIRS contrib/$1"
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
else
AC_MSG_NOTICE([disabled via command line switch])
fi
AC_DEFINE_UNQUOTED(OMPI_ENABLE_CONTRIB_$1, [$OMPI_CONTRIB_HAPPY],
[Enable contributed software package $1])
unset OMPI_CONTRIB_HAPPY
])dnl

58
config/ompi_find_type.m4 Normal file
View File

@ -0,0 +1,58 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OMPI_FIND_TYPE(type, [list of c types], abort if not found,
# target size, variable to set)
# -----------------------------------------------------------
AC_DEFUN([OMPI_FIND_TYPE],[
AS_VAR_PUSHDEF([type_var], [ompi_cv_find_type_$1])
oft_abort_on_fail="$3"
oft_target_size="$4"
AC_CACHE_CHECK([for C type corresponding to $1], type_var,
[ # Loop over all the types handed to us
oft_real_type=
AS_IF([test "$oft_target_size" != ""],
[m4_foreach(oft_type, [$2],
[if test -z "$oft_real_type"; then
if test "[$ac_cv_sizeof_]m4_bpatsubst(oft_type, [[^a-zA-Z0-9_]], [_])" = "$oft_target_size" ; then
oft_real_type="oft_type"
fi
fi
])])
AS_IF([test -z "$oft_real_type"],
[AS_VAR_SET(type_var, "not found")],
[AS_VAR_SET(type_var, "$oft_real_type")])])
AS_IF([test "AS_VAR_GET(type_var)" = "not found"],
[AC_MSG_WARN([*** Did not find corresponding C type])
AS_IF([test "$oft_abort_on_fail" != "no"],
[AC_MSG_ERROR([Cannot continue])])])
if test "AS_VAR_GET(type_var)" = "not found" ; then
$5=
else
$5=AS_VAR_GET(type_var)
fi
unset oft_real_type oft_target_size
AS_VAR_POPDEF([type_var])dnl
])dnl

358
config/ompi_functions.m4 Normal file
View File

@ -0,0 +1,358 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
AC_DEFUN([OMPI_CONFIGURE_SETUP],[
# Some helper script functions. Unfortunately, we cannot use $1 kinds
# of arugments here because of the m4 substitution. So we have to set
# special variable names before invoking the function. :-\
ompi_show_title() {
cat <<EOF
============================================================================
== ${1}
============================================================================
EOF
}
ompi_show_subtitle() {
cat <<EOF
*** ${1}
EOF
}
ompi_show_subsubtitle() {
cat <<EOF
+++ ${1}
EOF
}
ompi_show_subsubsubtitle() {
cat <<EOF
--- ${1}
EOF
}
#
# Save some stats about this build
#
OMPI_CONFIGURE_USER="`whoami`"
OMPI_CONFIGURE_HOST="`hostname | head -n 1`"
OMPI_CONFIGURE_DATE="`date`"
#
# Save these details so that they can be used in ompi_info later
#
AC_SUBST(OMPI_CONFIGURE_USER)
AC_SUBST(OMPI_CONFIGURE_HOST)
AC_SUBST(OMPI_CONFIGURE_DATE)])dnl
dnl #######################################################################
dnl #######################################################################
dnl #######################################################################
AC_DEFUN([OMPI_BASIC_SETUP],[
#
# Save some stats about this build
#
OMPI_CONFIGURE_USER="`whoami`"
OMPI_CONFIGURE_HOST="`hostname | head -n 1`"
OMPI_CONFIGURE_DATE="`date`"
#
# Make automake clean emacs ~ files for "make clean"
#
CLEANFILES="*~ .\#*"
AC_SUBST(CLEANFILES)
#
# This is useful later (ompi_info, and therefore mpiexec)
#
AC_CANONICAL_HOST
AC_DEFINE_UNQUOTED(OMPI_ARCH, "$host", [OMPI architecture string])
#
# See if we can find an old installation of OMPI to overwrite
#
# Stupid autoconf 2.54 has a bug in AC_PREFIX_PROGRAM -- if ompi_clean
# is not found in the path and the user did not specify --prefix,
# we'll get a $prefix of "."
ompi_prefix_save="$prefix"
AC_PREFIX_PROGRAM(ompi_clean)
if test "$prefix" = "."; then
prefix="$ompi_prefix_save"
fi
unset ompi_prefix_save
#
# Basic sanity checking; we can't install to a relative path
#
case "$prefix" in
/*/bin)
prefix="`dirname $prefix`"
echo installing to directory \"$prefix\"
;;
/*)
echo installing to directory \"$prefix\"
;;
NONE)
echo installing to directory \"$ac_default_prefix\"
;;
@<:@a-zA-Z@:>@:*)
echo installing to directory \"$prefix\"
;;
*)
AC_MSG_ERROR(prefix "$prefix" must be an absolute directory path)
;;
esac
# Allow the --enable-dist flag to be passed in
AC_ARG_ENABLE(dist,
AC_HELP_STRING([--enable-dist],
[guarantee that that the "dist" make target will be functional, although may not guarantee that any other make target will be functional.]),
OMPI_WANT_DIST=yes, OMPI_WANT_DIST=no)
if test "$OMPI_WANT_DIST" = "yes"; then
AC_MSG_WARN([Configuring in 'make dist' mode])
AC_MSG_WARN([Most make targets may be non-functional!])
fi])dnl
dnl #######################################################################
dnl #######################################################################
dnl #######################################################################
AC_DEFUN([OMPI_LOG_MSG],[
# 1 is the message
# 2 is whether to put a prefix or not
if test -n "$2"; then
echo "configure:__oline__: $1" >&5
else
echo $1 >&5
fi])dnl
dnl #######################################################################
dnl #######################################################################
dnl #######################################################################
AC_DEFUN([OMPI_LOG_FILE],[
# 1 is the filename
if test -n "$1" -a -f "$1"; then
cat $1 >&5
fi])dnl
dnl #######################################################################
dnl #######################################################################
dnl #######################################################################
AC_DEFUN([OMPI_LOG_COMMAND],[
# 1 is the command
# 2 is actions to do if success
# 3 is actions to do if fail
echo "configure:__oline__: $1" >&5
$1 1>&5 2>&1
ompi_status=$?
OMPI_LOG_MSG([\$? = $ompi_status], 1)
if test "$ompi_status" = "0"; then
unset ompi_status
$2
else
unset ompi_status
$3
fi])dnl
dnl #######################################################################
dnl #######################################################################
dnl #######################################################################
AC_DEFUN([OMPI_UNIQ],[
# 1 is the variable name to be uniq-ized
ompi_name=$1
# Go through each item in the variable and only keep the unique ones
ompi_count=0
for val in ${$1}; do
ompi_done=0
ompi_i=1
ompi_found=0
# Loop over every token we've seen so far
ompi_done="`expr $ompi_i \> $ompi_count`"
while test "$ompi_found" = "0" -a "$ompi_done" = "0"; do
# Have we seen this token already? Prefix the comparison with
# "x" so that "-Lfoo" values won't be cause an error.
ompi_eval="expr x$val = x\$ompi_array_$ompi_i"
ompi_found=`eval $ompi_eval`
# Check the ending condition
ompi_done="`expr $ompi_i \>= $ompi_count`"
# Increment the counter
ompi_i="`expr $ompi_i + 1`"
done
# If we didn't find the token, add it to the "array"
if test "$ompi_found" = "0"; then
ompi_eval="ompi_array_$ompi_i=$val"
eval $ompi_eval
ompi_count="`expr $ompi_count + 1`"
else
ompi_i="`expr $ompi_i - 1`"
fi
done
# Take all the items in the "array" and assemble them back into a
# single variable
ompi_i=1
ompi_done="`expr $ompi_i \> $ompi_count`"
ompi_newval=
while test "$ompi_done" = "0"; do
ompi_eval="ompi_newval=\"$ompi_newval \$ompi_array_$ompi_i\""
eval $ompi_eval
ompi_eval="unset ompi_array_$ompi_i"
eval $ompi_eval
ompi_done="`expr $ompi_i \>= $ompi_count`"
ompi_i="`expr $ompi_i + 1`"
done
# Done; do the assignment
ompi_newval="`echo $ompi_newval`"
ompi_eval="$ompi_name=\"$ompi_newval\""
eval $ompi_eval
# Clean up
unset ompi_name ompi_i ompi_done ompi_newval ompi_eval ompi_count])dnl
dnl #######################################################################
dnl #######################################################################
dnl #######################################################################
# Macro that serves as an alternative to using `which <prog>`. It is
# preferable to simply using `which <prog>` because backticks (`) (aka
# backquotes) invoke a sub-shell which may source a "noisy"
# ~/.whatever file (and we do not want the error messages to be part
# of the assignment in foo=`which <prog>`). This macro ensures that we
# get a sane executable value.
AC_DEFUN([OMPI_WHICH],[
# 1 is the variable name to do "which" on
# 2 is the variable name to assign the return value to
OMPI_VAR_SCOPE_PUSH([ompi_prog ompi_file ompi_dir ompi_sentinel])
ompi_prog=$1
IFS_SAVE=$IFS
IFS="$PATH_SEPARATOR"
for ompi_dir in $PATH; do
if test -x "$ompi_dir/$ompi_prog"; then
$2="$ompi_dir/$ompi_prog"
break
fi
done
IFS=$IFS_SAVE
OMPI_VAR_SCOPE_POP
])dnl
dnl #######################################################################
dnl #######################################################################
dnl #######################################################################
# Declare some variables; use OMPI_VAR_SCOPE_END to ensure that they
# are cleaned up / undefined.
AC_DEFUN([OMPI_VAR_SCOPE_PUSH],[
# Is the private index set? If not, set it.
if test "x$ompi_scope_index" = "x"; then
ompi_scope_index=1
fi
# First, check to see if any of these variables are already set.
# This is a simple sanity check to ensure we're not already
# overwriting pre-existing variables (that have a non-empty
# value). It's not a perfect check, but at least it's something.
for ompi_var in $1; do
ompi_str="ompi_str=\"\$$ompi_var\""
eval $ompi_str
if test "x$ompi_str" != "x"; then
AC_MSG_WARN([Found configure shell variable clash!])
AC_MSG_WARN([[OMPI_VAR_SCOPE_PUSH] called on "$ompi_var",])
AC_MSG_WARN([but it is already defined with value "$ompi_str"])
AC_MSG_WARN([This usually indicates an error in configure.])
AC_MSG_ERROR([Cannot continue])
fi
done
# Ok, we passed the simple sanity check. Save all these names so
# that we can unset them at the end of the scope.
ompi_str="ompi_scope_$ompi_scope_index=\"$1\""
eval $ompi_str
unset ompi_str
env | grep ompi_scope
ompi_scope_index=`expr $ompi_scope_index + 1`
])dnl
# Unset a bunch of variables that were previously set
AC_DEFUN([OMPI_VAR_SCOPE_POP],[
# Unwind the index
ompi_scope_index=`expr $ompi_scope_index - 1`
ompi_scope_test=`expr $ompi_scope_index \> 0`
if test "$ompi_scope_test" = "0"; then
AC_MSG_WARN([[OMPI_VAR_SCOPE_POP] popped too many OMPI configure scopes.])
AC_MSG_WARN([This usually indicates an error in configure.])
AC_MSG_ERROR([Cannot continue])
fi
# Get the variable names from that index
ompi_str="ompi_str=\"\$ompi_scope_$ompi_scope_index\""
eval $ompi_str
# Iterate over all the variables and unset them all
for ompi_var in $ompi_str; do
unset $ompi_var
done
])dnl

View File

@ -0,0 +1,110 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
AC_DEFUN([OMPI_CHECK_LINKER_FLAGS],[
#
# libtool has been created by this point
# Try to see if it will add any additional flags for dependant libraries
#
AC_MSG_CHECKING([for libtool-supplied linker flags])
libtool="$1"
extra_flags="$2"
# Get the directory where libtool lives
start="`pwd`"
d="`dirname $libtool`"
cd "$d"
libtool="`pwd`/libtool"
cd "$start"
unset d start
# Make a playground to work in
mkdir conftest.$$
cd conftest.$$
cat > foo.c <<EOF
int foo(void) { return 0; }
EOF
ompi_check_linker_flags_work() {
OMPI_LOG_MSG([$cmd], [yes])
eval $cmd >&5 2>&5
if test -n "[$]1"; then
output=`eval $cmd 2>/dev/null | head -n 1 | sed -e 's,^libtool: *,,' -e 's,^link: *,,'`
fi
status="$?"
OMPI_LOG_MSG([\$? = $status], [yes])
if test "$status" != "0"; then
AC_MSG_RESULT([libtool error!])
AC_MSG_ERROR([Cannot continue])
fi
}
#
# First make a sample library with the current LDFLAGS and LIBS
#
cmd="$libtool --mode=compile --tag=CC $CC $CFLAGS -c -o foo.o foo.c"
ompi_check_linker_flags_work
cmd="$libtool --mode=link --tag=CC $CC $CFLAGS foo.lo $LDFLAGS $LIBS -o libfoo.la"
ompi_check_linker_flags_work
#
# Now fake linking to it and capture the output from libtool
#
cmd="$libtool --dry-run --mode=link --tag=CC $CC bar.lo libfoo.la -o bar $extra_flags"
ompi_check_linker_flags_work yes
# eat any extra whitespace in CC, as libtool will do the same
tmpCC=`echo $CC | sed -e 's/\//\\\\\//g'`
output=`echo $output | sed -e "s/^$tmpCC//"`
eval "set $output"
extra_ldflags=
while test -n "[$]1"; do
case "[$]1" in
*.libs/bar*) ;;
bar*) ;;
-I*) ;;
-L*) ;;
-R*) ;;
-lfoo) ;;
*.libs/libfoo.*) ;;
-o) ;;
*.so) ;;
*.a) ;;
*)
extra_ldflags="$extra_ldflags [$]1"
;;
esac
shift
done
if test -n "$extra_ldflags"; then
AC_MSG_RESULT([$extra_ldflags])
else
AC_MSG_RESULT([no extra flags])
fi
cd ..
rm -rf conftest.$$])dnl

View File

@ -0,0 +1,92 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
dnl
dnl This file is also used as input to ompi_get_version.sh.
dnl
# OMPI_GET_VERSION(version_file, variable_prefix)
# -----------------------------------------------
# parse version_file for version information, setting
# the following shell variables:
#
# prefix_VERSION
# prefix_BASE_VERSION
# prefix_MAJOR_VERSION
# prefix_MINOR_VERSION
# prefix_RELEASE_VERSION
# prefix_GREEK_VERSION
# prefix_WANT_SVN
# prefix_SVN_R
# prefix_RELEASE_DATE
m4_define([OMPI_GET_VERSION],[
: ${ompi_ver_need_svn=1}
: ${srcdir=.}
: ${svnversion_result=-1}
dnl quote eval to suppress macro expansion with non-GNU m4
if test -f "$1"; then
ompi_vers=`sed -n "
t clear
: clear
s/^major/$2_MAJOR_VERSION/
s/^minor/$2_MINOR_VERSION/
s/^release/$2_RELEASE_VERSION/
s/^greek/$2_GREEK_VERSION/
s/^want_svn/$2_WANT_SVN/
s/^svn_r/$2_SVN_R/
s/^date/$2_RELEASE_DATE/
t print
b
: print
p" < "$1"`
[eval] "$ompi_vers"
# Only print release version if it isn't 0
if test $$2_RELEASE_VERSION -ne 0 ; then
$2_VERSION="$$2_MAJOR_VERSION.$$2_MINOR_VERSION.$$2_RELEASE_VERSION"
else
$2_VERSION="$$2_MAJOR_VERSION.$$2_MINOR_VERSION"
fi
$2_VERSION="${$2_VERSION}${$2_GREEK_VERSION}"
$2_BASE_VERSION=$$2_VERSION
if test $$2_WANT_SVN -eq 1 && test $ompi_ver_need_svn -eq 1 ; then
if test "$svnversion_result" != "-1" ; then
$2_SVN_R=$svnversion_result
fi
if test "$$2_SVN_R" = "-1" ; then
m4_ifdef([AC_MSG_CHECKING],
[AC_MSG_CHECKING([for SVN version])])
if test -d "$srcdir/.svn" ; then
$2_SVN_R=r`svnversion "$srcdir"`
elif test -d "$srcdir/.hg" ; then
$2_SVN_R=hg`hg -v -R "$srcdir" tip | grep changeset | cut -d: -f3`
fi
if test "$2_SVN_R" = ""; then
$2_SVN_R=svn`date '+%m%d%Y'`
fi
m4_ifdef([AC_MSG_RESULT],
[AC_MSG_RESULT([done])])
fi
$2_VERSION="${$2_VERSION}${$2_SVN_R}"
fi
fi
])

View File

@ -0,0 +1,103 @@
m4_define([_m4_divert(SCRIPT)], 100)
m4_divert_push([SCRIPT])dnl
#!/bin/sh
#
# ompi_get_version is created from ompi_get_version.m4 and ompi_get_version.m4sh.
#
# Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
# 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.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
m4_include([ompi_get_version.m4])
srcfile="$1"
option="$2"
case "$option" in
# svnversion can take a while to run. If we don't need it, don't run it.
--major|--minor|--release|--greek|--base|--help)
ompi_ver_need_svn=0
;;
*)
ompi_ver_need_svn=1
esac
if test -z "$srcfile"; then
option="--help"
else
OMPI_GET_VERSION([$srcfile],[OMPI])
if test "$option" = ""; then
option="--full"
fi
fi
case "$option" in
--full|-v|--version)
echo $OMPI_VERSION
;;
--major)
echo $OMPI_MAJOR_VERSION
;;
--minor)
echo $OMPI_MINOR_VERSION
;;
--release)
echo $OMPI_RELEASE_VERSION
;;
--greek)
echo $OMPI_GREEK_VERSION
;;
--svn)
echo $OMPI_SVN_R
;;
--base)
echo $OMPI_BASE_VERSION
;;
--release-date)
echo $OMPI_RELEASE_DATE
;;
--all)
echo ${OMPI_VERSION} ${OMPI_MAJOR_VERSION} ${OMPI_MINOR_VERSION} ${OMPI_RELEASE_VERSION} ${OMPI_GREEK_VERSION} ${OMPI_SVN_R}
;;
-h|--help)
cat <<EOF
$0 <srcfile> [<option>]
<srcfile> - Text version file
<option> - One of:
--full - Full version number
--major - Major version number
--minor - Minor version number
--release - Release version number
--greek - Greek (alpha, beta, etc) version number
--svn - Subversion repository number
--all - Show all version numbers, separated by :
--base - Show base version number (no svn number)
--release-date - Show the release date
--help - This message
EOF
;;
*)
echo "Unrecognized option $option. Run $0 --help for options"
;;
esac
# All done
exit 0

56
config/ompi_interix.m4 Normal file
View File

@ -0,0 +1,56 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2008 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
######################################################################
#
# OMPI_INTERIX
#
# Detect if the environment is SUA/SFU (i.e. Interix) and modify
# the compiling environment accordingly.
#
# USAGE:
# OMPI_INTERIX()
#
######################################################################
AC_DEFUN([OMPI_INTERIX],[
AC_MSG_CHECKING(for Interix environment)
AC_TRY_COMPILE([],
[#if !defined(__INTERIX)
#error Normal Unix environment
#endif],
is_interix=yes,
is_interix=no)
AC_MSG_RESULT([$is_interix])
if test "$is_interix" = "yes"; then
ompi_show_subtitle "Interix detection"
if ! test -d /usr/include/port; then
AC_MSG_WARN([Compiling Open MPI under Interix require an up-to-date])
AC_MSG_WARN([version of libport. Please ask your system administrator])
AC_MSG_WARN([to install it (pkg_update -L libport).])
AC_MSG_ERROR([*** Cannot continue])
fi
#
# These are the minimum requirements for Interix ...
#
AC_MSG_WARN([ -lport was added to the linking flags])
LDFLAGS="-lport $LDFLAGS"
AC_MSG_WARN([ -D_ALL_SOURCE -D_USE_LIBPORT was added to the compilation flags])
CFLAGS="-D_ALL_SOURCE -D_USE_LIBPORT -I/usr/include/port $CFLAGS"
CPPFLAGS="-D_ALL_SOURCE -D_USE_LIBPORT -I/usr/include/port $CPPFLAGS"
CXXFLAGS="-D_ALL_SOURCE -D_USE_LIBPORT -I/usr/include/port $CXXFLAGS"
fi
])

View File