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.
Этот коммит содержится в:
родитель
e0bb777a51
Коммит
d33801c0fa
@ -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
Обычный файл
20
config/Makefile.options
Обычный файл
@ -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
|
94
config/cxx_find_exception_flags.m4
Обычный файл
94
config/cxx_find_exception_flags.m4
Обычный файл
@ -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
|
||||
|
44
config/cxx_find_template_parameters.m4
Обычный файл
44
config/cxx_find_template_parameters.m4
Обычный файл
@ -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
|
||||
])
|
170
config/cxx_find_template_repository.m4
Обычный файл
170
config/cxx_find_template_repository.m4
Обычный файл
@ -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])
|
44
config/cxx_have_exceptions.m4
Обычный файл
44
config/cxx_have_exceptions.m4
Обычный файл
@ -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
Исполняемый файл
235
config/distscript.csh
Исполняемый файл
@ -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
Обычный файл
113
config/f77_check.m4
Обычный файл
@ -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
|
101
config/f77_check_logical_array.m4
Обычный файл
101
config/f77_check_logical_array.m4
Обычный файл
@ -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
Обычный файл
40
config/f77_check_type.m4
Обычный файл
@ -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
|
||||
|
120
config/f77_find_ext_symbol_convention.m4
Обычный файл
120
config/f77_find_ext_symbol_convention.m4
Обычный файл
@ -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
|
||||
])
|
92
config/f77_get_alignment.m4
Обычный файл
92
config/f77_get_alignment.m4
Обычный файл
@ -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
|
||||
])
|
82
config/f77_get_fortran_handle_max.m4
Обычный файл
82
config/f77_get_fortran_handle_max.m4
Обычный файл
@ -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
Обычный файл
85
config/f77_get_sizeof.m4
Обычный файл
@ -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
|
114
config/f77_get_value_true.m4
Обычный файл
114
config/f77_get_value_true.m4
Обычный файл
@ -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
|
36
config/f77_purge_unsupported_kind.m4
Обычный файл
36
config/f77_purge_unsupported_kind.m4
Обычный файл
@ -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
Обычный файл
176
config/f90_check.m4
Обычный файл
@ -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
Обычный файл
39
config/f90_check_type.m4
Обычный файл
@ -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
|
84
config/f90_find_module_include_flag.m4
Обычный файл
84
config/f90_find_module_include_flag.m4
Обычный файл
@ -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
|
62
config/f90_get_int_kind.m4
Обычный файл
62
config/f90_get_int_kind.m4
Обычный файл
@ -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
|
||||
])
|
60
config/f90_get_precision.m4
Обычный файл
60
config/f90_get_precision.m4
Обычный файл
@ -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
Обычный файл
60
config/f90_get_range.m4
Обычный файл
@ -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
Обычный файл
85
config/f90_get_sizeof.m4
Обычный файл
@ -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
Обычный файл
49
config/mca_acinclude.m4
Обычный файл
@ -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
Обычный файл
408
config/mca_configure.ac
Обычный файл
@ -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
Исполняемый файл
393
config/mca_make_configure.pl
Исполняемый файл
@ -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);
|
103
config/ompi_case_sensitive_fs_setup.m4
Обычный файл
103
config/ompi_case_sensitive_fs_setup.m4
Обычный файл
@ -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
Обычный файл
33
config/ompi_check_alps.m4
Обычный файл
@ -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])
|
||||
])
|
517
config/ompi_check_attributes.m4
Обычный файл
517
config/ompi_check_attributes.m4
Обычный файл
@ -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])
|
||||
])
|
67
config/ompi_check_bproc.m4
Обычный файл
67
config/ompi_check_bproc.m4
Обычный файл
@ -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])
|
||||
])
|
||||
])
|
53
config/ompi_check_broken_qsort.m4
Обычный файл
53
config/ompi_check_broken_qsort.m4
Обычный файл
@ -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])
|
||||
])
|
55
config/ompi_check_compiler_works.m4
Обычный файл
55
config/ompi_check_compiler_works.m4
Обычный файл
@ -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
|
||||
])
|
47
config/ompi_check_func_lib.m4
Обычный файл
47
config/ompi_check_func_lib.m4
Обычный файл
@ -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
Обычный файл
155
config/ompi_check_gm.m4
Обычный файл
@ -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
Обычный файл
59
config/ompi_check_icc.m4
Обычный файл
@ -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
|
97
config/ompi_check_ident.m4
Обычный файл
97
config/ompi_check_ident.m4
Обычный файл
@ -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
|
52
config/ompi_check_loadleveler.m4
Обычный файл
52
config/ompi_check_loadleveler.m4
Обычный файл
@ -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
Обычный файл
95
config/ompi_check_lsf.m4
Обычный файл
@ -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
Обычный файл
137
config/ompi_check_mx.m4
Обычный файл
@ -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
Обычный файл
231
config/ompi_check_openib.m4
Обычный файл
@ -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
|
||||
])
|
||||
|
63
config/ompi_check_optflags.m4
Обычный файл
63
config/ompi_check_optflags.m4
Обычный файл
@ -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
|
||||
])
|
170
config/ompi_check_package.m4
Обычный файл
170
config/ompi_check_package.m4
Обычный файл
@ -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"
|
||||
])
|
156
config/ompi_check_portals.m4
Обычный файл
156
config/ompi_check_portals.m4
Обычный файл
@ -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
Обычный файл
42
config/ompi_check_ps.m4
Обычный файл
@ -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
Обычный файл
70
config/ompi_check_psm.m4
Обычный файл
@ -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])
|
||||
])
|
||||
|
90
config/ompi_check_pthread_pids.m4
Обычный файл
90
config/ompi_check_pthread_pids.m4
Обычный файл
@ -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
Обычный файл
53
config/ompi_check_sge.m4
Обычный файл
@ -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])
|
||||
])
|
71
config/ompi_check_slurm.m4
Обычный файл
71
config/ompi_check_slurm.m4
Обычный файл
@ -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
Обычный файл
144
config/ompi_check_tm.m4
Обычный файл
@ -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
Обычный файл
117
config/ompi_check_udapl.m4
Обычный файл
@ -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
Обычный файл
247
config/ompi_check_vendor.m4
Обычный файл
@ -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
|
||||
])
|
78
config/ompi_check_visibility.m4
Обычный файл
78
config/ompi_check_visibility.m4
Обычный файл
@ -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])
|
||||
|
||||
])
|
64
config/ompi_check_xgrid.m4
Обычный файл
64
config/ompi_check_xgrid.m4
Обычный файл
@ -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
Обычный файл
1090
config/ompi_config_asm.m4
Обычный файл
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
686
config/ompi_config_pthreads.m4
Обычный файл
686
config/ompi_config_pthreads.m4
Обычный файл
@ -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
|
250
config/ompi_config_solaris_threads.m4
Обычный файл
250
config/ompi_config_solaris_threads.m4
Обычный файл
@ -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
|
||||
|
156
config/ompi_config_subdir.m4
Обычный файл
156
config/ompi_config_subdir.m4
Обычный файл
@ -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
|
77
config/ompi_config_subdir_args.m4
Обычный файл
77
config/ompi_config_subdir_args.m4
Обычный файл
@ -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
|
295
config/ompi_config_threads.m4
Обычный файл
295
config/ompi_config_threads.m4
Обычный файл
@ -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
|
||||
|
704
config/ompi_configure_options.m4
Обычный файл
704
config/ompi_configure_options.m4
Обычный файл
@ -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
Обычный файл
119
config/ompi_contrib.m4
Обычный файл
@ -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
Обычный файл
58
config/ompi_find_type.m4
Обычный файл
@ -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
Обычный файл
358
config/ompi_functions.m4
Обычный файл
@ -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
|
110
config/ompi_get_libtool_linker_flags.m4
Обычный файл
110
config/ompi_get_libtool_linker_flags.m4
Обычный файл
@ -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
|
92
config/ompi_get_version.m4
Обычный файл
92
config/ompi_get_version.m4
Обычный файл
@ -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
|
||||
])
|
103
config/ompi_get_version.m4sh
Обычный файл
103
config/ompi_get_version.m4sh
Обычный файл
@ -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
Обычный файл
56
config/ompi_interix.m4
Обычный файл
@ -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
|
||||
|
||||
])
|
67
config/ompi_lang_link_with_c.m4
Обычный файл
67
config/ompi_lang_link_with_c.m4
Обычный файл
@ -0,0 +1,67 @@
|
||||
dnl -*- shell-script -*-
|
||||
dnl
|
||||
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_LANG_LINK_WITH_C(language)
|
||||
# -------------------------------
|
||||
# Try to link a small test program against a C object file to make
|
||||
# sure the compiler for the given language is compatible with the C
|
||||
# compiler.
|
||||
AC_DEFUN([OMPI_LANG_LINK_WITH_C], [
|
||||
AS_VAR_PUSHDEF([lang_var], [ompi_cv_c_link_$1])
|
||||
|
||||
AC_CACHE_CHECK([if C and $1 are link compatible],
|
||||
lang_var,
|
||||
[m4_if([$1], [Fortran],
|
||||
[m4_define([ompi_lang_link_with_c_fortran], 1)],
|
||||
[m4_if([$1], [Fortran 77],
|
||||
[m4_define([ompi_lang_link_with_c_fortran], 1)],
|
||||
[m4_define([ompi_lang_link_with_c_fortran], 0)])])
|
||||
m4_if(ompi_lang_link_with_c_fortran, 1,
|
||||
[OMPI_F77_MAKE_C_FUNCTION([testfunc_name], [testfunc])],
|
||||
[testfunc_name="testfunc"])
|
||||
|
||||
# Write out C part
|
||||
AC_LANG_PUSH(C)
|
||||
rm -f conftest_c.$ac_ext
|
||||
cat > conftest_c.$ac_ext << EOF
|
||||
int $testfunc_name(int a);
|
||||
int $testfunc_name(int a) { return a; }
|
||||
EOF
|
||||
|
||||
# Now compile both parts
|
||||
OMPI_LOG_COMMAND([$CC -c $CFLAGS $CPPFLAGS conftest_c.$ac_ext],
|
||||
[AC_LANG_PUSH($1)
|
||||
ompi_lang_link_with_c_libs="$LIBS"
|
||||
LIBS="conftest_c.o $LIBS"
|
||||
m4_if(ompi_lang_link_with_c_fortran, 1,
|
||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM([], [
|
||||
external testfunc
|
||||
call testfunc(1)
|
||||
])],
|
||||
[AS_VAR_SET(lang_var, ["yes"])], [AS_VAR_SET(lang_var, ["no"])])],
|
||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM([
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern "C" int testfunc(int);
|
||||
#else
|
||||
extern int testfunc(int);
|
||||
#endif
|
||||
],
|
||||
[return testfunc(0);])],
|
||||
[AS_VAR_SET(lang_var, ["yes"])], [AS_VAR_SET(lang_var, ["no"])])])
|
||||
LIBS="$ompi_lang_link_with_c_libs"
|
||||
AC_LANG_POP($1)],
|
||||
[AS_VAR_SET(lang_var, ["no"])])
|
||||
rm -f conftest_c.$ac_ext
|
||||
AC_LANG_POP(C)])
|
||||
|
||||
AS_IF([test "AS_VAR_GET([lang_var])" = "yes"], [$2], [$3])
|
||||
AS_VAR_POPDEF([lang_var])dnl
|
||||
])
|
93
config/ompi_load_platform.m4
Обычный файл
93
config/ompi_load_platform.m4
Обычный файл
@ -0,0 +1,93 @@
|
||||
# -*- 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_LOAD_PLATFORM()
|
||||
# --------------------
|
||||
AC_DEFUN([OMPI_LOAD_PLATFORM], [
|
||||
AC_ARG_WITH([platform],
|
||||
[AC_HELP_STRING([--with-platform=FILE],
|
||||
[Load options for build from FILE. Options on the
|
||||
command line not in FILE are used. Options on the
|
||||
command line and in FILE are replaced by what is
|
||||
in FILE.])])
|
||||
if test "$with_platform" = "yes" ; then
|
||||
AC_MSG_ERROR([--with-platform argument must include FILE option])
|
||||
elif test "$with_platform" = "no" ; then
|
||||
AC_MSG_ERROR([--without-platform is not a valid argument])
|
||||
elif test "$with_platform" != "" ; then
|
||||
# if no path part, check in contrib/platform
|
||||
if test "`basename $with_platform`" = "$with_platform" ; then
|
||||
if test -r "${srcdir}/contrib/platform/$with_platform" ; then
|
||||
with_platform="${srcdir}/contrib/platform/$with_platform"
|
||||
fi
|
||||
fi
|
||||
|
||||
# make sure file exists
|
||||
if test ! -r "$with_platform" ; then
|
||||
AC_MSG_ERROR([platform file $with_platform not found])
|
||||
fi
|
||||
|
||||
# eval into environment
|
||||
OMPI_LOG_MSG([Loading environment file $with_platform, with contents below])
|
||||
OMPI_LOG_FILE([$with_platform])
|
||||
. "$with_platform"
|
||||
|
||||
# see if they left us a name
|
||||
if test "$OMPI_PLATFORM_LOADED" != "" ; then
|
||||
platform_loaded="$OMPI_PLATFORM_LOADED"
|
||||
else
|
||||
platform_loaded="$with_platform"
|
||||
fi
|
||||
echo "Loaded platform arguments for $platform_loaded"
|
||||
OMPI_LOG_MSG([Loaded platform arguments for $platform_loaded])
|
||||
|
||||
# look for default mca param file
|
||||
|
||||
# setup by getting full pathname for the platform directories
|
||||
platform_base="`dirname $with_platform`"
|
||||
# get full pathname of where we are so we can return
|
||||
platform_savedir="`pwd`"
|
||||
# go to where the platform file is located
|
||||
cd "$platform_base"
|
||||
# get the full path to this location
|
||||
platform_file_dir=`pwd`
|
||||
# return to where we started
|
||||
cd "$platform_savedir"
|
||||
|
||||
# define an alternate default mca param filename
|
||||
platform_alt_mca_file="`basename $platform_loaded`.conf"
|
||||
|
||||
# look where platform file is located for platform.conf name
|
||||
if test -r "${platform_file_dir}/${platform_alt_mca_file}" ; then
|
||||
AC_SUBST(OPAL_DEFAULT_MCA_PARAM_CONF, [$platform_file_dir/$platform_alt_mca_file])
|
||||
AC_SUBST(OPAL_PARAM_FROM_PLATFORM, "yes")
|
||||
# if not, see if a file is there with the default name
|
||||
elif test -r "${platform_file_dir}/openmpi-mca-params.conf" ; then
|
||||
AC_SUBST(OPAL_DEFAULT_MCA_PARAM_CONF, [$platform_file_dir/openmpi-mca-params.conf])
|
||||
AC_SUBST(OPAL_PARAM_FROM_PLATFORM, "yes")
|
||||
# if not, then just use the default
|
||||
else
|
||||
AC_SUBST(OPAL_DEFAULT_MCA_PARAM_CONF, [openmpi-mca-params.conf])
|
||||
AC_SUBST(OPAL_PARAM_FROM_PLATFORM, "no")
|
||||
fi
|
||||
|
||||
else
|
||||
AC_SUBST(OPAL_DEFAULT_MCA_PARAM_CONF, [openmpi-mca-params.conf])
|
||||
fi
|
||||
])
|
73
config/ompi_make_stripped_flags.m4
Обычный файл
73
config/ompi_make_stripped_flags.m4
Обычный файл
@ -0,0 +1,73 @@
|
||||
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 (c) 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
dnl $COPYRIGHT$
|
||||
dnl
|
||||
dnl Additional copyrights may follow
|
||||
dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
AC_DEFUN([OMPI_MAKE_STRIPPED_FLAGS],[
|
||||
|
||||
# Process a set of flags and remove all debugging and optimization
|
||||
# flags
|
||||
|
||||
s_arg="$1"
|
||||
s_result=
|
||||
for s_word in $s_arg; do
|
||||
case $s_word in
|
||||
-g) ;;
|
||||
+K0) ;;
|
||||
+K1) ;;
|
||||
+K2) ;;
|
||||
+K3) ;;
|
||||
+K4) ;;
|
||||
+K5) ;;
|
||||
-O) ;;
|
||||
-O0) ;;
|
||||
-O1) ;;
|
||||
-O2) ;;
|
||||
-O3) ;;
|
||||
-O4) ;;
|
||||
-O5) ;;
|
||||
-O6) ;;
|
||||
-O7) ;;
|
||||
-O8) ;;
|
||||
-O9) ;;
|
||||
-xO) ;;
|
||||
-xO0) ;;
|
||||
-xO1) ;;
|
||||
-xO2) ;;
|
||||
-xO3) ;;
|
||||
-xO4) ;;
|
||||
-xO5) ;;
|
||||
-xO6) ;;
|
||||
-xO7) ;;
|
||||
-xO8) ;;
|
||||
-xO9) ;;
|
||||
-fast) ;;
|
||||
|
||||
# The below Sun Studio flags require or
|
||||
# trigger -xO optimization
|
||||
-xvector*) ;;
|
||||
-xdepend=yes) ;;
|
||||
|
||||
*) s_result="$s_result $s_word"
|
||||
esac
|
||||
done
|
||||
|
||||
# Clean up
|
||||
|
||||
unset s_word s_arg])
|
941
config/ompi_mca.m4
Обычный файл
941
config/ompi_mca.m4
Обычный файл
@ -0,0 +1,941 @@
|
||||
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_EVAL_ARG(arg)
|
||||
# ------------------
|
||||
# evaluates and returns argument
|
||||
AC_DEFUN([OMPI_EVAL_ARG], [$1])
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# OMPI_MCA
|
||||
#
|
||||
# configure the MCA (modular component architecture). Works hand in hand
|
||||
# with Open MPI's autogen.sh, requiring it's specially formatted lists
|
||||
# of frameworks, components, etc.
|
||||
#
|
||||
# USAGE:
|
||||
# OMPI_MCA()
|
||||
#
|
||||
######################################################################
|
||||
AC_DEFUN([OMPI_MCA],[
|
||||
dnl for OMPI_CONFIGURE_USER env variable
|
||||
AC_REQUIRE([OMPI_CONFIGURE_SETUP])
|
||||
|
||||
# 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_ARG_ENABLE([mca-no-build],
|
||||
[AC_HELP_STRING([--enable-mca-no-build=LIST],
|
||||
[Comma-separated list of <type>-<component> pairs
|
||||
that will not be built. Example: "--enable-mca-no-build=maffinity,btl-portals" will disable building all maffinity components and the "portals" btl components.])])
|
||||
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.]))
|
||||
AC_ARG_ENABLE(mca-static,
|
||||
AC_HELP_STRING([--enable-mca-static=LIST],
|
||||
[Comma-separated list of types and/or
|
||||
type-component pairs that will be built statically
|
||||
linked into the library. The default (if DSOs are
|
||||
supported) is to build all components as DSOs.
|
||||
Enabling a component as static disables it
|
||||
building as a DSO.]))
|
||||
AC_ARG_ENABLE(mca-direct,
|
||||
AC_HELP_STRING([--enable-mca-direct=LIST],
|
||||
[Comma-separated list of type-component pairs that
|
||||
will be hard coded as the one component to use for
|
||||
a given component type, saving the (small)
|
||||
overhead of the component architecture. LIST must
|
||||
not be empty and implies given component pairs are
|
||||
build as static components.]))
|
||||
|
||||
AC_MSG_CHECKING([which components should be disabled])
|
||||
if test "$enable_mca_no_build" = "yes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_MSG_ERROR([*** The enable-mca-no-build flag requires an explicit list
|
||||
*** of type-component pairs. For example, --enable-mca-direct=pml-ob1])
|
||||
else
|
||||
ifs_save="$IFS"
|
||||
IFS="${IFS}$PATH_SEPARATOR,"
|
||||
msg=
|
||||
for item in $enable_mca_no_build; do
|
||||
type="`echo $item | cut -s -f1 -d-`"
|
||||
comp="`echo $item | cut -s -f2- -d-`"
|
||||
if test -z $type ; then
|
||||
type=$item
|
||||
fi
|
||||
if test -z $comp ; then
|
||||
str="`echo DISABLE_${type}=1 | sed s/-/_/g`"
|
||||
eval $str
|
||||
msg="$item $msg"
|
||||
else
|
||||
str="`echo DISABLE_${type}_${comp}=1 | sed s/-/_/g`"
|
||||
eval $str
|
||||
msg="$item $msg"
|
||||
fi
|
||||
done
|
||||
IFS="$ifs_save"
|
||||
fi
|
||||
AC_MSG_RESULT([$msg])
|
||||
unset msg
|
||||
|
||||
#
|
||||
# First, add all the mca-direct components / types into the mca-static
|
||||
# lists and create a list of component types that are direct compile,
|
||||
# in the form DIRECT_[type]=[component]
|
||||
#
|
||||
AC_MSG_CHECKING([which components should be direct-linked into the library])
|
||||
if test "$enable_mca_direct" = "yes" ; then
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_MSG_ERROR([*** The enable-mca-direct flag requires an explicit list of
|
||||
*** type-component pairs. For example, --enable-mca-direct=pml-ob1,coll-basic])
|
||||
elif test ! -z "$enable_mca_direct" -a "$enable_mca_direct" != "" ; then
|
||||
#
|
||||
# we need to add this into the static list, unless the static list
|
||||
# is everything
|
||||
#
|
||||
if test "$enable_mca_static" = "no" ; then
|
||||
AC_MSG_WARN([*** Re-enabling static component support for direct call])
|
||||
enable_mca_static="$enable_mca_direct"
|
||||
elif test -z "$enable_mca_static" ; then
|
||||
enable_mca_static="$enable_mca_direct"
|
||||
elif test "$enable_mca_static" != "yes" ; then
|
||||
enable_mca_static="$enable_mca_direct,$enable_mca_static"
|
||||
fi
|
||||
|
||||
ifs_save="$IFS"
|
||||
IFS="${IFS}$PATH_SEPARATOR,"
|
||||
msg=
|
||||
for item in $enable_mca_direct; do
|
||||
type="`echo $item | cut -f1 -d-`"
|
||||
comp="`echo $item | cut -f2- -d-`"
|
||||
if test -z $type -o -z $comp ; then
|
||||
AC_MSG_ERROR([*** The enable-mca-direct flag requires a
|
||||
*** list of type-component pairs. Invalid input detected.])
|
||||
else
|
||||
str="`echo DIRECT_$type=$comp | sed s/-/_/g`"
|
||||
eval $str
|
||||
msg="$item $msg"
|
||||
fi
|
||||
done
|
||||
IFS="$ifs_save"
|
||||
fi
|
||||
AC_MSG_RESULT([$msg])
|
||||
unset msg
|
||||
|
||||
#
|
||||
# Second, set the DSO_all and STATIC_all variables. conflict
|
||||
# resolution (prefer static) is done in the big loop below
|
||||
#
|
||||
AC_MSG_CHECKING([which components should be run-time loadable])
|
||||
if test "$enable_static" != "no"; then
|
||||
DSO_all=0
|
||||
msg=none
|
||||
elif test -z "$enable_mca_dso" -o "$enable_mca_dso" = "yes"; then
|
||||
DSO_all=1
|
||||
msg=all
|
||||
elif test "$enable_mca_dso" = "no"; then
|
||||
DSO_all=0
|
||||
msg=none
|
||||
else
|
||||
DSO_all=0
|
||||
ifs_save="$IFS"
|
||||
IFS="${IFS}$PATH_SEPARATOR,"
|
||||
msg=
|
||||
for item in $enable_mca_dso; do
|
||||
str="`echo DSO_$item=1 | sed s/-/_/g`"
|
||||
eval $str
|
||||
msg="$item $msg"
|
||||
done
|
||||
IFS="$ifs_save"
|
||||
fi
|
||||
AC_MSG_RESULT([$msg])
|
||||
unset msg
|
||||
if test "$enable_static" != "no"; then
|
||||
AC_MSG_WARN([*** Shared libraries have been disabled (--disable-shared)])
|
||||
AC_MSG_WARN([*** Building MCA components as DSOs automatically disabled])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([which components should be static])
|
||||
if test "$enable_mca_static" = "yes"; then
|
||||
STATIC_all=1
|
||||
msg=all
|
||||
elif test -z "$enable_mca_static" -o "$enable_mca_static" = "no"; then
|
||||
STATIC_all=0
|
||||
msg=none
|
||||
else
|
||||
STATIC_all=0
|
||||
ifs_save="$IFS"
|
||||
IFS="${IFS}$PATH_SEPARATOR,"
|
||||
msg=
|
||||
for item in $enable_mca_static; do
|
||||
str="`echo STATIC_$item=1 | sed s/-/_/g`"
|
||||
eval $str
|
||||
msg="$item $msg"
|
||||
done
|
||||
IFS="$ifs_save"
|
||||
fi
|
||||
AC_MSG_RESULT([$msg])
|
||||
unset msg
|
||||
|
||||
AC_MSG_CHECKING([for projects containing MCA frameworks])
|
||||
AC_MSG_RESULT([mca_project_list])
|
||||
|
||||
# if there isn't a project list, abort
|
||||
m4_ifdef([mca_project_list], [],
|
||||
[m4_fatal([Could not find project list - rerun autogen.sh without -l])])
|
||||
|
||||
# now configre all the projects, frameworks, and components. Most
|
||||
# of the hard stuff is in here
|
||||
MCA_PROJECT_SUBDIRS=
|
||||
m4_foreach(mca_project, [mca_project_list],
|
||||
[MCA_PROJECT_SUBDIRS="$MCA_PROJECT_SUBDIRS mca_project"
|
||||
MCA_CONFIGURE_PROJECT(mca_project)])
|
||||
|
||||
# BWB - fix me... need to automate this somehow
|
||||
MCA_SETUP_DIRECT_CALL(pml, ompi)
|
||||
MCA_SETUP_DIRECT_CALL(mtl, ompi)
|
||||
|
||||
# make all the config output statements for the no configure
|
||||
# components
|
||||
MCA_NO_CONFIG_CONFIG_FILES()
|
||||
|
||||
AC_SUBST(MCA_PROJECT_SUBDIRS)
|
||||
])
|
||||
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# MCA_CONFIGURE_PROJECT
|
||||
#
|
||||
# Configure all frameworks inside the given project name. Assumes that
|
||||
# the frameworks are located in [project_name]/mca/[frameworks] and that
|
||||
# there is an m4_defined list named mca_[project]_framework_list with
|
||||
# the list of frameworks.
|
||||
#
|
||||
# USAGE:
|
||||
# MCA_CONFIGURE_PROJECT(project_name)
|
||||
#
|
||||
######################################################################
|
||||
AC_DEFUN([MCA_CONFIGURE_PROJECT],[
|
||||
# can't use a variable rename here because these need to be evaled
|
||||
# at auto* time.
|
||||
|
||||
ompi_show_subtitle "Configuring MCA for $1"
|
||||
|
||||
AC_MSG_CHECKING([for frameworks for $1])
|
||||
AC_MSG_RESULT([mca_$1_framework_list])
|
||||
|
||||
# iterate through the list of frameworks. There is something
|
||||
# funky with m4 foreach if the list is defined, but empty. It
|
||||
# will call the 3rd argument once with an empty value for the
|
||||
# first argument. Protect against calling MCA_CONFIGURE_FRAMEWORK
|
||||
# with an empty second argument. Grrr....
|
||||
# if there isn't a project list, abort
|
||||
#
|
||||
# Also setup two variables for Makefiles:
|
||||
# MCA_project_FRAMEWORKS - list of frameworks in that project
|
||||
# MCA_project_FRAMEWORK_LIBS - list of libraries (or variables pointing
|
||||
# to more libraries) that must be included
|
||||
# in the project's main library
|
||||
m4_ifdef([mca_$1_framework_list], [],
|
||||
[m4_fatal([Could not find mca_$1_framework_list - rerun autogen.sh without -l])])
|
||||
|
||||
MCA_$1_FRAMEWORKS=
|
||||
MCA_$1_FRAMEWORKS_SUBDIRS=
|
||||
MCA_$1_FRAMEWORK_COMPONENT_ALL_SUBDIRS=
|
||||
MCA_$1_FRAMEWORK_COMPONENT_DSO_SUBDIRS=
|
||||
MCA_$1_FRAMEWORK_COMPONENT_STATIC_SUBDIRS=
|
||||
MCA_$1_FRAMEWORK_LIBS=
|
||||
|
||||
m4_foreach(mca_framework, [mca_$1_framework_list],
|
||||
[m4_ifval(mca_framework,
|
||||
[# common has to go up front
|
||||
if test "mca_framework" = "common" ; then
|
||||
MCA_$1_FRAMEWORKS="mca_framework $MCA_$1_FRAMEWORKS"
|
||||
MCA_$1_FRAMEWORKS_SUBDIRS="[mca/]mca_framework $MCA_$1_FRAMEWORKS_SUBDIRS"
|
||||
MCA_$1_FRAMEWORK_COMPONENT_ALL_SUBDIRS="[\$(MCA_]mca_framework[_ALL_SUBDIRS)] $MCA_$1_FRAMEWORK_COMPONENT_ALL_SUBDIRS"
|
||||
MCA_$1_FRAMEWORK_COMPONENT_DSO_SUBDIRS="[\$(MCA_]mca_framework[_DSO_SUBDIRS)] $MCA_$1_FRAMEWORK_COMPONENT_DSO_SUBDIRS"
|
||||
MCA_$1_FRAMEWORK_COMPONENT_STATIC_SUBDIRS="[\$(MCA_]mca_framework[_STATIC_SUBDIRS)] $MCA_$1_FRAMEWORK_COMPONENT_STATIC_SUBDIRS"
|
||||
else
|
||||
MCA_$1_FRAMEWORKS="$MCA_$1_FRAMEWORKS mca_framework"
|
||||
MCA_$1_FRAMEWORKS_SUBDIRS="$MCA_$1_FRAMEWORKS_SUBDIRS [mca/]mca_framework"
|
||||
MCA_$1_FRAMEWORK_COMPONENT_ALL_SUBDIRS="$MCA_$1_FRAMEWORK_COMPONENT_ALL_SUBDIRS [\$(MCA_]mca_framework[_ALL_SUBDIRS)]"
|
||||
MCA_$1_FRAMEWORK_COMPONENT_DSO_SUBDIRS="$MCA_$1_FRAMEWORK_COMPONENT_DSO_SUBDIRS [\$(MCA_]mca_framework[_DSO_SUBDIRS)]"
|
||||
MCA_$1_FRAMEWORK_COMPONENT_STATIC_SUBDIRS="$MCA_$1_FRAMEWORK_COMPONENT_STATIC_SUBDIRS [\$(MCA_]mca_framework[_STATIC_SUBDIRS)]"
|
||||
fi
|
||||
if test "mca_framework" != "common" ; then
|
||||
MCA_$1_FRAMEWORK_LIBS="$MCA_$1_FRAMEWORK_LIBS [mca/]mca_framework[/libmca_]mca_framework[.la]"
|
||||
fi
|
||||
MCA_$1_FRAMEWORK_LIBS="$MCA_$1_FRAMEWORK_LIBS [\$(MCA_]mca_framework[_STATIC_LTLIBS)]"
|
||||
m4_ifdef([MCA_]mca_framework[_CONFIG],
|
||||
[MCA_]mca_framework[_CONFIG]($1, mca_framework),
|
||||
[MCA_CONFIGURE_FRAMEWORK($1, mca_framework, 1)])])])
|
||||
|
||||
AC_SUBST(MCA_$1_FRAMEWORKS)
|
||||
AC_SUBST(MCA_$1_FRAMEWORKS_SUBDIRS)
|
||||
AC_SUBST(MCA_$1_FRAMEWORK_COMPONENT_ALL_SUBDIRS)
|
||||
AC_SUBST(MCA_$1_FRAMEWORK_COMPONENT_DSO_SUBDIRS)
|
||||
AC_SUBST(MCA_$1_FRAMEWORK_COMPONENT_STATIC_SUBDIRS)
|
||||
AC_SUBST(MCA_$1_FRAMEWORK_LIBS)
|
||||
])
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# MCA_CONFIGURE_FRAMEWORK
|
||||
#
|
||||
# Configure the given framework and all components inside the
|
||||
# framework. Assumes that the framework is located in
|
||||
# [project_name]/mca/[framework], and that all components are
|
||||
# available under the framework directory. Will configure all
|
||||
# no-configure and builtin components, then search for components with
|
||||
# configure scripts. Assumes that no component is marked as builtin
|
||||
# AND has a configure script.
|
||||
#
|
||||
# USAGE:
|
||||
# MCA_CONFIGURE_PROJECT(project_name, framework_name, allow_succeed)
|
||||
#
|
||||
######################################################################
|
||||
AC_DEFUN([MCA_CONFIGURE_FRAMEWORK],[
|
||||
ompi_show_subsubtitle "Configuring MCA framework $2"
|
||||
|
||||
# setup for framework
|
||||
all_components=
|
||||
static_components=
|
||||
dso_components=
|
||||
static_ltlibs=
|
||||
|
||||
# Ensure that the directory where the #include file is to live
|
||||
# exists. Need to do this for VPATH builds, because the directory
|
||||
# may not exist yet. For the "common" type, it's not really a
|
||||
# component, so it doesn't have a base.
|
||||
if test "$2" = "common" ; then
|
||||
outdir=$1/mca/common
|
||||
else
|
||||
outdir=$1/mca/$2/base
|
||||
fi
|
||||
AS_MKDIR_P([$outdir])
|
||||
|
||||
# remove any previously generated #include files
|
||||
outfile_real=$outdir/static-components.h
|
||||
outfile=$outfile_real.new
|
||||
rm -f $outfile $outfile.struct $outfile.extern
|
||||
touch $outfile.struct $outfile.extern
|
||||
|
||||
# print some nice messages about what we're about to do...
|
||||
AC_MSG_CHECKING([for no configure components in framework $2])
|
||||
AC_MSG_RESULT([mca_$2_no_config_component_list])
|
||||
AC_MSG_CHECKING([for m4 configure components in framework $2])
|
||||
AC_MSG_RESULT([mca_$2_m4_config_component_list])
|
||||
|
||||
# configure components that don't have any component-specific
|
||||
# configuration. See comment in CONFIGURE_PROJECT about the
|
||||
# m4_ifval in the m4_foreach. If there isn't a component list,
|
||||
# abort with a reasonable message. If there are components in the
|
||||
# list, but we're doing one of the "special" selection logics,
|
||||
# abort with a reasonable message.
|
||||
m4_ifdef([mca_$2_no_config_component_list], [],
|
||||
[m4_fatal([Could not find mca_$2_no_config_component_list - rerun autogen.sh without -l])])
|
||||
# make sure priority stuff set right
|
||||
m4_if(OMPI_EVAL_ARG([MCA_]mca_framework[_CONFIGURE_MODE]), [STOP_AT_FIRST],
|
||||
[m4_ifval(mca_$2_no_config_component_list,
|
||||
[m4_fatal([Framework $2 using STOP_AT_FIRST but at least one component has no configure.m4])])])
|
||||
m4_if(OMPI_EVAL_ARG([MCA_]mca_framework[_CONFIGURE_MODE]), [STOP_AT_FIRST_PRIORITY],
|
||||
[m4_ifval(mca_$2_no_config_component_list,
|
||||
[m4_fatal([Framework $2 using STOP_AT_FIRST but at least one component has no configure.m4])])])
|
||||
m4_foreach(mca_component, [mca_$2_no_config_component_list],
|
||||
[m4_ifval(mca_component,
|
||||
[MCA_CONFIGURE_NO_CONFIG_COMPONENT($1, $2, mca_component,
|
||||
[all_components],
|
||||
[static_components],
|
||||
[dso_components],
|
||||
[static_ltlibs],
|
||||
[$3])])])
|
||||
|
||||
# configure components that use built-in configuration scripts see
|
||||
# comment in CONFIGURE_PROJECT about the m4_ifval in the
|
||||
# m4_foreach. if there isn't a component list, abort
|
||||
m4_ifdef([mca_$2_m4_config_component_list], [],
|
||||
[m4_fatal([Could not find mca_$2_m4_config_component_list - rerun autogen.sh without -l])])
|
||||
best_mca_component_priority=0
|
||||
components_looking_for_succeed=$3
|
||||
components_last_result=0
|
||||
m4_foreach(mca_component, [mca_$2_m4_config_component_list],
|
||||
[m4_ifval(mca_component,
|
||||
[m4_if(OMPI_EVAL_ARG([MCA_]mca_framework[_CONFIGURE_MODE]), [STOP_AT_FIRST_PRIORITY],
|
||||
[ # get the component's priority...
|
||||
infile="$srcdir/$1/mca/$2/mca_component/configure.params"
|
||||
mca_component_priority="`$GREP PARAM_CONFIG_PRIORITY= $infile | cut -d= -f2-`"
|
||||
AS_IF([test -z "$mca_component_priority"], [mca_component_priority=0])
|
||||
AS_IF([test $best_mca_component_priority -gt $mca_component_priority], [components_looking_for_succeed=0])])
|
||||
MCA_CONFIGURE_M4_CONFIG_COMPONENT($1, $2, mca_component,
|
||||
[all_components],
|
||||
[static_components],
|
||||
[dso_components],
|
||||
[static_ltlibs],
|
||||
[$components_looking_for_succeed],
|
||||
[components_last_result=1],
|
||||
[components_last_result=0])
|
||||
m4_if(OMPI_EVAL_ARG([MCA_]mca_framework[_CONFIGURE_MODE]), [STOP_AT_FIRST],
|
||||
[AS_IF([test $components_last_result -eq 1], [components_looking_for_succeed=0])])
|
||||
m4_if(OMPI_EVAL_ARG([MCA_]mca_framework[_CONFIGURE_MODE]), [STOP_AT_FIRST_PRIORITY],
|
||||
[AS_IF([test $components_last_result -eq 1], [best_mca_component_priority=$mca_component_priority])])])])
|
||||
|
||||
# configure components that provide their own configure script.
|
||||
# It would be really hard to run these for "find first that
|
||||
# works", so we don't :)
|
||||
m4_if(OMPI_EVAL_ARG([MCA_]mca_framework[_CONFIGURE_MODE]), [STOP_AT_FIRST], [],
|
||||
[m4_if(OMPI_EVAL_ARG([MCA_]mca_framework[_CONFIGURE_MODE]), [STOP_AT_FIRST_PRIORITY], [],
|
||||
[AS_IF([test "$3" != "0"],
|
||||
[MCA_CONFIGURE_ALL_CONFIG_COMPONENTS($1, $2, [all_components],
|
||||
[static_components], [dso_components],
|
||||
[static_ltlibs])])])])
|
||||
|
||||
MCA_$2_ALL_COMPONENTS="$all_components"
|
||||
MCA_$2_STATIC_COMPONENTS="$static_components"
|
||||
MCA_$2_DSO_COMPONENTS="$dso_components"
|
||||
MCA_$2_STATIC_LTLIBS="$static_ltlibs"
|
||||
|
||||
AC_SUBST(MCA_$2_ALL_COMPONENTS)
|
||||
AC_SUBST(MCA_$2_STATIC_COMPONENTS)
|
||||
AC_SUBST(MCA_$2_DSO_COMPONENTS)
|
||||
AC_SUBST(MCA_$2_STATIC_LTLIBS)
|
||||
|
||||
OMPI_MCA_MAKE_DIR_LIST(MCA_$2_ALL_SUBDIRS, $2, [$all_components])
|
||||
OMPI_MCA_MAKE_DIR_LIST(MCA_$2_STATIC_SUBDIRS, $2, [$static_components])
|
||||
OMPI_MCA_MAKE_DIR_LIST(MCA_$2_DSO_SUBDIRS, $2, [$dso_components])
|
||||
|
||||
# Create the final .h file that will be included in the type's
|
||||
# top-level glue. This lists all the static components. We don't
|
||||
# need to do this for "common".
|
||||
if test "$2" != "common"; then
|
||||
cat > $outfile <<EOF
|
||||
/*
|
||||
* \$HEADER\$
|
||||
*/
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
`cat $outfile.extern`
|
||||
|
||||
const mca_base_component_t *mca_$2_base_static_components[[]] = {
|
||||
`cat $outfile.struct`
|
||||
NULL
|
||||
};
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
EOF
|
||||
# Only replace the header file if a) it doesn't previously
|
||||
# exist, or b) the contents are different. Do this to not
|
||||
# trigger recompilation of certain .c files just because the
|
||||
# timestamp changed on $outfile_real (similar to the way AC
|
||||
# handles AC_CONFIG_HEADER files).
|
||||
diff $outfile $outfile_real > /dev/null 2>&1
|
||||
if test "$?" != "0"; then
|
||||
mv $outfile $outfile_real
|
||||
else
|
||||
rm -f $outfile
|
||||
fi
|
||||
fi
|
||||
rm -f $outfile.struct $outfile.extern
|
||||
|
||||
unset all_components static_components dso_components outfile outfile_real
|
||||
])
|
||||
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# MCA_CONFIGURE_NO_CONFIG_COMPONENT
|
||||
#
|
||||
# Configure the given framework and all components inside the framework.
|
||||
# Assumes that the framework is located in [project_name]/mca/[framework],
|
||||
# and that all components are available under the framework directory.
|
||||
# Will configure all builtin components, then search for components with
|
||||
# configure scripts. Assumes that no component is marked as builtin
|
||||
# AND has a configure script.
|
||||
#
|
||||
# USAGE:
|
||||
# MCA_CONFIGURE_PROJECT(project_name, framework_name, component_name
|
||||
# all_components_variable,
|
||||
# static_components_variable,
|
||||
# dso_components_variable,
|
||||
# static_ltlibs_variable,
|
||||
# allowed_to_succeed)
|
||||
#
|
||||
######################################################################
|
||||
AC_DEFUN([MCA_CONFIGURE_NO_CONFIG_COMPONENT],[
|
||||
ompi_show_subsubsubtitle "MCA component $2:$3 (no configuration)"
|
||||
|
||||
MCA_COMPONENT_BUILD_CHECK($1, $2, $3,
|
||||
[should_build=$8], [should_build=0])
|
||||
MCA_COMPONENT_COMPILE_MODE($1, $2, $3, compile_mode)
|
||||
|
||||
if test "$should_build" = "1" ; then
|
||||
MCA_PROCESS_COMPONENT($1, $2, $3, $4, $5, $6, $7, $compile_mode)
|
||||
else
|
||||
MCA_PROCESS_DEAD_COMPONENT($1, $2, $3)
|
||||
# add component to all component list
|
||||
$4="$$4 $3"
|
||||
fi
|
||||
|
||||
# set the AM_CONDITIONAL on how we should build
|
||||
if test "$compile_mode" = "dso" ; then
|
||||
BUILD_$2_$3_DSO=1
|
||||
else
|
||||
BUILD_$2_$3_DSO=0
|
||||
fi
|
||||
AM_CONDITIONAL(OMPI_BUILD_$2_$3_DSO, test "$BUILD_$2_$3_DSO" = "1")
|
||||
|
||||
unset compile_mode
|
||||
])
|
||||
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# MCA_CONFIGURE_M4_CONFIG_COMPONENT
|
||||
#
|
||||
#
|
||||
# USAGE:
|
||||
# MCA_CONFIGURE_PROJECT(project_name, framework_name, component_name
|
||||
# all_components_variable,
|
||||
# static_components_variable,
|
||||
# dso_components_variable,
|
||||
# static_ltlibs_variable,
|
||||
# allowed_to_succeed,
|
||||
# [eval if should build],
|
||||
# [eval if should not build])
|
||||
#
|
||||
######################################################################
|
||||
AC_DEFUN([MCA_CONFIGURE_M4_CONFIG_COMPONENT],[
|
||||
ompi_show_subsubsubtitle "MCA component $2:$3 (m4 configuration macro)"
|
||||
|
||||
MCA_COMPONENT_BUILD_CHECK($1, $2, $3, [should_build=$8], [should_build=0])
|
||||
# Allow the component to override the build mode if it really wants to.
|
||||
# It is, of course, free to end up calling MCA_COMPONENT_COMPILE_MODE
|
||||
m4_ifdef([MCA_$2_$3_COMPILE_MODE],
|
||||
[MCA_$2_$3_COMPILE_MODE($1, $2, $3, compile_mode)],
|
||||
[MCA_COMPONENT_COMPILE_MODE($1, $2, $3, compile_mode)])
|
||||
|
||||
# try to configure the component. pay no attention to
|
||||
# --enable-dist, since we'll always have makefiles.
|
||||
AS_IF([test "$should_build" = "1"],
|
||||
[MCA_$2_$3_CONFIG([should_build=1],
|
||||
[should_build=0])])
|
||||
|
||||
AS_IF([test "$should_build" = "1"],
|
||||
[MCA_PROCESS_COMPONENT($1, $2, $3, $4, $5, $6, $7, $compile_mode)],
|
||||
[MCA_PROCESS_DEAD_COMPONENT($1, $2, $3)
|
||||
# add component to all component list
|
||||
$4="$$4 $3"])
|
||||
|
||||
m4_ifdef([MCA_$2_$3_POST_CONFIG],
|
||||
[MCA_$2_$3_POST_CONFIG($should_build)])
|
||||
|
||||
# set the AM_CONDITIONAL on how we should build
|
||||
AS_IF([test "$compile_mode" = "dso"],
|
||||
[BUILD_$2_$3_DSO=1],
|
||||
[BUILD_$2_$3_DSO=0])
|
||||
AM_CONDITIONAL(OMPI_BUILD_$2_$3_DSO, test "$BUILD_$2_$3_DSO" = "1")
|
||||
|
||||
AS_IF([test "$should_build" = "1"], [$9], [$10])
|
||||
|
||||
unset compile_mode
|
||||
])
|
||||
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# MCA_CONFIGURE_ALL_CONFIG_COMPONENTS
|
||||
#
|
||||
# configure all components in the given framework that have configure
|
||||
# scripts and should be configured according to the usual rules...
|
||||
#
|
||||
# USAGE:
|
||||
# MCA_CONFIGURE_ALL_CONFIG_COMPONENTS(project_name,
|
||||
# framework_name,
|
||||
# all_components_variable,
|
||||
# static_components_variable,
|
||||
# dso_components_variable,
|
||||
# static_ltlibs_variable)
|
||||
#
|
||||
######################################################################
|
||||
AC_DEFUN([MCA_CONFIGURE_ALL_CONFIG_COMPONENTS],[
|
||||
for component_path in $srcdir/$1/mca/$2/* ; do
|
||||
component="`basename $component_path`"
|
||||
if test -d $component_path -a -x $component_path/configure ; then
|
||||
ompi_show_subsubsubtitle "MCA component $2:$component (need to configure)"
|
||||
|
||||
MCA_COMPONENT_BUILD_CHECK($1, $2, $component,
|
||||
[should_build=1], [should_build=0])
|
||||
MCA_COMPONENT_COMPILE_MODE($1, $2, $component, compile_mode)
|
||||
|
||||
if test "$should_build" = "1" ; then
|
||||
OMPI_CONFIG_SUBDIR([$1/mca/$2/$component],
|
||||
[$ompi_subdir_args],
|
||||
[should_build=1], [should_build=2])
|
||||
fi
|
||||
|
||||
if test "$should_build" = "1" ; then
|
||||
MCA_PROCESS_COMPONENT($1, $2, $component, $3, $4, $5, $6, $compile_mode)
|
||||
else
|
||||
MCA_PROCESS_DEAD_COMPONENT($1, $2, $component)
|
||||
fi
|
||||
fi
|
||||
done
|
||||
])
|
||||
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# MCA_COMPONENT_COMPILE_MODE
|
||||
#
|
||||
# set compile_mode_variable to the compile mode for the given component
|
||||
#
|
||||
# USAGE:
|
||||
# MCA_COMPONENT_COMPILE_MODE(project_name,
|
||||
# framework_name, component_name
|
||||
# compile_mode_variable)
|
||||
#
|
||||
# NOTE: component_name may not be determined until runtime....
|
||||
#
|
||||
######################################################################
|
||||
AC_DEFUN([MCA_COMPONENT_COMPILE_MODE],[
|
||||
project=$1
|
||||
framework=$2
|
||||
component=$3
|
||||
|
||||
# Is this component going to built staic or shared? $component
|
||||
# might not be known until configure time, so have to use eval
|
||||
# tricks - can't set variable names at autogen time.
|
||||
str="SHARED_FRAMEWORK=\$DSO_$framework"
|
||||
eval $str
|
||||
str="SHARED_COMPONENT=\$DSO_${framework}_$component"
|
||||
eval $str
|
||||
|
||||
str="STATIC_FRAMEWORK=\$STATIC_$framework"
|
||||
eval $str
|
||||
str="STATIC_COMPONENT=\$STATIC_${framework}_$component"
|
||||
eval $str
|
||||
|
||||
shared_mode_override=static
|
||||
|
||||
# Setup for either shared or static
|
||||
if test "$STATIC_FRAMEWORK" = "1" -o \
|
||||
"$STATIC_COMPONENT" = "1" -o \
|
||||
"$STATIC_all" = "1" ; then
|
||||
$4="static"
|
||||
elif test "$shared_mode_override" = "dso" -o \
|
||||
"$SHARED_FRAMEWORK" = "1" -o \
|
||||
"$SHARED_COMPONENT" = "1" -o \
|
||||
"$DSO_all" = "1"; then
|
||||
$4="dso"
|
||||
else
|
||||
$4="static"
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for MCA component $framework:$component compile mode])
|
||||
if test "$DIRECT_$2" = "$component" ; then
|
||||
AC_MSG_RESULT([$$4 - direct])
|
||||
else
|
||||
AC_MSG_RESULT([$$4])
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# MCA_PROCESS_COMPONENT
|
||||
#
|
||||
# does all setup work for given component. It should be known before
|
||||
# calling that this component can build properly (and exists)
|
||||
#
|
||||
# USAGE:
|
||||
# MCA_CONFIGURE_ALL_CONFIG_COMPONENTS(project_name,
|
||||
# framework_name, component_name
|
||||
# all_components_variable (4),
|
||||
# static_components_variable (5),
|
||||
# dso_components_variable (6),
|
||||
# static_ltlibs_variable (7),
|
||||
# compile_mode_variable (8))
|
||||
#
|
||||
# NOTE: component_name may not be determined until runtime....
|
||||
#
|
||||
######################################################################
|
||||
AC_DEFUN([MCA_PROCESS_COMPONENT],[
|
||||
AC_REQUIRE([AC_PROG_GREP])
|
||||
|
||||
project=$1
|
||||
framework=$2
|
||||
component=$3
|
||||
|
||||
# See if it dropped an output file for us to pick up some
|
||||
# shell variables in.
|
||||
infile="$srcdir/$project/mca/$framework/$component/post_configure.sh"
|
||||
|
||||
# Add this subdir to the mast list of all MCA component subdirs
|
||||
$4="$$4 $component"
|
||||
|
||||
if test "$8" = "dso" ; then
|
||||
$6="$$6 $component"
|
||||
else
|
||||
$7="mca/$framework/$component/libmca_${framework}_${component}.la $$7"
|
||||
echo "extern const mca_base_component_t mca_${framework}_${component}_component;" >> $outfile.extern
|
||||
echo " &mca_${framework}_${component}_component, " >> $outfile.struct
|
||||
$5="$$5 $component"
|
||||
fi
|
||||
|
||||
# Output pretty results
|
||||
AC_MSG_CHECKING([if MCA component $framework:$component can compile])
|
||||
AC_MSG_RESULT([yes])
|
||||
|
||||
# If there's an output file, add the values to
|
||||
# scope_EXTRA_flags.
|
||||
if test -f $infile; then
|
||||
|
||||
# First check for the ABORT tag
|
||||
line="`$GREP ABORT= $infile | cut -d= -f2-`"
|
||||
if test -n "$line" -a "$line" != "no"; then
|
||||
AC_MSG_WARN([MCA component configure script told me to abort])
|
||||
AC_MSG_ERROR([cannot continue])
|
||||
fi
|
||||
|
||||
# Check for flags passed up from the component. If we're
|
||||
# compiling statically, then take all flags passed up from the
|
||||
# component.
|
||||
if test "$8" = "static"; then
|
||||
m4_foreach(flags, [LDFLAGS, LIBS],
|
||||
[[line="`$GREP WRAPPER_EXTRA_]flags[= $infile | cut -d= -f2-`"]
|
||||
eval "line=$line"
|
||||
if test -n "$line"; then
|
||||
$1[_WRAPPER_EXTRA_]flags[="$]$1[_WRAPPER_EXTRA_]flags[ $line"]
|
||||
fi
|
||||
])dnl
|
||||
fi
|
||||
|
||||
dnl check for direct call header to include. This will be
|
||||
dnl AC_SUBSTed later.
|
||||
if test "$DIRECT_$2" = "$component" ; then
|
||||
if test "`$GREP DIRECT_CALL_HEADER $infile`" != "" ; then
|
||||
line="`$GREP DIRECT_CALL_HEADER $infile | cut -d= -f2-`"
|
||||
str="MCA_${framework}_DIRECT_CALL_HEADER=$line"
|
||||
eval $str
|
||||
else
|
||||
AC_MSG_ERROR([*** ${framework} component ${component} was supposed to be direct-called, but
|
||||
*** does not appear to support direct calling.
|
||||
*** Aborting])
|
||||
fi
|
||||
fi
|
||||
else
|
||||
# were we supposed to have found something in the
|
||||
# post_configure.sh, but the file didn't exist?
|
||||
if test "$DIRECT_$2" = "$component" ; then
|
||||
AC_MSG_ERROR([*** ${framework} component ${component} was supposed to be direct-called, but
|
||||
*** does not appear to support direct calling.
|
||||
*** Aborting])
|
||||
fi
|
||||
fi
|
||||
|
||||
# now add the flags that were set in the environment variables
|
||||
# framework_component_FOO (for example, the flags set by
|
||||
# m4_configure components)
|
||||
#
|
||||
# Check for flags passed up from the component. If we're
|
||||
# compiling statically, then take all flags passed up from the
|
||||
# component.
|
||||
if test "$8" = "static"; then
|
||||
m4_foreach(flags, [LDFLAGS, LIBS],
|
||||
[[str="line=\$${framework}_${component}_WRAPPER_EXTRA_]flags["]
|
||||
eval "$str"
|
||||
if test -n "$line" ; then
|
||||
$1[_WRAPPER_EXTRA_]flags[="$]$1[_WRAPPER_EXTRA_]flags[ $line"]
|
||||
fi
|
||||
])dnl
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# MCA_PROCESS_DEAD_COMPONENT
|
||||
#
|
||||
# process a component that can not be built. Do the last minute checks
|
||||
# to make sure the user isn't doing something stupid.
|
||||
#
|
||||
# USAGE:
|
||||
# MCA_PROCESS_DEAD_COMPONENT(project_name,
|
||||
# framework_name, component_name)
|
||||
#
|
||||
# NOTE: component_name may not be determined until runtime....
|
||||
#
|
||||
######################################################################
|
||||
AC_DEFUN([MCA_PROCESS_DEAD_COMPONENT],[
|
||||
AC_MSG_CHECKING([if MCA component $2:$3 can compile])
|
||||
AC_MSG_RESULT([no])
|
||||
|
||||
# If this component was requested as the default for this
|
||||
# type, then abort.
|
||||
if test "$with_$2" = "$3" ; then
|
||||
AC_MSG_WARN([MCA component "$3" failed to configure properly])
|
||||
AC_MSG_WARN([This component was selected as the default])
|
||||
AC_MSG_ERROR([Cannot continue])
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test ! -z "$DIRECT_$2" ; then
|
||||
if test "$DIRECT_$2" = "$3" ; then
|
||||
AC_MSG_WARN([MCA component "$3" failed to configure properly])
|
||||
AC_MSG_WARN([This component was selected as the default (direct call)])
|
||||
AC_MSG_ERROR([Cannot continue])
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# MCA_COMPONENT_BUILD_CHECK
|
||||
#
|
||||
# checks the standard rules of component building to see if the
|
||||
# given component should be built.
|
||||
#
|
||||
# USAGE:
|
||||
# MCA_COMPONENT_BUILD_CHECK(project, framework, component,
|
||||
# action-if-build, action-if-not-build)
|
||||
#
|
||||
######################################################################
|
||||
AC_DEFUN([MCA_COMPONENT_BUILD_CHECK],[
|
||||
AC_REQUIRE([AC_PROG_GREP])
|
||||
|
||||
project=$1
|
||||
framework=$2
|
||||
component=$3
|
||||
component_path="$srcdir/$project/mca/$framework/$component"
|
||||
want_component=0
|
||||
|
||||
# build if:
|
||||
# - the component type is direct and we are that component
|
||||
# - there is no ompi_ignore file
|
||||
# - there is an ompi_ignore, but there is an empty ompi_unignore
|
||||
# - there is an ompi_ignore, but username is in ompi_unignore
|
||||
if test -d $component_path ; then
|
||||
# decide if we want the component to be built or not. This
|
||||
# is spread out because some of the logic is a little complex
|
||||
# and test's syntax isn't exactly the greatest. We want to
|
||||
# build the component by default.
|
||||
want_component=1
|
||||
if test -f $component_path/.ompi_ignore ; then
|
||||
# If there is an ompi_ignore file, don't build
|
||||
# the component. Note that this decision can be
|
||||
# overridden by the unignore logic below.
|
||||
want_component=0
|
||||
fi
|
||||
if test -f $component_path/.ompi_unignore ; then
|
||||
# if there is an empty ompi_unignore, that is
|
||||
# equivalent to having your userid in the unignore file.
|
||||
# If userid is in the file, unignore the ignore file.
|
||||
if test ! -s $component_path/.ompi_unignore ; then
|
||||
want_component=1
|
||||
elif test ! -z "`$GREP $OMPI_CONFIGURE_USER $component_path/.ompi_unignore`" ; then
|
||||
want_component=1
|
||||
fi
|
||||
fi
|
||||
# if this component type is direct and we are not it, we don't want
|
||||
# to be built. Otherwise, we do want to be built.
|
||||
if test ! -z "$DIRECT_$2" ; then
|
||||
if test "$DIRECT_$2" = "$component" ; then
|
||||
want_component=1
|
||||
else
|
||||
want_component=0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# if we were explicitly disabled, don't build :)
|
||||
str="DISABLED_COMPONENT_CHECK=\$DISABLE_${framework}"
|
||||
eval $str
|
||||
if test "$DISABLED_COMPONENT_CHECK" = "1" ; then
|
||||
want_component=0
|
||||
fi
|
||||
str="DISABLED_COMPONENT_CHECK=\$DISABLE_${framework}_$component"
|
||||
eval $str
|
||||
if test "$DISABLED_COMPONENT_CHECK" = "1" ; then
|
||||
want_component=0
|
||||
fi
|
||||
|
||||
AS_IF([test "$want_component" = "1"], [$4], [$5])
|
||||
])
|
||||
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# MCA_SETUP_DIRECT_CALL
|
||||
#
|
||||
# Do all the things necessary to setup the given framework for direct
|
||||
# call building
|
||||
#
|
||||
# USAGE:
|
||||
# MCA_SETUP_DIRECT_CALL(framework, project)
|
||||
#
|
||||
######################################################################
|
||||
AC_DEFUN([MCA_SETUP_DIRECT_CALL],[
|
||||
if test ! -z "$DIRECT_$1" ; then
|
||||
MCA_$1_DIRECT_CALL_COMPONENT=$DIRECT_$1
|
||||
MCA_$1_DIRECT_CALL=1
|
||||
else
|
||||
MCA_$1_DIRECT_CALL_COMPONENT=
|
||||
MCA_$1_DIRECT_CALL=0
|
||||
fi
|
||||
|
||||
AC_SUBST(MCA_$1_DIRECT_CALL_HEADER)
|
||||
AC_DEFINE_UNQUOTED([MCA_$1_DIRECT_CALL], [$MCA_$1_DIRECT_CALL],
|
||||
[Defined to 1 if $1 should use direct calls instead of components])
|
||||
AC_DEFINE_UNQUOTED([MCA_$1_DIRECT_CALL_COMPONENT], [$MCA_$1_DIRECT_CALL_COMPONENT],
|
||||
[name of component to use for direct calls, if MCA_$1_DIRECT_CALL is 1])
|
||||
AC_DEFINE_UNQUOTED([MCA_$1_DIRECT_CALL_HEADER],
|
||||
["[$MCA_]$1[_DIRECT_CALL_HEADER]"],
|
||||
[Header $1 includes to be direct called])
|
||||
])
|
||||
|
||||
|
||||
# OMPI_MCA_MAKE_DIR_LIST(subst'ed variable, framework, shell list)
|
||||
# -------------------------------------------------------------------------
|
||||
AC_DEFUN([OMPI_MCA_MAKE_DIR_LIST],[
|
||||
$1=
|
||||
for item in $3 ; do
|
||||
$1="$$1 mca/$2/$item"
|
||||
done
|
||||
AC_SUBST($1)
|
||||
])
|
118
config/ompi_microsoft.m4
Обычный файл
118
config/ompi_microsoft.m4
Обычный файл
@ -0,0 +1,118 @@
|
||||
dnl -*- shell-script -*-
|
||||
dnl
|
||||
dnl Copyright (c) 2004-2007 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_MICROSOFT_COMPILER
|
||||
#
|
||||
# Keep all the Windows checks in one place.
|
||||
#
|
||||
# USAGE:
|
||||
# OMPI_MICROSOFT_COMPILER()
|
||||
#
|
||||
######################################################################
|
||||
AC_DEFUN([OMPI_MICROSOFT_COMPILER],[
|
||||
|
||||
# If we are using one of the Microsoft compilers check that we are
|
||||
# able to include windows.h. Most of the types that follow are defined
|
||||
# in this file. If we check for it here it will get included in the
|
||||
# default list of header files.
|
||||
if test "x$ompi_cv_c_compiler_vendor" = "xmicrosoft" ; then
|
||||
|
||||
ompi_show_subtitle "Microsoft specific detection"
|
||||
|
||||
#
|
||||
# These 2 libraries are a minimum ...
|
||||
SAVE_LDFLAGS="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS Ws2_32.lib Advapi32.lib"
|
||||
|
||||
AC_CHECK_HEADERS([windows.h winsock2.h wdm.h])
|
||||
|
||||
# The atomic functions are defined in a very unuasual manner.
|
||||
# Some of them are intrinsic defined in windows.h others are
|
||||
# exported by kernel32.dll. If we force the usage of AC_TRY_RUN
|
||||
# here we will check for both in same time: compilation and run.
|
||||
|
||||
AC_MSG_CHECKING(for working InterlockedCompareExchange)
|
||||
AC_TRY_RUN( [#include <windows.h>
|
||||
int main() {
|
||||
LONG dest = 1, exchange = 0, comperand = 1;
|
||||
SetErrorMode(SEM_FAILCRITICALERRORS);
|
||||
InterlockedCompareExchange( &dest, exchange, comperand );
|
||||
return (int)dest;
|
||||
}],
|
||||
[AC_MSG_RESULT(yes)
|
||||
ompi_windows_have_support_for_32_bits_atomic=1],
|
||||
[AC_MSG_RESULT(no)
|
||||
ompi_windows_have_support_for_32_bits_atomic=0])
|
||||
AC_DEFINE_UNQUOTED(HAVE_INTERLOCKEDCOMPAREEXCHANGE,
|
||||
$ompi_windows_have_support_for_32_bits_atomic,
|
||||
[Whether we support 32 bits atomic operations on Windows])
|
||||
|
||||
AC_MSG_CHECKING(for working InterlockedCompareExchangeAcquire)
|
||||
AC_TRY_RUN( [#include <windows.h>
|
||||
int main() {
|
||||
LONG dest = 1, exchange = 0, comperand = 1;
|
||||
SetErrorMode(SEM_FAILCRITICALERRORS);
|
||||
InterlockedCompareExchangeAcquire( &dest, exchange, comperand );
|
||||
return (int)dest;
|
||||
}],
|
||||
[AC_MSG_RESULT(yes)
|
||||
ompi_windows_have_support_for_32_bits_atomic=1],
|
||||
[AC_MSG_RESULT(no)
|
||||
ompi_windows_have_support_for_32_bits_atomic=0])
|
||||
AC_DEFINE_UNQUOTED(HAVE_INTERLOCKEDCOMPAREEXCHANGEACQUIRE,
|
||||
$ompi_windows_have_support_for_32_bits_atomic,
|
||||
[Whether we support 32 bits atomic operations on Windows])
|
||||
|
||||
AC_MSG_CHECKING(for working InterlockedCompareExchangeRelease)
|
||||
AC_TRY_RUN( [#include <windows.h>
|
||||
int main() {
|
||||
LONG dest = 1, exchange = 0, comperand = 1;
|
||||
SetErrorMode(SEM_FAILCRITICALERRORS);
|
||||
InterlockedCompareExchangeRelease( &dest, exchange, comperand );
|
||||
return (int)dest;
|
||||
}],
|
||||
[AC_MSG_RESULT(yes)
|
||||
ompi_windows_have_support_for_32_bits_atomic=1],
|
||||
[AC_MSG_RESULT(no)
|
||||
ompi_windows_have_support_for_32_bits_atomic=0])
|
||||
AC_DEFINE_UNQUOTED(HAVE_INTERLOCKEDCOMPAREEXCHANGERELEASE,
|
||||
$ompi_windows_have_support_for_32_bits_atomic,
|
||||
[Whether we support 32 bits atomic operations on Windows])
|
||||
|
||||
AC_MSG_CHECKING(for working InterlockedCompareExchange64)
|
||||
AC_TRY_RUN( [#include <windows.h>
|
||||
int main() {
|
||||
LONGLONG dest = 1, exchange = 0, comperand = 1;
|
||||
SetErrorMode(SEM_FAILCRITICALERRORS);
|
||||
InterlockedCompareExchange64( &dest, exchange, comperand );
|
||||
return (int)dest;
|
||||
}],
|
||||
[AC_MSG_RESULT(yes)
|
||||
ompi_windows_have_support_for_64_bits_atomic=1],
|
||||
[AC_MSG_RESULT(no)
|
||||
ompi_windows_have_support_for_64_bits_atomic=0])
|
||||
AC_DEFINE_UNQUOTED(HAVE_INTERLOCKEDCOMPAREEXCHANGE64,
|
||||
$ompi_windows_have_support_for_64_bits_atomic,
|
||||
[Whether we support 64 bits atomic operations on Windows])
|
||||
|
||||
ompi_show_title "Windows Type tests"
|
||||
|
||||
AC_DEFINE([pid_t], [intptr_t], [Windows pid_t type is a pointer])
|
||||
AC_DEFINE_UNQUOTED([SIZEOF_PID_T], $ac_cv_sizeof_int,
|
||||
[and here is it's size])
|
||||
|
||||
LDFLAGS="$SAVE_LDFLAGS"
|
||||
fi
|
||||
|
||||
])
|
60
config/ompi_save_version.m4
Обычный файл
60
config/ompi_save_version.m4
Обычный файл
@ -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 (c) 2008 Cisco Systems, Inc. All rights reserved.
|
||||
dnl $COPYRIGHT$
|
||||
dnl
|
||||
dnl Additional copyrights may follow
|
||||
dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
# OMPI_SAVE_VERSION(project_short, project-long,
|
||||
# version_file, header_file])
|
||||
# ----------------------------------------------
|
||||
# creates version information for project from version_file, using
|
||||
# OMPI_GET_VERSION(). Information is AC_SUBSTed and put in
|
||||
# header_file.
|
||||
AC_DEFUN([OMPI_SAVE_VERSION], [
|
||||
OMPI_GET_VERSION([$3], [$1])
|
||||
|
||||
AC_SUBST($1[_MAJOR_VERSION])
|
||||
AC_SUBST($1[_MINOR_VERSION])
|
||||
AC_SUBST($1[_RELEASE_VERSION])
|
||||
AC_SUBST($1[_GREEK_VERSION])
|
||||
AC_SUBST($1[_WANT_SVN])
|
||||
AC_SUBST($1[_SVN_R])
|
||||
AC_SUBST($1[_VERSION])
|
||||
AC_SUBST($1[_RELEASE_DATE])
|
||||
|
||||
AC_MSG_CHECKING([$2 version])
|
||||
AC_MSG_RESULT([$]$1[_VERSION])
|
||||
AC_MSG_CHECKING([$2 release date])
|
||||
AC_MSG_RESULT([$]$1[_RELEASE_DATE])
|
||||
AC_MSG_CHECKING([$2 Subversion repository version])
|
||||
AC_MSG_RESULT([$]$1[_SVN_R])
|
||||
|
||||
AC_DEFINE_UNQUOTED($1[_MAJOR_VERSION], [$]$1[_MAJOR_VERSION],
|
||||
[Major release number of ]$2)
|
||||
AC_DEFINE_UNQUOTED($1[_MINOR_VERSION], [$]$1[_MINOR_VERSION],
|
||||
[Minor release number of ]$2)
|
||||
AC_DEFINE_UNQUOTED($1[_RELEASE_VERSION], [$]$1[_RELEASE_VERSION],
|
||||
[Release release number of ]$2)
|
||||
AC_DEFINE_UNQUOTED($1[_GREEK_VERSION], ["$]$1[_GREEK_VERSION"],
|
||||
[Greek - alpha, beta, etc - release number of ]$2)
|
||||
AC_DEFINE_UNQUOTED($1[_VERSION], ["$]$1[_RELEASE_VERSION"],
|
||||
[Complete release number of ]$2)
|
||||
AC_DEFINE_UNQUOTED($1[_RELEASE_DATE], ["$]$1[_RELEASE_DATE"],
|
||||
[Release date of ]$2)
|
||||
|
||||
AC_CONFIG_FILES([$4])
|
||||
])dnl
|
325
config/ompi_setup_cc.m4
Обычный файл
325
config/ompi_setup_cc.m4
Обычный файл
@ -0,0 +1,325 @@
|
||||
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-2006 The University of Tennessee and The University
|
||||
dnl of Tennessee Research Foundation. All rights
|
||||
dnl reserved.
|
||||
dnl Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
|
||||
dnl University of Stuttgart. All rights reserved.
|
||||
dnl Copyright (c) 2004-2006 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
|
||||
|
||||
# OMPI_SETUP_CC()
|
||||
# ---------------
|
||||
# Do everything required to setup the C compiler. Safe to AC_REQUIRE
|
||||
# this macro.
|
||||
AC_DEFUN([OMPI_SETUP_CC],[
|
||||
# AM_PROG_CC_C_O AC_REQUIREs AC_PROG_CC, so we have to be a little
|
||||
# careful about ordering here, and AC_REQUIRE these things so that
|
||||
# they get stamped out in the right order.
|
||||
|
||||
AC_REQUIRE([_OMPI_START_SETUP_CC])
|
||||
AC_REQUIRE([_OMPI_PROG_CC])
|
||||
AC_REQUIRE([AM_PROG_CC_C_O])
|
||||
|
||||
OMPI_C_COMPILER_VENDOR([ompi_c_vendor])
|
||||
|
||||
# Check for standard headers, needed here because needed before
|
||||
# the types checks.
|
||||
AC_HEADER_STDC
|
||||
|
||||
# GNU C and autotools are inconsistent about whether this is
|
||||
# defined so let's make it true everywhere for now... However, IBM
|
||||
# XL compilers on PPC Linux behave really badly when compiled with
|
||||
# _GNU_SOURCE defined, so don't define it in that situation.
|
||||
#
|
||||
# Don't use AC_GNU_SOURCE because it requires that no compiler
|
||||
# tests are done before setting it, and we need to at least do
|
||||
# enough tests to figure out if we're using XL or not.
|
||||
AS_IF([test "$ompi_cv_c_compiler_vendor" != "ibm"],
|
||||
[AH_VERBATIM([_GNU_SOURCE],
|
||||
[/* Enable GNU extensions on systems that have them. */
|
||||
#ifndef _GNU_SOURCE
|
||||
# undef _GNU_SOURCE
|
||||
#endif])
|
||||
AC_DEFINE([_GNU_SOURCE])])
|
||||
|
||||
# Do we want code coverage
|
||||
if test "$WANT_COVERAGE" = "1"; then
|
||||
if test "$ompi_c_vendor" = "gnu" ; then
|
||||
# For compilers > gcc-4.x, use --coverage for
|
||||
# compiling and linking to circumvent trouble with
|
||||
# libgcov.
|
||||
CFLAGS_orig="$CFLAGS"
|
||||
LDFLAGS_orig="$LDFLAGS"
|
||||
|
||||
CFLAGS="$CFLAGS_orig --coverage"
|
||||
LDFLAGS="$LDFLAGS_orig --coverage"
|
||||
OMPI_COVERAGE_FLAGS=
|
||||
|
||||
AC_CACHE_CHECK([if $CC supports --coverage],
|
||||
[ompi_cv_cc_coverage],
|
||||
[AC_TRY_COMPILE([], [],
|
||||
[ompi_cv_cc_coverage="yes"],
|
||||
[ompi_cv_cc_coverage="no"])])
|
||||
|
||||
if test "$ompi_cv_cc_coverage" = "yes" ; then
|
||||
OMPI_COVERAGE_FLAGS="--coverage"
|
||||
CLEANFILES="*.gcno ${CLEANFILES}"
|
||||
CONFIG_CLEAN_FILES="*.gcda *.gcov ${CONFIG_CLEAN_FILES}"
|
||||
else
|
||||
OMPI_COVERAGE_FLAGS="-ftest-coverage -fprofile-arcs"
|
||||
CLEANFILES="*.bb *.bbg ${CLEANFILES}"
|
||||
CONFIG_CLEAN_FILES="*.da *.*.gcov ${CONFIG_CLEAN_FILES}"
|
||||
fi
|
||||
CFLAGS="$CFLAGS_orig $OMPI_COVERAGE_FLAGS"
|
||||
LDFLAGS="$LDFLAGS_orig $OMPI_COVERAGE_FLAGS"
|
||||
WRAPPER_EXTRA_CFLAGS="${WRAPPER_EXTRA_CFLAGS} $OMPI_COVERAGE_FLAGS"
|
||||
WRAPPER_EXTRA_LDFLAGS="${WRAPPER_EXTRA_LDFLAGS} $OMPI_COVERAGE_FLAGS"
|
||||
|
||||
OMPI_UNIQ(CFLAGS)
|
||||
OMPI_UNIQ(LDFLAGS)
|
||||
OMPI_UNIQ(WRAPPER_EXTRA_CFLAGS)
|
||||
OMPI_UNIQ(WRAPPER_EXTRA_LDFLAGS)
|
||||
AC_MSG_WARN([$OMPI_COVERAGE_FLAGS has been added to CFLAGS (--enable-coverage)])
|
||||
|
||||
WANT_DEBUG=1
|
||||
else
|
||||
AC_MSG_WARN([Code coverage functionality is currently available only with GCC])
|
||||
AC_MSG_ERROR([Configure: Cannot continue])
|
||||
fi
|
||||
fi
|
||||
|
||||
# Do we want debugging?
|
||||
if test "$WANT_DEBUG" = "1" -a "$enable_debug_symbols" != "no" ; then
|
||||
if test "$ompi_c_vendor" = "gnu"; then
|
||||
CFLAGS="$CFLAGS -g" # keep the -g3 for when it will become a standard option.
|
||||
else
|
||||
CFLAGS="$CFLAGS -g"
|
||||
fi
|
||||
|
||||
OMPI_UNIQ(CFLAGS)
|
||||
AC_MSG_WARN([-g has been added to CFLAGS (--enable-debug)])
|
||||
fi
|
||||
|
||||
# These flags are generally gcc-specific; even the
|
||||
# gcc-impersonating compilers won't accept them.
|
||||
OMPI_CFLAGS_BEFORE_PICKY="$CFLAGS"
|
||||
if test "$WANT_PICKY_COMPILER" = 1 -a "$ompi_c_vendor" = "gnu" ; then
|
||||
add="-Wall -Wundef -Wno-long-long -Wsign-compare"
|
||||
add="$add -Wmissing-prototypes -Wstrict-prototypes"
|
||||
add="$add -Wcomment -pedantic"
|
||||
|
||||
# see if -Wno-long-double works...
|
||||
CFLAGS_orig="$CFLAGS"
|
||||
# CFLAGS="$CFLAGS -Wno-long-double"
|
||||
# Starting with GCC-4.4, the compiler complains about not
|
||||
# knowing -Wno-long-double, only if -Wstrict-prototypes is set, too.
|
||||
#
|
||||
# Actually, this is not real fix, as GCC will pass on any -Wno- flag,
|
||||
# have fun with the warning: -Wno-britney
|
||||
CFLAGS="$CFLAGS -Wno-long-double -Wstrict-prototypes"
|
||||
|
||||
AC_CACHE_CHECK([if $CC supports -Wno-long-double],
|
||||
[ompi_cv_cc_wno_long_double],
|
||||
[AC_TRY_COMPILE([], [],
|
||||
[ompi_cv_cc_wno_long_double="yes"],
|
||||
[ompi_cv_cc_wno_long_double="no"])])
|
||||
|
||||
CFLAGS="$CFLAGS_orig"
|
||||
if test "$ompi_cv_cc_wno_long_double" = "yes" ; then
|
||||
add="$add -Wno-long-double"
|
||||
fi
|
||||
|
||||
add="$add -Werror-implicit-function-declaration "
|
||||
|
||||
CFLAGS="$CFLAGS $add"
|
||||
OMPI_UNIQ(CFLAGS)
|
||||
AC_MSG_WARN([$add has been added to CFLAGS (--enable-picky)])
|
||||
unset add
|
||||
fi
|
||||
|
||||
# See if this version of gcc allows -finline-functions and/or
|
||||
# -fno-strict-aliasing. Even check the gcc-impersonating compilers.
|
||||
if test "$GCC" = "yes"; then
|
||||
CFLAGS_orig="$CFLAGS"
|
||||
|
||||
CFLAGS="$CFLAGS_orig -finline-functions"
|
||||
add=
|
||||
AC_CACHE_CHECK([if $CC supports -finline-functions],
|
||||
[ompi_cv_cc_finline_functions],
|
||||
[AC_TRY_COMPILE([], [],
|
||||
[ompi_cv_cc_finline_functions="yes"],
|
||||
[ompi_cv_cc_finline_functions="no"])])
|
||||
if test "$ompi_cv_cc_finline_functions" = "yes" ; then
|
||||
add=" -finline-functions"
|
||||
fi
|
||||
CFLAGS="$CFLAGS_orig$add"
|
||||
|
||||
CFLAGS_orig="$CFLAGS"
|
||||
CFLAGS="$CFLAGS_orig -fno-strict-aliasing"
|
||||
add=
|
||||
AC_CACHE_CHECK([if $CC supports -fno-strict-aliasing],
|
||||
[ompi_cv_cc_fno_strict_aliasing],
|
||||
[AC_TRY_COMPILE([], [],
|
||||
[ompi_cv_cc_fno_strict_aliasing="yes"],
|
||||
[ompi_cv_cc_fno_strict_aliasing="no"])])
|
||||
if test "$ompi_cv_cc_fno_strict_aliasing" = "yes" ; then
|
||||
add=" -fno-strict-aliasing"
|
||||
fi
|
||||
CFLAGS="$CFLAGS_orig$add"
|
||||
|
||||
OMPI_UNIQ(CFLAGS)
|
||||
AC_MSG_WARN([$add has been added to CFLAGS])
|
||||
unset add
|
||||
fi
|
||||
|
||||
# Try to enable restrict keyword
|
||||
RESTRICT_CFLAGS=
|
||||
case "$ompi_c_vendor" in
|
||||
intel)
|
||||
RESTRICT_CFLAGS="-restrict"
|
||||
;;
|
||||
sgi)
|
||||
RESTRICT_CFLAGS="-LANG:restrict=ON"
|
||||
;;
|
||||
esac
|
||||
if test ! -z "$RESTRICT_CFLAGS" ; then
|
||||
CFLAGS_orig="$CFLAGS"
|
||||
CFLAGS="$CFLAGS_orig $RESTRICT_CFLAGS"
|
||||
add=
|
||||
AC_CACHE_CHECK([if $CC supports $RESTRICT_CFLAGS],
|
||||
[ompi_cv_cc_restrict_cflags],
|
||||
[AC_TRY_COMPILE([], [],
|
||||
[ompi_cv_cc_restrict_cflags="yes"],
|
||||
[ompi_cv_cc_restrict_cflags="no"])])
|
||||
if test "$ompi_cv_cc_restrict_cflags" = "yes" ; then
|
||||
add=" $RESTRICT_CFLAGS"
|
||||
fi
|
||||
|
||||
CFLAGS="${CFLAGS_orig}${add}"
|
||||
OMPI_UNIQ([CFLAGS])
|
||||
if test "$add" != "" ; then
|
||||
AC_MSG_WARN([$add has been added to CFLAGS])
|
||||
fi
|
||||
unset add
|
||||
fi
|
||||
|
||||
# see if the C compiler supports __builtin_expect
|
||||
AC_CACHE_CHECK([if $CC supports __builtin_expect],
|
||||
[ompi_cv_cc_supports___builtin_expect],
|
||||
[AC_TRY_LINK([],
|
||||
[void *ptr = (void*) 0;
|
||||
if (__builtin_expect (ptr != (void*) 0, 1)) return 0;],
|
||||
[ompi_cv_cc_supports___builtin_expect="yes"],
|
||||
[ompi_cv_cc_supports___builtin_expect="no"])])
|
||||
if test "$ompi_cv_cc_supports___builtin_expect" = "yes" ; then
|
||||
have_builtin_expect=1
|
||||
else
|
||||
have_builtin_expect=0
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED([OMPI_C_HAVE_BUILTIN_EXPECT], [$have_builtin_expect],
|
||||
[Whether C compiler supports __builtin_expect])
|
||||
|
||||
# see if the C compiler supports __builtin_prefetch
|
||||
AC_CACHE_CHECK([if $CC supports __builtin_prefetch],
|
||||
[ompi_cv_cc_supports___builtin_prefetch],
|
||||
[AC_TRY_LINK([],
|
||||
[int ptr;
|
||||
__builtin_prefetch(&ptr,0,0);],
|
||||
[ompi_cv_cc_supports___builtin_prefetch="yes"],
|
||||
[ompi_cv_cc_supports___builtin_prefetch="no"])])
|
||||
if test "$ompi_cv_cc_supports___builtin_prefetch" = "yes" ; then
|
||||
have_builtin_prefetch=1
|
||||
else
|
||||
have_builtin_prefetch=0
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED([OMPI_C_HAVE_BUILTIN_PREFETCH], [$have_builtin_prefetch],
|
||||
[Whether C compiler supports __builtin_prefetch])
|
||||
|
||||
# Preload the optflags for the case where the user didn't specify
|
||||
# any. If we're using GNU compilers, use -O3 (since it GNU
|
||||
# doesn't require all compilation units to be compiled with the
|
||||
# same level of optimization -- selecting a high level of
|
||||
# optimization is not prohibitive). If we're using anything else,
|
||||
# be conservative and just use -O.
|
||||
#
|
||||
# Note: gcc-impersonating compilers accept -O3
|
||||
if test "$WANT_DEBUG" = "1"; then
|
||||
OPTFLAGS=
|
||||
else
|
||||
if test "$GCC" = yes; then
|
||||
OPTFLAGS="-O3"
|
||||
else
|
||||
OPTFLAGS="-O"
|
||||
fi
|
||||
fi
|
||||
|
||||
OMPI_CHECK_OPTFLAGS("$OMPI_CFLAGS_BEFORE_PICKY")
|
||||
OMPI_CFLAGS_BEFORE_PICKY="$co_result"
|
||||
|
||||
AC_MSG_CHECKING([for C optimization flags])
|
||||
OMPI_CHECK_OPTFLAGS(["$CFLAGS"])
|
||||
AC_MSG_RESULT([$co_result])
|
||||
CFLAGS="$co_result"
|
||||
|
||||
CFLAGS_WITHOUT_OPTFLAGS=""
|
||||
for co_word in $CFLAGS ; do
|
||||
co_found=0
|
||||
case $co_word in
|
||||
+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
|
||||
if test "$co_found" = "0" ; then
|
||||
CFLAGS_WITHOUT_OPTFLAGS="$CFLAGS_WITHOUT_OPTFLAGS $co_word"
|
||||
fi
|
||||
done
|
||||
|
||||
unset co_found co_word
|
||||
|
||||
AC_SUBST([CFLAGS_WITHOUT_OPTFLAGS])
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([_OMPI_START_SETUP_CC],[
|
||||
ompi_show_subtitle "C compiler and preprocessor"
|
||||
|
||||
# $%@#!@#% AIX!! This has to be called before anything invokes the C
|
||||
# compiler.
|
||||
dnl AC_AIX
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([_OMPI_PROG_CC],[
|
||||
#
|
||||
# Check for the compiler
|
||||
#
|
||||
ompi_cflags_save="$CFLAGS"
|
||||
AC_PROG_CC
|
||||
BASECC="`basename $CC`"
|
||||
CFLAGS="$ompi_cflags_save"
|
||||
AC_DEFINE_UNQUOTED(OMPI_CC, "$CC", [OMPI underlying C compiler])
|
||||
set dummy $CC
|
||||
ompi_cc_argv0=[$]2
|
||||
OMPI_WHICH([$ompi_cc_argv0], [OMPI_CC_ABSOLUTE])
|
||||
AC_SUBST(OMPI_CC_ABSOLUTE)
|
||||
])
|
299
config/ompi_setup_cxx.m4
Обычный файл
299
config/ompi_setup_cxx.m4
Обычный файл
@ -0,0 +1,299 @@
|
||||
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-2006 The University of Tennessee and The University
|
||||
dnl of Tennessee Research Foundation. All rights
|
||||
dnl reserved.
|
||||
dnl Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
|
||||
dnl University of Stuttgart. All rights reserved.
|
||||
dnl Copyright (c) 2004-2006 The Regents of the University of California.
|
||||
dnl All rights reserved.
|
||||
dnl Copyright (c) 2006 Los Alamos National Security, LLC. All rights
|
||||
dnl reserved.
|
||||
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
dnl $COPYRIGHT$
|
||||
dnl
|
||||
dnl Additional copyrights may follow
|
||||
dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
# OMPI_SETUP_CXX()
|
||||
# ----------------
|
||||
# Do everything required to setup the C++ compiler. Safe to AC_REQUIRE
|
||||
# this macro.
|
||||
AC_DEFUN([OMPI_SETUP_CXX],[
|
||||
|
||||
AC_REQUIRE([_OMPI_START_SETUP_CXX])
|
||||
AC_REQUIRE([_OMPI_PROG_CXX])
|
||||
|
||||
# Do we want code coverage
|
||||
if test "$WANT_COVERAGE" = "1"; then
|
||||
if test "$ompi_cxx_vendor" = "gnu" ; then
|
||||
AC_MSG_WARN([$OMPI_COVERAGE_FLAGS has been added to CFLAGS (--enable-coverage)])
|
||||
WANT_DEBUG=1
|
||||
CXXFLAGS="${CXXFLAGS} $OMPI_COVERAGE_FLAGS"
|
||||
WRAPPER_EXTRA_CXXFLAGS="${WRAPPER_EXTRA_CXXFLAGS} $OMPI_COVERAGE_FLAGS"
|
||||
else
|
||||
AC_MSG_WARN([Code coverage functionality is currently available only with GCC suite])
|
||||
AC_MSG_ERROR([Configure: cannot continue])
|
||||
fi
|
||||
fi
|
||||
|
||||
# Do we want debugging?
|
||||
if test "$WANT_DEBUG" = "1" -a "$enable_debug_symbols" != "no" ; then
|
||||
CXXFLAGS="$CXXFLAGS -g"
|
||||
OMPI_UNIQ(CXXFLAGS)
|
||||
AC_MSG_WARN([-g has been added to CXXFLAGS (--enable-debug)])
|
||||
fi
|
||||
|
||||
# These flags are generally g++-specific; even the g++-impersonating
|
||||
# compilers won't accept them.
|
||||
OMPI_CXXFLAGS_BEFORE_PICKY="$CXXFLAGS"
|
||||
if test "$WANT_PICKY_COMPILER" = 1 -a "$ompi_cxx_vendor" = "gnu"; then
|
||||
add="-Wall -Wundef -Wno-long-long"
|
||||
|
||||
# see if -Wno-long-double works...
|
||||
AC_LANG_PUSH(C++)
|
||||
CXXFLAGS_orig="$CXXFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS -Wno-long-double -fstrict-prototype"
|
||||
AC_CACHE_CHECK([if $CXX supports -Wno-long-double],
|
||||
[ompi_cv_cxx_wno_long_double],
|
||||
[AC_TRY_COMPILE([], [],
|
||||
[ompi_cv_cxx_wno_long_double="yes"],
|
||||
[ompi_cv_cxx_wno_long_double="no"])])
|
||||
CXXFLAGS="$CXXFLAGS_orig"
|
||||
AC_LANG_POP(C++)
|
||||
if test "$ompi_cv_cxx_wno_long_double" = "yes" ; then
|
||||
add="$add -Wno-long-double"
|
||||
fi
|
||||
|
||||
CXXFLAGS="$CXXFLAGS $add"
|
||||
OMPI_UNIQ(CXXFLAGS)
|
||||
if test "$add" != "" ; then
|
||||
AC_MSG_WARN([$add has been added to CXXFLAGS (--enable-picky)])
|
||||
fi
|
||||
unset add
|
||||
fi
|
||||
|
||||
# See if this version of g++ allows -finline-functions
|
||||
if test "$GXX" = "yes"; then
|
||||
CXXFLAGS_orig="$CXXFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS -finline-functions"
|
||||
add=
|
||||
AC_CACHE_CHECK([if $CXX supports -finline-functions],
|
||||
[ompi_cv_cxx_finline_functions],
|
||||
[AC_TRY_COMPILE([], [],
|
||||
[ompi_cv_cxx_finline_functions="yes"],
|
||||
[ompi_cv_cxx_finline_functions="no"])])
|
||||
if test "$ompi_cv_cxx_finline_functions" = "yes" ; then
|
||||
add=" -finline-functions"
|
||||
fi
|
||||
CXXFLAGS="$CXXFLAGS_orig$add"
|
||||
OMPI_UNIQ(CXXFLAGS)
|
||||
if test "$add" != "" ; then
|
||||
AC_MSG_WARN([$add has been added to CXXFLAGS])
|
||||
fi
|
||||
unset add
|
||||
fi
|
||||
|
||||
# Check for special things due to C++ exceptions
|
||||
ENABLE_CXX_EXCEPTIONS=no
|
||||
HAVE_CXX_EXCEPTIONS=0
|
||||
AC_ARG_ENABLE([cxx-exceptions],
|
||||
[AC_HELP_STRING([--enable-cxx-exceptions],
|
||||
[enable support for C++ exceptions (default: disabled)])],
|
||||
[ENABLE_CXX_EXCEPTIONS="$enableval"])
|
||||
|
||||
AC_MSG_CHECKING([if want C++ exception handling])
|
||||
AC_MSG_RESULT([$ENABLE_CXX_EXCEPTIONS])
|
||||
if test "$ENABLE_CXX_EXCEPTIONS" = "yes"; then
|
||||
# config/cxx_have_exceptions.m4
|
||||
OMPI_CXX_HAVE_EXCEPTIONS
|
||||
# config/cxx_find_exception_flags.m4
|
||||
OMPI_CXX_FIND_EXCEPTION_FLAGS
|
||||
if test "$OMPI_CXX_EXCEPTIONS" = "1"; then
|
||||
HAVE_CXX_EXCEPTIONS=1
|
||||
|
||||
# Test to see if the C compiler likes these flags
|
||||
AC_MSG_CHECKING([to see if C compiler likes the exception flags])
|
||||
CFLAGS="$CFLAGS $OMPI_CXX_EXCEPTIONS_CXXFLAGS"
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_C
|
||||
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[]], [[int i = 0;]]),
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([no])
|
||||
AC_MSG_WARN([C++ exception flags are different between the C and C++ compilers; this configure script cannot currently handle this scenario. Either disable C++ exception support or send mail to the Open MPI users list.])
|
||||
AC_MSG_ERROR([*** Cannot continue])])
|
||||
AC_LANG_RESTORE
|
||||
|
||||
# We can't test the F77 and F90 compilers now because we
|
||||
# haven't found/set the up yet. So just save the flags
|
||||
# and test them later (in ompi_setup_f77.m4 and
|
||||
# ompi_setup_f90.m4).
|
||||
|
||||
CXXFLAGS="$CXXFLAGS $OMPI_CXX_EXCEPTIONS_CXXFLAGS"
|
||||
LDFLAGS="$LDFLAGS $OMPI_CXX_EXCEPTIONS_LDFLAGS"
|
||||
|
||||
WRAPPER_EXTRA_CFLAGS="$OMPI_CXX_EXCEPTIONS_CXXFLAGS ${WRAPPER_EXTRA_CFLAGS}"
|
||||
WRAPPER_EXTRA_FFLAGS="$OMPI_CXX_EXCEPTIONS_CXXFLAGS ${WRAPPER_EXTRA_FFLAGS}"
|
||||
WRAPPER_EXTRA_FCFLAGS="$OMPI_CXX_EXCEPTIONS_CXXFLAGS ${WRAPPER_EXTRA_FCFLAGS}"
|
||||
WRAPPER_EXTRA_CXXFLAGS="$OMPI_CXX_EXCEPTIONS_CXXFLAGS ${WRAPPER_EXTRA_CXXFLAGS}"
|
||||
fi
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED(OMPI_HAVE_CXX_EXCEPTION_SUPPORT, $HAVE_CXX_EXCEPTIONS,
|
||||
[Whether or not we have compiled with C++ exceptions support])
|
||||
|
||||
# Make sure we can link with the C compiler
|
||||
if[ test "$ompi_cv_cxx_compiler_vendor" != "microsoft" ]; then
|
||||
OMPI_LANG_LINK_WITH_C([C++], [],
|
||||
[cat <<EOF >&2
|
||||
**********************************************************************
|
||||
* It appears that your C++ compiler is unable to link against object
|
||||
* files created by your C compiler. This generally indicates either
|
||||
* a conflict between the options specified in CFLAGS and CXXFLAGS
|
||||
* or a problem with the local compiler installation. More
|
||||
* information (including exactly what command was given to the
|
||||
* compilers and what error resulted when the commands were executed) is
|
||||
* available in the config.log file in this directory.
|
||||
**********************************************************************
|
||||
EOF
|
||||
AC_MSG_ERROR([C and C++ compilers are not link compatible. Can not continue.])])
|
||||
fi
|
||||
|
||||
# Find some more characteristics of the C++ compiler
|
||||
|
||||
# config/cxx_find_template_repository.m4
|
||||
OMPI_CXX_FIND_TEMPLATE_REPOSITORY
|
||||
# config/cxx_find_template_parameters.m4
|
||||
OMPI_CXX_FIND_TEMPLATE_PARAMETERS
|
||||
|
||||
# see if the C++ compiler supports __builtin_expect
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_CACHE_CHECK([if $CXX supports __builtin_expect],
|
||||
[ompi_cv_cxx_supports___builtin_expect],
|
||||
[AC_TRY_LINK([],
|
||||
[void *ptr = (void*) 0;
|
||||
if (__builtin_expect (ptr != (void*) 0, 1)) return 0;],
|
||||
[ompi_cv_cxx_supports___builtin_expect="yes"],
|
||||
[ompi_cv_cxx_supports___builtin_expect="no"])])
|
||||
if test "$ompi_cv_cxx_supports___builtin_expect" = "yes" ; then
|
||||
have_builtin_expect=1
|
||||
else
|
||||
have_builtin_expect=0
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED([OMPI_CXX_HAVE_BUILTIN_EXPECT], [$have_builtin_expect],
|
||||
[Whether C++ compiler supports __builtin_expect])
|
||||
AC_LANG_POP(C++)
|
||||
|
||||
# see if the C compiler supports __builtin_prefetch
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_CACHE_CHECK([if $CXX supports __builtin_prefetch],
|
||||
[ompi_cv_cxx_supports___builtin_prefetch],
|
||||
[AC_TRY_LINK([],
|
||||
[int ptr;
|
||||
__builtin_prefetch(&ptr,0,0);],
|
||||
[ompi_cv_cxx_supports___builtin_prefetch="yes"],
|
||||
[ompi_cv_cxx_supports___builtin_prefetch="no"])])
|
||||
if test "$ompi_cv_cxx_supports___builtin_prefetch" = "yes" ; then
|
||||
have_builtin_prefetch=1
|
||||
else
|
||||
have_builtin_prefetch=0
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED([OMPI_CXX_HAVE_BUILTIN_PREFETCH], [$have_builtin_prefetch],
|
||||
[Whether C++ compiler supports __builtin_prefetch])
|
||||
AC_LANG_POP(C++)
|
||||
|
||||
# If we are on HP-UX, ensure that we're using aCC
|
||||
case "$host" in
|
||||
*hpux*)
|
||||
if test "$BASECXX" = "CC"; then
|
||||
AC_MSG_WARN([*** You will probably have problems compiling the MPI 2])
|
||||
AC_MSG_WARN([*** C++ bindings with the HP-UX CC compiler. You should])
|
||||
AC_MSG_WARN([*** probably be using the aCC compiler. Re-run configure])
|
||||
AC_MSG_WARN([*** with the environment variable "CXX=aCC".])
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# see if the compiler supports const_cast of 2-dimensional arrays
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_CACHE_CHECK([if $CXX supports const_cast<> properly],
|
||||
[ompi_cv_cxx_supports_2d_const_cast],
|
||||
[AC_TRY_COMPILE([int non_const_func(int ranges[][3]);
|
||||
int cast_test(const int ranges[][3]) {
|
||||
return non_const_func(const_cast<int(*)[3]>(ranges));
|
||||
}],
|
||||
[],
|
||||
[ompi_cv_cxx_supports_2d_const_cast="yes"],
|
||||
[ompi_cv_cxx_supports_2d_const_cast="no"])])
|
||||
if test "$ompi_cv_cxx_supports_2d_const_cast" = "yes" ; then
|
||||
use_2d_const_cast=1
|
||||
else
|
||||
use_2d_const_cast=0
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED([OMPI_CXX_SUPPORTS_2D_CONST_CAST],
|
||||
[$use_2d_const_cast],
|
||||
[Whether a const_cast on a 2-d array will work with the C++ compiler])
|
||||
unset use_2d_const_cast
|
||||
AC_LANG_POP(C++)
|
||||
|
||||
# Note: gcc-imperonating compilers accept -O3
|
||||
if test "$WANT_DEBUG" = "1"; then
|
||||
OPTFLAGS=
|
||||
else
|
||||
if test "$GXX" = yes; then
|
||||
OPTFLAGS="-O3"
|
||||
else
|
||||
OPTFLAGS="-O"
|
||||
fi
|
||||
fi
|
||||
|
||||
# config/ompi_check_optflags.m4
|
||||
OMPI_CHECK_OPTFLAGS(["$CXXFLAGS"])
|
||||
AC_MSG_CHECKING([for C++ optimization flags])
|
||||
AC_MSG_RESULT([$co_result])
|
||||
CXXFLAGS="$co_result"
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([_OMPI_START_SETUP_CXX],[
|
||||
ompi_show_subtitle "C++ compiler and preprocessor"
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([_OMPI_PROG_CXX],[
|
||||
ompi_cxxflags_save="$CXXFLAGS"
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CXXCPP
|
||||
BASECXX="`basename $CXX`"
|
||||
CXXFLAGS="$ompi_cxxflags_save"
|
||||
AC_DEFINE_UNQUOTED(OMPI_CXX, "$CXX", [OMPI underlying C++ compiler])
|
||||
set dummy $CXX
|
||||
ompi_cxx_argv0=[$]2
|
||||
OMPI_WHICH([$ompi_cxx_argv0], [OMPI_CXX_ABSOLUTE])
|
||||
AC_SUBST(OMPI_CXX_ABSOLUTE)
|
||||
|
||||
OMPI_CXX_COMPILER_VENDOR([ompi_cxx_vendor])
|
||||
|
||||
# Make sure that the C++ compiler both works and is actually a C++
|
||||
# compiler (if not cross-compiling). Don't just use the AC macro
|
||||
# so that we can have a pretty message. Do something here that
|
||||
# should force the linking of C++-specific things (e.g., STL
|
||||
# strings) so that we can force a hard check of compiling,
|
||||
# linking, and running a C++ application Note that some C
|
||||
# compilers, such as at least some versions of the GNU and Intel
|
||||
# compilers, will detect that the file extension is ".cc" and
|
||||
# therefore switch into a pseudo-C++ personality which works for
|
||||
# *compiling*, but does not work for *linking*. So in this test,
|
||||
# we want to cover the entire spectrum (compiling, linking,
|
||||
# running).
|
||||
|
||||
if[ test "$ompi_cv_cxx_compiler_vendor" != "microsoft" ]; then
|
||||
OMPI_CHECK_COMPILER_WORKS([C++], [#include <string>],
|
||||
[std::string foo = "Hello, world"], [],
|
||||
[AC_MSG_ERROR([Could not run a simple C++ program. Aborting.])])
|
||||
fi
|
||||
])
|
137
config/ompi_setup_f77.m4
Обычный файл
137
config/ompi_setup_f77.m4
Обычный файл
@ -0,0 +1,137 @@
|
||||
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) 2006 Los Alamos National Security, LLC. All rights
|
||||
dnl reserved.
|
||||
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
dnl $COPYRIGHT$
|
||||
dnl
|
||||
dnl Additional copyrights may follow
|
||||
dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
dnl sets:
|
||||
dnl F77 : full pathname to compiler
|
||||
dnl BASEF77 : compiler name (no path)
|
||||
dnl OMPI_WANT_F77_BINDINGS : (actually set by ompi_configure_options, may be
|
||||
dnl redefined here)
|
||||
dnl FC : Same as F77. Side effect of AC_PROG_FC. Should
|
||||
dnl not be used
|
||||
dnl defines:
|
||||
dnl OMPI_F77 : same as F77
|
||||
dnl OMPI_WANT_F77_BINDINGS :
|
||||
dnl am_conditional:
|
||||
dnl OMPI_WANT_F77_BINDINGS :
|
||||
|
||||
AC_DEFUN([OMPI_SETUP_F77],[
|
||||
|
||||
# Modularize this setup so that sub-configure.in scripts can use this
|
||||
# same setup code.
|
||||
|
||||
ompi_show_subtitle "Fortran 77 compiler"
|
||||
|
||||
#
|
||||
# Check for the compiler
|
||||
#
|
||||
# Note that we don't actually *use* the fortran compiler to build
|
||||
# anything in OMPI; it's only used here in configure to find out
|
||||
# symbol conventions, type sizes, etc. We also pass it down to
|
||||
# the wrapper compiler mpif77.
|
||||
#
|
||||
# Always run this test, even if fortran isn't wanted so that F77 has
|
||||
# value for the Fint tests
|
||||
#
|
||||
ompi_fflags_save="$FFLAGS"
|
||||
AC_PROG_F77([gfortran g77 f77 xlf frt ifort pgf77 fort77 fl32 af77])
|
||||
FFLAGS="$ompi_fflags_save"
|
||||
if test -z "$F77"; then
|
||||
AC_MSG_WARN([*** Fortran 77 bindings disabled (could not find compiler)])
|
||||
OMPI_WANT_F77_BINDINGS=0
|
||||
OMPI_F77="none"
|
||||
BASEF77="none"
|
||||
OMPI_F77_ABSOLUTE="none"
|
||||
else
|
||||
OMPI_F77="$F77"
|
||||
set dummy $OMPI_F77
|
||||
OMPI_F77_ARGV0=[$]2
|
||||
BASEF77="`basename $OMPI_F77_ARGV0`"
|
||||
OMPI_WHICH([$OMPI_F77_ARGV0], [OMPI_F77_ABSOLUTE])
|
||||
|
||||
if test "$OMPI_WANT_F77_BINDINGS" = "0" ; then
|
||||
AC_MSG_WARN([*** Fortran 77 bindings disabled by user])
|
||||
OMPI_WANT_F77_BINDINGS=0
|
||||
else
|
||||
OMPI_WANT_F77_BINDINGS=1
|
||||
fi
|
||||
fi
|
||||
|
||||
# make sure the compiler actually works, if not cross-compiling
|
||||
# Don't just use the AC macro so that we can have a pretty
|
||||
# message.
|
||||
AS_IF([test $OMPI_WANT_F77_BINDINGS -eq 1],
|
||||
[OMPI_CHECK_COMPILER_WORKS([Fortran 77], [], [], [],
|
||||
[AC_MSG_ERROR([Could not run a simple Fortran 77 program. Aborting.])])])
|
||||
|
||||
# now make sure we know our linking convention...
|
||||
OMPI_F77_FIND_EXT_SYMBOL_CONVENTION
|
||||
|
||||
# Make sure we can link with C code...
|
||||
AS_IF([test $OMPI_WANT_F77_BINDINGS -eq 1],
|
||||
[OMPI_LANG_LINK_WITH_C([Fortran 77], [],
|
||||
[cat <<EOF
|
||||
**********************************************************************
|
||||
It appears that your Fortran 77 compiler is unable to link against
|
||||
object files created by your C compiler. This typically indicates
|
||||
one of a few possibilities:
|
||||
|
||||
- A conflict between CFLAGS and FFLAGS
|
||||
- A problem with your compiler installation(s)
|
||||
- Different default build options between compilers (e.g., C
|
||||
building for 32 bit and Fortran building for 64 bit)
|
||||
- Incompatible compilers
|
||||
|
||||
Such problems can usually be solved by picking compatible compilers
|
||||
and/or CFLAGS and FFLAGS. More information (including exactly what
|
||||
command was given to the compilers and what error resulted when the
|
||||
commands were executed) is available in the config.log file in this
|
||||
directory.
|
||||
**********************************************************************
|
||||
EOF
|
||||
AC_MSG_ERROR([C and Fortran 77 compilers are not link compatible. Can not continue.])])])
|
||||
|
||||
# Test to see if the F77 compilers likes the C++ exceptions flags. If
|
||||
# it doesn't, just abort. We *could* handle this scenario (e.g.,
|
||||
# probe the F77 compiler for what flags would be necessary), but we're
|
||||
# kinda assuming that no one will care. If they do, they'll e-mail us.
|
||||
AC_MSG_CHECKING([to see if F77 compiler likes the C++ exception flags])
|
||||
if test $OMPI_WANT_F77_BINDINGS -eq 0; then
|
||||
AC_MSG_RESULT([skipped (no F77 bindings)])
|
||||
elif test "$OMPI_CXX_EXCEPTIONS_CXXFLAGS" = ""; then
|
||||
AC_MSG_RESULT([skipped (no C++ exceptions flags)])
|
||||
else
|
||||
FFLAGS="$FFLAGS $OMPI_CXX_EXCEPTIONS_CXXFLAGS"
|
||||
AC_LANG_PUSH(Fortran 77)
|
||||
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([], [[ INTEGER I
|
||||
I = 3]]),
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([no])
|
||||
AC_MSG_WARN([C++ exception flags are different between the C and C++ compilers; this configure script cannot currently handle this scenario. Either disable C++ exception support or send mail to the Open MPI users list.])
|
||||
AC_MSG_ERROR([*** Cannot continue])])
|
||||
AC_LANG_POP
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(OMPI_WANT_F77_BINDINGS, $OMPI_WANT_F77_BINDINGS,
|
||||
[Whether we want the MPI f77 bindings or not])
|
||||
AC_DEFINE_UNQUOTED(OMPI_F77, "$OMPI_F77", [OMPI underlying F77 compiler])
|
||||
AM_CONDITIONAL(OMPI_WANT_F77_BINDINGS, test "$OMPI_WANT_F77_BINDINGS" = "1")
|
||||
AC_SUBST(OMPI_F77_ABSOLUTE)
|
||||
])
|
247
config/ompi_setup_f90.m4
Обычный файл
247
config/ompi_setup_f90.m4
Обычный файл
@ -0,0 +1,247 @@
|
||||
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) 2007 Los Alamos National Security, LLC. All rights
|
||||
dnl reserved.
|
||||
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
dnl $COPYRIGHT$
|
||||
dnl
|
||||
dnl Additional copyrights may follow
|
||||
dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
dnl OMPI_SETUP_F90
|
||||
dnl
|
||||
dnl sets:
|
||||
dnl F90 : full pathname to compiler
|
||||
dnl BASEF90 : compiler name (no path)
|
||||
dnl OMPI_WANT_F90_BINDINGS : (actually set by ompi_configure_options, may be
|
||||
dnl redefined here)
|
||||
dnl FC : Same as F90. Side effect of AC_PROG_FC. Should
|
||||
dnl not be used
|
||||
dnl defines:
|
||||
dnl OMPI_F90 : same as F90
|
||||
dnl OMPI_WANT_F90_BINDINGS :
|
||||
dnl am_conditional:
|
||||
dnl OMPI_WANT_F90_BINDINGS :
|
||||
|
||||
AC_DEFUN([OMPI_SETUP_F90],[
|
||||
AC_REQUIRE([AC_PROG_GREP])
|
||||
|
||||
# Modularize this setup so that sub-configure.in scripts can use this
|
||||
# same setup code.
|
||||
|
||||
ompi_show_subtitle "Fortran 90/95 compiler"
|
||||
|
||||
if test "$OMPI_WANT_F77_BINDINGS" = "0" ; then
|
||||
AC_MSG_WARN([*** Fortran 90/95 bindings implicitly disabled (because])
|
||||
AC_MSG_WARN([*** Fortran 77 bindings were disabled)])
|
||||
|
||||
OMPI_WANT_F90_BINDINGS=0
|
||||
OMPI_F90="none"
|
||||
BASEF90="none"
|
||||
OMPI_F90_ABSOLUTE="none"
|
||||
if test "$enable_f90" = "yes"; then
|
||||
AC_MSG_WARN([*** but --enable-f90 was explicitly specified])
|
||||
AC_MSG_ERROR([Cannot continue])
|
||||
fi
|
||||
elif test "$OMPI_WANT_F90_BINDINGS" = "0" ; then
|
||||
AC_MSG_WARN([*** Fortran 90/95 bindings disabled by user])
|
||||
OMPI_WANT_F90_BINDINGS=0
|
||||
OMPI_F90="none"
|
||||
BASEF90="none"
|
||||
OMPI_F90_ABSOLUTE="none"
|
||||
else
|
||||
|
||||
#
|
||||
# Check for the compiler
|
||||
#
|
||||
# Note that we don't actually *use* the fortran compiler to build
|
||||
# anything in OMPI; it's only used here in configure to find out
|
||||
# symbol conventions, type sizes, etc. We also pass it down to
|
||||
# the wrapper compiler mpif90.
|
||||
#
|
||||
# Note that AC_PROG_FC will look for *any* fortran compiler, and
|
||||
# we don't want it to find an F77 compiler. The AC docs don't
|
||||
# recommend using the "dialect" feature of AC_PROG_FC (and you can
|
||||
# only look for one of Fortran 90 or 95 -- not both), so instead
|
||||
# use the optional first parameter and steal the list of Fortran
|
||||
# compilers (excluding the f77 compiler names) from AC's default
|
||||
# list of 95 and 90 compilers and use it here.
|
||||
#
|
||||
|
||||
ompi_fcflags_save="$FCFLAGS"
|
||||
AC_PROG_FC([gfortran f95 fort xlf95 ifort ifc efc pgf95 lf95 f90 xlf90 pgf90 epcf90])
|
||||
FCFLAGS="$ompi_fcflags_save"
|
||||
if test -z "$FC"; then
|
||||
AC_MSG_WARN([*** Fortran 90/95 bindings disabled (could not find compiler)])
|
||||
OMPI_WANT_F90_BINDINGS=0
|
||||
OMPI_F90="none"
|
||||
BASEF90="none"
|
||||
OMPI_F90_ABSOLUTE="none"
|
||||
else
|
||||
OMPI_WANT_F90_BINDINGS=1
|
||||
OMPI_F90="$FC"
|
||||
set dummy $OMPI_F90
|
||||
OMPI_F90_ARGV0=[$]2
|
||||
BASEF90="`basename $OMPI_F90_ARGV0`"
|
||||
OMPI_WHICH([$OMPI_F90_ARGV0], [OMPI_F90_ABSOLUTE])
|
||||
fi
|
||||
fi
|
||||
# make sure the compiler actually works, if not cross-compiling
|
||||
# Don't just use the AC macro so that we can have a pretty
|
||||
# message.
|
||||
AS_IF([test $OMPI_WANT_F90_BINDINGS -eq 1],
|
||||
[OMPI_CHECK_COMPILER_WORKS([Fortran], [], [], [],
|
||||
[AC_MSG_ERROR([Could not run a simple Fortran program. Aborting.])])])
|
||||
|
||||
# check to see if the F77 and F90 compilers are compatible
|
||||
AS_IF([test $OMPI_WANT_F90_BINDINGS -eq 1],
|
||||
[AC_MSG_CHECKING([whether $OMPI_F77 and $OMPI_F90 compilers are compatible])
|
||||
OMPI_INTL_F90_F77_INTERACTION([fortran_goodness=1], [fortran_goodness=0])
|
||||
if test "$fortran_goodness" = "0" ; then
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_WARN([*** Fortran 77 and Fortran 90 compilers are not link compatible])
|
||||
AC_MSG_WARN([*** Disabling MPI Fortran 90/95 bindings])
|
||||
OMPI_WANT_F90_BINDINGS=0
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
])
|
||||
|
||||
# BWB - FIX ME - remove once everyone updates to LT 2.0.
|
||||
#
|
||||
AS_IF([test $OMPI_WANT_F90_BINDINGS -eq 1],
|
||||
[if test $BASEF77 != $BASEF90; then
|
||||
lt_ver=`$GREP '^VERSION' $srcdir/config/ltmain.sh | cut -f2 -d= | cut -f1 -d'.'`
|
||||
if test $lt_ver -lt 2 ; then
|
||||
AC_MSG_ERROR([You appear to be trying to build the Fortran 90
|
||||
layer with Libtool 1.5.x or earlier and a Fortran 77 / Fortran 90 compiler
|
||||
combination that will not work with this configuration. You must either
|
||||
use a different Fortran 77 / Fortran 90 compiler (one where it is the same
|
||||
compiler for both languages), upgrade to Libtool 2.x, or disable the
|
||||
Fortran 90 bindings.])
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
# OS X before 10.3 (deployment target) does not allow undefined common
|
||||
# symbols in shared libraries. Because we can't figure out how to
|
||||
# implement MPI_STATUSES_IGNORE and friends wihtout common symbols, on
|
||||
# OS X we can't build the F90 bindings as a shared library.
|
||||
AC_MSG_CHECKING([for extra arguments to build a shard library])
|
||||
case "$host" in
|
||||
*apple-darwin*)
|
||||
if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
|
||||
AC_MSG_RESULT([impossible -- -static])
|
||||
OMPI_F90_EXTRA_SHARED_LIBRARY_FLAGS="-static"
|
||||
else
|
||||
case ${MACOSX_DEPLOYMENT_TARGET} in
|
||||
10.[012])
|
||||
AC_MSG_RESULT([impossible -- -static])
|
||||
OMPI_F90_EXTRA_SHARED_LIBRARY_FLAGS="-static"
|
||||
;;
|
||||
10.*)
|
||||
AC_MSG_RESULT([-Wl,-single_module])
|
||||
OMPI_F90_EXTRA_SHARED_LIBRARY_FLAGS="-Wl,-single_module"
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([none needed])
|
||||
OMPI_F90_EXTRA_SHARED_LIBRARY_FLAGS=""
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(OMPI_F90_EXTRA_SHARED_LIBRARY_FLAGS)
|
||||
|
||||
# if we're still good, then save the extra file types. Do this last
|
||||
# because it implies tests that should be invoked by the above tests
|
||||
# (e.g., running the fortran compiler).
|
||||
AS_IF([test $OMPI_WANT_F90_BINDINGS -eq 1],
|
||||
[AC_LANG_PUSH(Fortran)
|
||||
AC_FC_SRCEXT(f)
|
||||
AC_FC_SRCEXT(f90)
|
||||
AC_LANG_POP(Fortran)])
|
||||
|
||||
# Test to see if the F90 compilers likes the C++ exceptions flags. If
|
||||
# it doesn't, just abort. We *could* handle this scenario (e.g.,
|
||||
# probe the F90 compiler for what flags would be necessary), but we're
|
||||
# kinda assuming that no one will care. If they do, they'll e-mail us.
|
||||
AC_MSG_CHECKING([to see if F90 compiler likes the C++ exception flags])
|
||||
if test "$OMPI_WANT_F90_BINDINGS" = "0"; then
|
||||
AC_MSG_RESULT([skipped (no F90 bindings)])
|
||||
elif test "$OMPI_CXX_EXCEPTIONS_CXXFLAGS" = ""; then
|
||||
AC_MSG_RESULT([skipped (no C++ exceptions flags)])
|
||||
else
|
||||
FCFLAGS="$FFLAGS $OMPI_CXX_EXCEPTIONS_CXXFLAGS"
|
||||
AC_LANG_PUSH(Fortran)
|
||||
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([], [[ INTEGER I
|
||||
I = 3]]),
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([no])
|
||||
AC_MSG_WARN([C++ exception flags are different between the C and C++ compilers; this configure script cannot currently handle this scenario. Either disable C++ exception support or send mail to the Open MPI users list.])
|
||||
AC_MSG_ERROR([*** Cannot continue])])
|
||||
AC_LANG_POP
|
||||
fi
|
||||
|
||||
# All done -- save values
|
||||
AC_DEFINE_UNQUOTED(OMPI_WANT_F90_BINDINGS, $OMPI_WANT_F90_BINDINGS,
|
||||
[Whether we want the MPI f90 bindings or not])
|
||||
AC_DEFINE_UNQUOTED(OMPI_F90, "$OMPI_F90", [OMPI underlying F90 compiler])
|
||||
AM_CONDITIONAL(OMPI_WANT_F90_BINDINGS, test "$OMPI_WANT_F90_BINDINGS" = "1")
|
||||
AC_SUBST(OMPI_F90_ABSOLUTE)
|
||||
unset fortran_goodness
|
||||
])
|
||||
|
||||
#############################################################################
|
||||
|
||||
AC_DEFUN([OMPI_INTL_F90_F77_INTERACTION], [
|
||||
# make sure that we can combine F90 and F77 code
|
||||
AC_LANG_PUSH(Fortran)
|
||||
# Fortran module
|
||||
cat > conftestf77.f <<EOF
|
||||
subroutine Conf1_test()
|
||||
end
|
||||
EOF
|
||||
cat > conftestf90.f <<EOF
|
||||
program main
|
||||
call Conf1_test()
|
||||
end
|
||||
EOF
|
||||
|
||||
# Try the compile
|
||||
OMPI_LOG_COMMAND(
|
||||
[$OMPI_F90 $FCFLAGS $FCFLAGS_f -c conftestf90.f],
|
||||
OMPI_LOG_COMMAND(
|
||||
[$OMPI_F77 $FFLAGS -c conftestf77.f],
|
||||
OMPI_LOG_COMMAND(
|
||||
[$OMPI_F90 $FCFLAGS -o conftest conftestf90.o conftestf77.o $LDFLAGS $LIBS],
|
||||
[HAPPY=1],
|
||||
[HAPPY=0]),
|
||||
[HAPPY=0]),
|
||||
[HAPPY=0])
|
||||
|
||||
if test "$HAPPY" = "1"; then
|
||||
$1
|
||||
else
|
||||
OMPI_LOG_MSG([here is the F77 program:], 1)
|
||||
OMPI_LOG_FILE([conftestf77.f])
|
||||
OMPI_LOG_MSG([here is the F90 program:], 1)
|
||||
OMPI_LOG_FILE([conftestf90.f])
|
||||
$2
|
||||
fi
|
||||
|
||||
unset HAPPY ompi_conftest_h
|
||||
rm -rf conftest*
|
||||
|
||||
AC_LANG_POP(Fortran)
|
||||
])dnl
|
397
config/ompi_setup_libevent.m4
Обычный файл
397
config/ompi_setup_libevent.m4
Обычный файл
@ -0,0 +1,397 @@
|
||||
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 Sun Microsystems, Inc. All rights reserved.
|
||||
dnl $COPYRIGHT$
|
||||
dnl
|
||||
dnl Additional copyrights may follow
|
||||
dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
AC_DEFUN([OMPI_SETUP_LIBEVENT],[
|
||||
|
||||
dnl OMPI: don't use AC_LIBOBJ
|
||||
sources=
|
||||
|
||||
dnl Check for optional stuff
|
||||
AC_ARG_WITH(event-rtsig,
|
||||
AC_HELP_STRING([--with-event-rtsig],
|
||||
[compile with support for real time signals (experimental)]),
|
||||
[usertsig=yes], [usertsig=no])
|
||||
|
||||
dnl Checks for libraries.
|
||||
dnl AC_CHECK_LIB(socket, socket)
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(fcntl.h stdarg.h inttypes.h stdint.h poll.h signal.h unistd.h sys/epoll.h sys/time.h sys/queue.h sys/event.h sys/ioctl.h sys/devpoll.h)
|
||||
if test "x$ac_cv_header_sys_queue_h" = "xyes"; then
|
||||
AC_MSG_CHECKING(for TAILQ_FOREACH in sys/queue.h)
|
||||
AC_EGREP_CPP(yes,
|
||||
[
|
||||
#include <sys/queue.h>
|
||||
#ifdef TAILQ_FOREACH
|
||||
yes
|
||||
#endif
|
||||
], [AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_TAILQFOREACH, 1,
|
||||
[Define if TAILQ_FOREACH is defined in <sys/queue.h>])],
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
fi
|
||||
|
||||
if test "x$ac_cv_header_sys_time_h" = "xyes"; then
|
||||
AC_MSG_CHECKING(for timeradd in sys/time.h)
|
||||
AC_EGREP_CPP(yes,
|
||||
[
|
||||
#include <sys/time.h>
|
||||
#ifdef timeradd
|
||||
yes
|
||||
#endif
|
||||
], [ AC_DEFINE(HAVE_TIMERADD, 1,
|
||||
[Define if timeradd is defined in <sys/time.h>])
|
||||
AC_MSG_RESULT(yes)] ,AC_MSG_RESULT(no)
|
||||
)
|
||||
fi
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_HEADER_TIME
|
||||
|
||||
dnl Checks for library functions.
|
||||
AC_CHECK_FUNCS(gettimeofday vasprintf fcntl)
|
||||
|
||||
AC_MSG_CHECKING(for F_SETFD in fcntl.h)
|
||||
AC_EGREP_CPP(yes,
|
||||
[
|
||||
#define _GNU_SOURCE
|
||||
#include <fcntl.h>
|
||||
#ifdef F_SETFD
|
||||
yes
|
||||
#endif
|
||||
], [ AC_DEFINE(HAVE_SETFD, 1,
|
||||
[Define if F_SETFD is defined in <fcntl.h>])
|
||||
AC_MSG_RESULT(yes) ], AC_MSG_RESULT(no))
|
||||
|
||||
needsignal=no
|
||||
haveselect=no
|
||||
AC_CHECK_FUNCS(select, [haveselect=yes], )
|
||||
if test "x$haveselect" = "xyes" ; then
|
||||
# OMPI: Don't use AC_LIBOBJ
|
||||
sources="select.c $sources"
|
||||
needsignal=yes
|
||||
fi
|
||||
|
||||
havepoll=no
|
||||
havertsig=no
|
||||
AC_CHECK_FUNCS(poll, [havepoll=yes], )
|
||||
case "$host" in
|
||||
*apple-darwin*)
|
||||
haveworkingpoll=0
|
||||
;;
|
||||
*)
|
||||
if test "$havepoll" = "yes" ; then
|
||||
haveworkingpoll=1
|
||||
else
|
||||
haveworkingpoll=0
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
AC_DEFINE_UNQUOTED([HAVE_WORKING_POLL], [$haveworkingpoll],
|
||||
[Whether poll works for file descriptors and devices])
|
||||
if test "x$havepoll" = "xyes" -a "$haveworkingpoll" = "1" ; then
|
||||
# OMPI: Don't use AC_LIBOBJ
|
||||
sources="poll.c $sources"
|
||||
needsignal=yes
|
||||
|
||||
if test "x$usertsig" = "xyes" ; then
|
||||
AC_CHECK_FUNCS(sigtimedwait, [havertsig=yes], )
|
||||
fi
|
||||
fi
|
||||
if test "x$havertsig" = "xyes" ; then
|
||||
AC_MSG_CHECKING(for F_SETSIG in fcntl.h)
|
||||
AC_EGREP_CPP(yes,
|
||||
[
|
||||
#define _GNU_SOURCE
|
||||
#include <fcntl.h>
|
||||
#ifdef F_SETSIG
|
||||
yes
|
||||
#endif
|
||||
], [ AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no); havertsig=no])
|
||||
fi
|
||||
if test "x$havertsig" = "xyes" ; then
|
||||
AC_DEFINE(HAVE_RTSIG, 1, [Define if your system supports POSIX realtime signals])
|
||||
# OMPI: Don't use AC_LIBOBJ
|
||||
sources="rtsig.c $sources"
|
||||
AC_MSG_CHECKING(for working rtsig on pipes)
|
||||
AC_TRY_RUN(
|
||||
[
|
||||
#define _GNU_SOURCE
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int sigio()
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
int fd[2];
|
||||
|
||||
pipe(fd);
|
||||
signal(SIGIO, sigio);
|
||||
fcntl(fd[0], F_SETOWN, getpid());
|
||||
fcntl(fd[0], F_SETSIG, SIGIO);
|
||||
fcntl(fd[0], F_SETFL, fcntl(fd[0], F_GETFL) | O_ASYNC);
|
||||
write(fd[1], "", 1);
|
||||
return 1;
|
||||
}
|
||||
], [ AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_WORKING_RTSIG, 1, [Define if realtime signals work on pipes])],
|
||||
AC_MSG_RESULT(no))
|
||||
fi
|
||||
|
||||
haveepoll=no
|
||||
AC_CHECK_FUNCS(epoll_ctl, [haveepoll=yes], )
|
||||
if test "x$haveepoll" = "xyes" -a "$cross_compiling" != "yes" ; then
|
||||
|
||||
# OMPI: Unfortunately, this test is not sufficient on some
|
||||
# Linux distros (e.g., RH 9), where the function is defined
|
||||
# and you can link against it, but it's hardwired to return
|
||||
# ENOSYS -- and /usr/include/gnu/stubs.h fails to define
|
||||
# __stub_epoll_ctl (the usual mechanism in glibc to indicate
|
||||
# that a function is a stub and isn't really implemented).
|
||||
# Hence, the test succeeds because it thinks it can use
|
||||
# epoll_ctl (and friends). So we have to do a better test
|
||||
# after we determine that epoll_ctl is linkable. Grumble.
|
||||
# If we are cross compiling, just trust AC_CHECK_FUNCS
|
||||
|
||||
# OMPI: Unfortunately, this test is not sufficient for another
|
||||
# reason. The event_poll struct is defined in the sys/epoll.h
|
||||
# file. The structure is the interface between the application
|
||||
# and the kernel and is therefore compiled into both. The
|
||||
# event_poll struct is defined with a compiler directive
|
||||
# __attribute__ ((__packed__). It turns out that there is
|
||||
# at least one compiler (Sun Studio) that does not currently
|
||||
# recognize this directive. This means that the event_poll
|
||||
# struct may be packed in the kernel, but not in the OMPI
|
||||
# library. Badness ensues. Therefore, check to see that
|
||||
# this struct gets correctly passed between OMPI and the
|
||||
# kernel.
|
||||
|
||||
haveepoll=no
|
||||
AC_MSG_CHECKING([for working epoll library interface])
|
||||
AC_RUN_IFELSE(AC_LANG_PROGRAM([[
|
||||
AC_INCLUDES_DEFAULT
|
||||
#include <sys/epoll.h>]],
|
||||
[[
|
||||
struct epoll_event epevin;
|
||||
struct epoll_event epevout;
|
||||
int res;
|
||||
int epfd;
|
||||
int fildes[[2]];
|
||||
|
||||
if ((epfd = epoll_create(1)) == -1)
|
||||
exit(1);
|
||||
if (pipe(&fildes[[0]]) < 0)
|
||||
exit(1);
|
||||
memset(&epevin, 0, sizeof(epevin));
|
||||
memset(&epevout, 0, sizeof(epevout));
|
||||
memset(&epevin.data.ptr, 5, sizeof(epevin.data.ptr));
|
||||
epevin.events = EPOLLIN | EPOLLOUT;
|
||||
|
||||
if (epoll_ctl(epfd, EPOLL_CTL_ADD, fildes[[0]], &epevin) == -1)
|
||||
exit(1);
|
||||
|
||||
res = epoll_wait(epfd, &epevout, 1, 0);
|
||||
if (res != 1) {
|
||||
exit(1);
|
||||
} else {
|
||||
if (epevout.data.ptr != epevin.data.ptr) {
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
/* SUCCESS */
|
||||
]]),
|
||||
[haveepoll=yes
|
||||
AC_DEFINE(HAVE_EPOLL, 1,
|
||||
[Define if your system supports the epoll interface])
|
||||
# OMPI: Don't use AC_LIBOBJ
|
||||
sources="epoll.c $sources"
|
||||
needsignal=yes])
|
||||
AC_MSG_RESULT([$haveepoll])
|
||||
fi
|
||||
|
||||
haveepollsyscall=no
|
||||
if test "x$ac_cv_header_sys_epoll_h" = "xyes" -a "x$haveepoll" = "xno" -a "$cross_compiling" != "yes"; then
|
||||
# OMPI: See comment above. This test uses the epoll system call
|
||||
# interface instead of the library interface.
|
||||
AC_MSG_CHECKING(for working epoll system call)
|
||||
AC_RUN_IFELSE(AC_LANG_PROGRAM([[
|
||||
AC_INCLUDES_DEFAULT
|
||||
#include <sys/syscall.h>
|
||||
#include <sys/epoll.h>]],
|
||||
[[
|
||||
struct epoll_event epevin;
|
||||
struct epoll_event epevout;
|
||||
int res;
|
||||
int epfd;
|
||||
int fildes[[2]];
|
||||
|
||||
if ((epfd = syscall(__NR_epoll_create, 1)) == -1)
|
||||
exit(1);
|
||||
if (pipe(&fildes[[0]]) < 0)
|
||||
exit(1);
|
||||
memset(&epevin, 0, sizeof(epevin));
|
||||
memset(&epevout, 0, sizeof(epevout));
|
||||
memset(&epevin.data.ptr, 5, sizeof(epevin.data.ptr));
|
||||
epevin.events = EPOLLIN | EPOLLOUT;
|
||||
|
||||
if (syscall(__NR_epoll_ctl, epfd,
|
||||
EPOLL_CTL_ADD, fildes[[0]], &epevin) == -1)
|
||||
exit(1);
|
||||
|
||||
res = syscall(__NR_epoll_wait, epfd, &epevout, 1, 0);
|
||||
if (res != 1) {
|
||||
exit(1);
|
||||
} else {
|
||||
if (epevout.data.ptr != epevin.data.ptr) {
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
/* SUCCESS */
|
||||
]]),
|
||||
[haveepollsyscall=yes
|
||||
AC_DEFINE(HAVE_EPOLL, 1,
|
||||
[Define if your system supports the epoll interface])
|
||||
# OMPI: don't use AC_LIBOBJ
|
||||
sources="epoll_sub.c epoll.c $sources"
|
||||
needsignal=yes])
|
||||
AC_MSG_RESULT([$haveepollsyscall])
|
||||
fi
|
||||
|
||||
havedevpoll=no
|
||||
if test "x$ac_cv_header_sys_devpoll_h" = "xyes"; then
|
||||
AC_DEFINE(HAVE_DEVPOLL, 1,
|
||||
[Define if /dev/poll is available])
|
||||
# OMPI: Don't use AC_LIBOBJ(devpoll)
|
||||
sources="devpoll.c $sources"
|
||||
needsignal=yes
|
||||
fi
|
||||
|
||||
havekqueue=no
|
||||
if test "x$ac_cv_header_sys_event_h" = "xyes"; then
|
||||
# All versions of MAC OS X before at least 10.5.2 are
|
||||
# completely broken when kqueue is used with pty. So, until
|
||||
# they get fixed, completely disable kqueue on MAC OS X.
|
||||
case "$host" in
|
||||
*apple-darwin*)
|
||||
AC_MSG_CHECKING(for working kqueue)
|
||||
havekqueue="no"
|
||||
AC_MSG_RESULT([no (MAC OS X)])
|
||||
;;
|
||||
*)
|
||||
AC_CHECK_FUNCS(kqueue, [havekqueue=yes], )
|
||||
;;
|
||||
esac
|
||||
if test "x$havekqueue" = "xyes" ; then
|
||||
AC_MSG_CHECKING(for working kqueue)
|
||||
AC_TRY_RUN(
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/event.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
int kq;
|
||||
int n;
|
||||
int fd[[2]];
|
||||
struct kevent ev;
|
||||
struct timespec ts;
|
||||
char buf[[8000]];
|
||||
|
||||
if (pipe(fd) == -1)
|
||||
exit(1);
|
||||
if (fcntl(fd[[1]], F_SETFL, O_NONBLOCK) == -1)
|
||||
exit(1);
|
||||
|
||||
while ((n = write(fd[[1]], buf, sizeof(buf))) == sizeof(buf))
|
||||
;
|
||||
|
||||
if ((kq = kqueue()) == -1)
|
||||
exit(1);
|
||||
|
||||
ev.ident = fd[[1]];
|
||||
ev.filter = EVFILT_WRITE;
|
||||
ev.flags = EV_ADD | EV_ENABLE;
|
||||
n = kevent(kq, &ev, 1, NULL, 0, NULL);
|
||||
if (n == -1)
|
||||
exit(1);
|
||||
|
||||
read(fd[[0]], buf, sizeof(buf));
|
||||
|
||||
ts.tv_sec = 0;
|
||||
ts.tv_nsec = 0;
|
||||
n = kevent(kq, NULL, 0, &ev, 1, &ts);
|
||||
if (n == -1 || n == 0)
|
||||
exit(1);
|
||||
|
||||
exit(0);
|
||||
}, [AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_WORKING_KQUEUE, 1,
|
||||
[Define if kqueue works correctly with pipes])
|
||||
sources="kqueue.c $sources"], AC_MSG_RESULT(no), AC_MSG_RESULT(no))
|
||||
# OMPI: don't use AC_LIBOBJ
|
||||
fi
|
||||
fi
|
||||
|
||||
haveeventports=no
|
||||
AC_CHECK_FUNCS(port_create, [haveeventports=yes], )
|
||||
# JMS Per #1273, Solaris event ports are temporarily disabled.
|
||||
haveeventports=no
|
||||
if test "x$haveeventports" = "xyes" ; then
|
||||
AC_DEFINE(HAVE_EVENT_PORTS, 1,
|
||||
[Define if your system supports event ports])
|
||||
sources="evport.c $sources"
|
||||
needsignal=yes
|
||||
fi
|
||||
|
||||
if test "x$needsignal" = "xyes" ; then
|
||||
# OMPI: don't use AC_LIBOBJ
|
||||
sources="signal.c $sources"
|
||||
fi
|
||||
|
||||
# OMPI: AC_REPLACE_FUNCS doesn't have much meaning here because it
|
||||
# uses AC_LIBOBJ; use our own test
|
||||
#AC_REPLACE_FUNCS(err)
|
||||
|
||||
AC_TYPE_PID_T
|
||||
AC_TYPE_SIZE_T
|
||||
AC_CHECK_TYPE(u_int64_t, unsigned long long)
|
||||
AC_CHECK_TYPE(u_int32_t, unsigned int)
|
||||
AC_CHECK_TYPE(u_int16_t, unsigned short)
|
||||
AC_CHECK_TYPE(u_int8_t, unsigned char)
|
||||
|
||||
|
||||
# OMPI: Save the libobj sources
|
||||
OMPI_LIBEVENT_SOURCES="$sources"
|
||||
AC_SUBST(OMPI_LIBEVENT_SOURCES)
|
||||
|
||||
# OMPI: All done
|
||||
unset sources])dnl
|
296
config/ompi_setup_wrappers.m4
Обычный файл
296
config/ompi_setup_wrappers.m4
Обычный файл
@ -0,0 +1,296 @@
|
||||
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) 2006 Sun Microsystems, Inc. All rights reserved.
|
||||
dnl Use is subject to license terms.
|
||||
dnl $COPYRIGHT$
|
||||
dnl
|
||||
dnl Additional copyrights may follow
|
||||
dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
|
||||
# OMPI_SETUP_WRAPPER_INIT()
|
||||
# -------------------------
|
||||
# Setup wrapper compiler configuration information - should be called
|
||||
# before the bulk of the tests that can affect the wrapper compilers
|
||||
#
|
||||
# Note that we keep the user-specified flags seperately because we
|
||||
# don't want them to go through OMPI_UNIQ because that has resulted in
|
||||
# unexpected behavior for the user in the past.
|
||||
AC_DEFUN([OMPI_SETUP_WRAPPER_INIT],[
|
||||
WRAPPER_EXTRA_CPPFLAGS=
|
||||
WRAPPER_EXTRA_CFLAGS=
|
||||
WRAPPER_EXTRA_CXXFLAGS=
|
||||
WRAPPER_EXTRA_FFLAGS=
|
||||
WRAPPER_EXTRA_FCFLAGS=
|
||||
WRAPPER_EXTRA_LDFLAGS=
|
||||
WRAPPER_EXTRA_LIBS=
|
||||
|
||||
USER_WRAPPER_EXTRA_CFLAGS=
|
||||
USER_WRAPPER_EXTRA_CXXFLAGS=
|
||||
USER_WRAPPER_EXTRA_FFLAGS=
|
||||
USER_WRAPPER_EXTRA_FCFLAGS=
|
||||
USER_WRAPPER_EXTRA_LDFLAGS=
|
||||
USER_WRAPPER_EXTRA_LIBS=
|
||||
|
||||
AC_ARG_WITH([wrapper-cflags],
|
||||
[AC_HELP_STRING([--with-wrapper-cflags],
|
||||
[Extra flags to add to CFLAGS when using mpicc])])
|
||||
if test "$with_wrapper_cflags" = "yes" -o "$with_wrapper_cflags" = "no"; then
|
||||
AC_MSG_ERROR([--with-wrapper-cflags must have an argument. Aborting])
|
||||
elif test ! -z "$with_wrapper_cflags" ; then
|
||||
USER_WRAPPER_EXTRA_CFLAGS="$with_wrapper_cflags"
|
||||
fi
|
||||
|
||||
AC_ARG_WITH([wrapper-cxxflags],
|
||||
[AC_HELP_STRING([--with-wrapper-cxxflags],
|
||||
[Extra flags to add to CXXFLAGS when using mpiCC/mpic++])])
|
||||
if test "$with_wrapper_cxxflags" = "yes" -o "$with_wrapper_cxxflags" = "no"; then
|
||||
AC_MSG_ERROR([--with-wrapper-cxxflags must have an argument. Aborting])
|
||||
elif test ! -z "$with_wrapper_cxxflags" ; then
|
||||
USER_WRAPPER_EXTRA_CXXFLAGS="$with_wrapper_cxxflags"
|
||||
fi
|
||||
|
||||
AC_ARG_WITH([wrapper-fflags],
|
||||
[AC_HELP_STRING([--with-wrapper-fflags],
|
||||
[Extra flags to add to FFLAGS when using mpif77])])
|
||||
if test "$with_wrapper_fflags" = "yes" -o "$with_wrapper_fflags" = "no"; then
|
||||
AC_MSG_ERROR([--with-wrapper-fflags must have an argument. Aborting])
|
||||
elif test ! -z "$with_wrapper_fflags" ; then
|
||||
USER_WRAPPER_EXTRA_FFLAGS="$with_wrapper_fflags"
|
||||
fi
|
||||
|
||||
AC_ARG_WITH([wrapper-fcflags],
|
||||
[AC_HELP_STRING([--with-wrapper-fcflags],
|
||||
[Extra flags to add to FCFLAGS when using mpif90])])
|
||||
if test "$with_wrapper_fcflags" = "yes" -o "$with_wrapper_fcflags" = "no"; then
|
||||
AC_MSG_ERROR([--with-wrapper-fcflags must have an argument. Aborting])
|
||||
elif test ! -z "$with_wrapper_fcflags" ; then
|
||||
USER_WRAPPER_EXTRA_FCFLAGS="$with_wrapper_fcflags"
|
||||
fi
|
||||
|
||||
AC_ARG_WITH([wrapper-ldflags],
|
||||
[AC_HELP_STRING([--with-wrapper-ldflags],
|
||||
[Extra flags to add to LDFLAGS when using wrapper compilers])])
|
||||
if test "$with_wrapper_ldflags" = "yes" -o "$with_wrapper_ldflags" = "no"; then
|
||||
AC_MSG_ERROR([--with-wrapper-ldflags must have an argument. Aborting])
|
||||
elif test ! -z "$with_wrapper_ldflags" ; then
|
||||
USER_WRAPPER_EXTRA_LDFLAGS="$with_wrapper_ldflags"
|
||||
fi
|
||||
|
||||
AC_ARG_WITH([wrapper-libs],
|
||||
[AC_HELP_STRING([--with-wrapper-libs],
|
||||
[Extra flags to add to LIBS when using wrapper compilers])])
|
||||
if test "$with_wrapper_libs" = "yes" -o "$with_wrapper_libs" = "no"; then
|
||||
AC_MSG_ERROR([--with-wrapper-libs must have an argument. Aborting])
|
||||
elif test ! -z "$with_wrapper_libs" ; then
|
||||
USER_WRAPPER_EXTRA_LIBS="$with_wrapper_libs"
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([OMPI_SETUP_WRAPPER_FINAL],[
|
||||
OMPI_UNIQ([WRAPPER_EXTRA_CPPFLAGS])
|
||||
OMPI_UNIQ([WRAPPER_EXTRA_CFLAGS])
|
||||
OMPI_UNIQ([WRAPPER_EXTRA_CXXFLAGS])
|
||||
OMPI_UNIQ([WRAPPER_EXTRA_FFLAGS])
|
||||
OMPI_UNIQ([WRAPPER_EXTRA_FCFLAGS])
|
||||
OMPI_UNIQ([WRAPPER_EXTRA_LDFLAGS])
|
||||
|
||||
#
|
||||
# OPAL
|
||||
#
|
||||
OMPI_UNIQ([opal_WRAPPER_EXTRA_LDFLAGS])
|
||||
OMPI_UNIQ([opal_WRAPPER_EXTRA_LIBS])
|
||||
|
||||
AC_MSG_CHECKING([for OPAL CPPFLAGS])
|
||||
OPAL_WRAPPER_EXTRA_CPPFLAGS="$WRAPPER_EXTRA_CPPFLAGS $USER_WRAPPER_EXTRA_CPPFLAGS"
|
||||
AC_SUBST([OPAL_WRAPPER_EXTRA_CPPFLAGS])
|
||||
AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_CPPFLAGS])
|
||||
|
||||
AC_MSG_CHECKING([for OPAL CFLAGS])
|
||||
OPAL_WRAPPER_EXTRA_CFLAGS="$WRAPPER_EXTRA_CFLAGS $USER_WRAPPER_EXTRA_CFLAGS"
|
||||
AC_SUBST([OPAL_WRAPPER_EXTRA_CFLAGS])
|
||||
AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_CFLAGS])
|
||||
|
||||
AC_MSG_CHECKING([for OPAL CXXFLAGS])
|
||||
OPAL_WRAPPER_EXTRA_CXXFLAGS="$WRAPPER_EXTRA_CXXFLAGS $USER_WRAPPER_EXTRA_CXXFLAGS"
|
||||
AC_SUBST([OPAL_WRAPPER_EXTRA_CXXFLAGS])
|
||||
AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_CXXFLAGS])
|
||||
|
||||
AC_MSG_CHECKING([for OPAL LDFLAGS])
|
||||
OPAL_WRAPPER_EXTRA_LDFLAGS="$opal_WRAPPER_EXTRA_LDFLAGS $WRAPPER_EXTRA_LDFLAGS $USER_WRAPPER_EXTRA_LDFLAGS"
|
||||
AC_SUBST([OPAL_WRAPPER_EXTRA_LDFLAGS])
|
||||
AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_LDFLAGS])
|
||||
|
||||
AC_MSG_CHECKING([for OPAL LIBS])
|
||||
OPAL_WRAPPER_EXTRA_LIBS="$opal_WRAPPER_EXTRA_LIBS $WRAPPER_EXTRA_LIBS $USER_WRAPPER_EXTRA_LIBS"
|
||||
AC_SUBST([OPAL_WRAPPER_EXTRA_LIBS])
|
||||
AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_LIBS])
|
||||
|
||||
AC_MSG_CHECKING([for OPAL extra include dirs])
|
||||
if test "$WANT_INSTALL_HEADERS" = "1" ; then
|
||||
OPAL_WRAPPER_EXTRA_INCLUDES="openmpi"
|
||||
else
|
||||
OPAL_WRAPPER_EXTRA_INCLUDES=
|
||||
fi
|
||||
AC_SUBST([OPAL_WRAPPER_EXTRA_INCLUDES])
|
||||
AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_INCLUDES])
|
||||
|
||||
#
|
||||
# ORTE
|
||||
#
|
||||
OMPI_UNIQ([orte_WRAPPER_EXTRA_LDFLAGS])
|
||||
OMPI_UNIQ([orte_WRAPPER_EXTRA_LIBS])
|
||||
|
||||
AC_MSG_CHECKING([for ORTE CPPFLAGS])
|
||||
ORTE_WRAPPER_EXTRA_CPPFLAGS="$OPAL_WRAPPER_EXTRA_CPPFLAGS"
|
||||
AC_SUBST([ORTE_WRAPPER_EXTRA_CPPFLAGS])
|
||||
AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_CPPFLAGS])
|
||||
|
||||
AC_MSG_CHECKING([for ORTE CFLAGS])
|
||||
ORTE_WRAPPER_EXTRA_CFLAGS="$OPAL_WRAPPER_EXTRA_CFLAGS"
|
||||
AC_SUBST([ORTE_WRAPPER_EXTRA_CFLAGS])
|
||||
AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_CFLAGS])
|
||||
|
||||
AC_MSG_CHECKING([for ORTE CXXFLAGS])
|
||||
ORTE_WRAPPER_EXTRA_CXXFLAGS="$OPAL_WRAPPER_EXTRA_CXXFLAGS"
|
||||
AC_SUBST([ORTE_WRAPPER_EXTRA_CXXFLAGS])
|
||||
AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_CXXFLAGS])
|
||||
|
||||
AC_MSG_CHECKING([for ORTE LDFLAGS])
|
||||
ORTE_WRAPPER_EXTRA_LDFLAGS="$orte_WRAPPER_EXTRA_LDFLAGS $OPAL_WRAPPER_EXTRA_LDFLAGS"
|
||||
AC_SUBST([ORTE_WRAPPER_EXTRA_LDFLAGS])
|
||||
AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_LDFLAGS])
|
||||
|
||||
AC_MSG_CHECKING([for ORTE LIBS])
|
||||
ORTE_WRAPPER_EXTRA_LIBS="$orte_WRAPPER_EXTRA_LIBS $OPAL_WRAPPER_EXTRA_LIBS"
|
||||
AC_SUBST([ORTE_WRAPPER_EXTRA_LIBS])
|
||||
AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_LIBS])
|
||||
|
||||
AC_MSG_CHECKING([for ORTE extra include dirs])
|
||||
ORTE_WRAPPER_EXTRA_INCLUDES="$OPAL_WRAPPER_EXTRA_INCLUDES"
|
||||
AC_SUBST([ORTE_WRAPPER_EXTRA_INCLUDES])
|
||||
AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_INCLUDES])
|
||||
|
||||
#
|
||||
# OMPI
|
||||
#
|
||||
OMPI_UNIQ([ompi_WRAPPER_EXTRA_LDFLAGS])
|
||||
OMPI_UNIQ([ompi_WRAPPER_EXTRA_LIBS])
|
||||
|
||||
AC_MSG_CHECKING([for OMPI CPPFLAGS])
|
||||
OMPI_WRAPPER_EXTRA_CPPFLAGS="$ORTE_WRAPPER_EXTRA_CPPFLAGS"
|
||||
AC_SUBST([OMPI_WRAPPER_EXTRA_CPPFLAGS])
|
||||
AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_CPPFLAGS])
|
||||
|
||||
AC_MSG_CHECKING([for OMPI CFLAGS])
|
||||
OMPI_WRAPPER_EXTRA_CFLAGS="$ORTE_WRAPPER_EXTRA_CFLAGS"
|
||||
AC_SUBST([OMPI_WRAPPER_EXTRA_CFLAGS])
|
||||
AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_CFLAGS])
|
||||
|
||||
AC_MSG_CHECKING([for OMPI CXXFLAGS])
|
||||
OMPI_WRAPPER_EXTRA_CXXFLAGS="$ORTE_WRAPPER_EXTRA_CXXFLAGS"
|
||||
AC_SUBST([OMPI_WRAPPER_EXTRA_CXXFLAGS])
|
||||
AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_CXXFLAGS])
|
||||
|
||||
AC_MSG_CHECKING([for OMPI FFLAGS])
|
||||
OMPI_WRAPPER_EXTRA_FFLAGS="$WRAPPER_EXTRA_FFLAGS $USER_WRAPPER_EXTRA_FFLAGS"
|
||||
AC_SUBST([OMPI_WRAPPER_EXTRA_FFLAGS])
|
||||
AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_FFLAGS])
|
||||
|
||||
AC_MSG_CHECKING([for OMPI FCFLAGS])
|
||||
OMPI_WRAPPER_EXTRA_FCFLAGS="$WRAPPER_EXTRA_FCFLAGS $USER_WRAPPER_EXTRA_FCFLAGS"
|
||||
AC_SUBST([OMPI_WRAPPER_EXTRA_FCFLAGS])
|
||||
AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_FCFLAGS])
|
||||
|
||||
AC_MSG_CHECKING([for OMPI LDFLAGS])
|
||||
OMPI_WRAPPER_EXTRA_LDFLAGS="$ompi_WRAPPER_EXTRA_LDFLAGS $ORTE_WRAPPER_EXTRA_LDFLAGS"
|
||||
AC_SUBST([OMPI_WRAPPER_EXTRA_LDFLAGS])
|
||||
AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_LDFLAGS])
|
||||
|
||||
AC_MSG_CHECKING([for OMPI LIBS])
|
||||
OMPI_WRAPPER_EXTRA_LIBS="$ompi_WRAPPER_EXTRA_LIBS $ORTE_WRAPPER_EXTRA_LIBS"
|
||||
AC_SUBST([OMPI_WRAPPER_EXTRA_LIBS])
|
||||
AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_LIBS])
|
||||
|
||||
AC_MSG_CHECKING([for OMPI extra include dirs])
|
||||
OMPI_WRAPPER_EXTRA_INCLUDES="$ORTE_WRAPPER_EXTRA_INCLUDES"
|
||||
AC_SUBST([OMPI_WRAPPER_EXTRA_INCLUDES])
|
||||
AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_INCLUDES])
|
||||
|
||||
# language binding support. C++ is a bit different, as the
|
||||
# compiler should work even if there is no language support.
|
||||
if test "$WANT_MPI_CXX_SUPPORT" = "1" ; then
|
||||
OMPI_WRAPPER_CXX_LIB="-lmpi_cxx"
|
||||
OMPI_WRAPPER_CXX_REQUIRED_FILE=""
|
||||
else
|
||||
OMPI_WRAPPER_CXX_LIB=""
|
||||
OMPI_WRAPPER_CXX_REQUIRED_FILE=""
|
||||
fi
|
||||
AC_SUBST([OMPI_WRAPPER_CXX_LIB])
|
||||
AC_SUBST([OMPI_WRAPPER_CXX_REQUIRED_FILE])
|
||||
|
||||
if test "$OMPI_WANT_F77_BINDINGS" = "1" ; then
|
||||
OMPI_WRAPPER_F77_REQUIRED_FILE=""
|
||||
else
|
||||
OMPI_WRAPPER_F77_REQUIRED_FILE="not supported"
|
||||
fi
|
||||
AC_SUBST([OMPI_WRAPPER_F77_REQUIRED_FILE])
|
||||
|
||||
if test "$OMPI_WANT_F90_BINDINGS" = "1" ; then
|
||||
OMPI_WRAPPER_F90_REQUIRED_FILE=""
|
||||
else
|
||||
OMPI_WRAPPER_F90_REQUIRED_FILE="not supported"
|
||||
fi
|
||||
AC_SUBST([OMPI_WRAPPER_F90_REQUIRED_FILE])
|
||||
|
||||
# For script-based wrappers that don't do relocatable binaries.
|
||||
# Don't use if you don't have to.
|
||||
exec_prefix_save="${exec_prefix}"
|
||||
test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
|
||||
eval "OMPI_WRAPPER_INCLUDEDIR=\"${includedir}\""
|
||||
eval "OMPI_WRAPPER_LIBDIR=\"${libdir}\""
|
||||
exec_prefix="${exec_prefix_save}"
|
||||
AC_SUBST(OMPI_WRAPPER_INCLUDEDIR)
|
||||
AC_SUBST(OMPI_WRAPPER_LIBDIR)
|
||||
|
||||
# compatibility defines that will eventually go away
|
||||
WRAPPER_EXTRA_CFLAGS="$OMPI_WRAPPER_EXTRA_CFLAGS"
|
||||
WRAPPER_EXTRA_CXXFLAGS="$OMPI_WRAPPER_EXTRA_CXXFLAGS"
|
||||
WRAPPER_EXTRA_FFLAGS="$OMPI_WRAPPER_EXTRA_FFLAGS"
|
||||
WRAPPER_EXTRA_FCFLAGS="$OMPI_WRAPPER_EXTRA_FCFLAGS"
|
||||
WRAPPER_EXTRA_LDFLAGS="$OMPI_WRAPPER_EXTRA_LDFLAGS"
|
||||
WRAPPER_EXTRA_LIBS="$OMPI_WRAPPER_EXTRA_LIBS"
|
||||
|
||||
AC_SUBST(WRAPPER_EXTRA_CFLAGS)
|
||||
AC_SUBST(WRAPPER_EXTRA_CXXFLAGS)
|
||||
AC_SUBST(WRAPPER_EXTRA_FFLAGS)
|
||||
AC_SUBST(WRAPPER_EXTRA_FCFLAGS)
|
||||
AC_SUBST(WRAPPER_EXTRA_LDFLAGS)
|
||||
AC_SUBST(WRAPPER_EXTRA_LIBS)
|
||||
|
||||
AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_CFLAGS, "$WRAPPER_EXTRA_CFLAGS",
|
||||
[Additional CFLAGS to pass through the wrapper compilers])
|
||||
AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_CXXFLAGS, "$WRAPPER_EXTRA_CXXFLAGS",
|
||||
[Additional CXXFLAGS to pass through the wrapper compilers])
|
||||
AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_FFLAGS, "$WRAPPER_EXTRA_FFLAGS",
|
||||
[Additional FFLAGS to pass through the wrapper compilers])
|
||||
AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_FCFLAGS, "$WRAPPER_EXTRA_FCFLAGS",
|
||||
[Additional FCFLAGS to pass through the wrapper compilers])
|
||||
AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_LDFLAGS, "$WRAPPER_EXTRA_LDFLAGS",
|
||||
[Additional LDFLAGS to pass through the wrapper compilers])
|
||||
AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_LIBS, "$WRAPPER_EXTRA_LIBS",
|
||||
[Additional LIBS to pass through the wrapper compilers])
|
||||
])
|
51
config/ompi_try_assemble.m4
Обычный файл
51
config/ompi_try_assemble.m4
Обычный файл
@ -0,0 +1,51 @@
|
||||
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_TRY_ASSEMBLE(asm-code, [action-if-success], [action-if-fail])
|
||||
dnl
|
||||
dnl Attempt to assemble asm-code. If success, run action-if-success.
|
||||
dnl Otherwise, run action-if-fail. Neither action-if-success nor
|
||||
dnl action-if-fail are required.
|
||||
dnl
|
||||
dnl No preprocessing is guaranteed to be done on asm-code. Some
|
||||
dnl compilers do not run the preprocessor on assembly files.
|
||||
dnl
|
||||
dnl On failure, asm-test.s will be included in config.out
|
||||
AC_DEFUN([OMPI_TRY_ASSEMBLE],
|
||||
[cat >conftest.s <<EOF
|
||||
[$1]
|
||||
EOF
|
||||
if test "$CC" = "$CCAS" ; then
|
||||
ompi_assemble="$CCAS $CCASFLAGS -c conftest.s >conftest.out 2>&1"
|
||||
else
|
||||
ompi_assemble="$CCAS $CCASFLAGS -o conftest.o conftest.s >conftest.out 2>&1"
|
||||
fi
|
||||
if AC_TRY_EVAL(ompi_assemble); then
|
||||
# save the warnings
|
||||
cat conftest.out >&AC_FD_CC
|
||||
ifelse([$2],,:,[$2])
|
||||
else
|
||||
# save compiler output and failed program
|
||||
cat conftest.out >&AC_FD_CC
|
||||
echo "configure: failed program was:" >&AC_FD_CC
|
||||
cat conftest.s >&AC_FD_CC
|
||||
ifelse([$3],,:,[$3])
|
||||
fi
|
||||
rm -rf conftest*
|
||||
unset ompi_assemble
|
||||
])dnl
|
Загрузка…
Ссылка в новой задаче
Block a user