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