== Highlights ==
1. New mpifort wrapper compiler: you can utilize mpif.h, use mpi, and use mpi_f08 through this one wrapper compiler 1. mpif77 and mpif90 still exist, but are sym links to mpifort and may be removed in a future release 1. The mpi module has been re-implemented and is significantly "mo' bettah" 1. The mpi_f08 module offers many, many improvements over mpif.h and the mpi module This stuff is coming from a VERY long-lived mercurial branch (3 years!); it'll almost certainly take a few SVN commits and a bunch of testing before I get it correctly committed to the SVN trunk. == More details == Craig Rasmussen and I have been working with the MPI-3 Fortran WG and Fortran J3 committees for a long, long time to make a prototype MPI-3 Fortran bindings implementation. We think we're at a stable enough state to bring this stuff back to the trunk, with the goal of including it in OMPI v1.7. Special thanks go out to everyone who has been incredibly patient and helpful to us in this journey: * Rolf Rabenseifner/HLRS (mastermind/genius behind the entire MPI-3 Fortran effort) * The Fortran J3 committee * Tobias Burnus/gfortran * Tony !Goetz/Absoft * Terry !Donte/Oracle * ...and probably others whom I'm forgetting :-( There's still opportunities for optimization in the mpi_f08 implementation, but by and large, it is as far along as it can be until Fortran compilers start implementing the new F08 dimension(..) syntax. Note that gfortran is currently unsupported for the mpi_f08 module and the new mpi module. gfortran users will a) fall back to the same mpi module implementation that is in OMPI v1.5.x, and b) not get the new mpi_f08 module. The gfortran maintainers are actively working hard to add the necessary features to support both the new mpi_f08 module and the new mpi module implementations. This will take some time. As mentioned above, ompi/mpi/f77 and ompi/mpi/f90 no longer exist. All the fortran bindings implementations have been collated under ompi/mpi/fortran; each implementation has its own subdirectory: {{{ ompi/mpi/fortran/ base/ - glue code mpif-h/ - what used to be ompi/mpi/f77 use-mpi-tkr/ - what used to be ompi/mpi/f90 use-mpi-ignore-tkr/ - new mpi module implementation use-mpi-f08/ - new mpi_f08 module implementation }}} There's also a prototype 6-function-MPI implementation under use-mpi-f08-desc that emulates the new F08 dimension(..) syntax that isn't fully available in Fortran compilers yet. We did that to prove it to ourselves that it could be done once the compilers fully support it. This directory/implementation will likely eventually replace the use-mpi-f08 version. Other things that were done: * ompi_info grew a few new output fields to describe what level of Fortran support is included * Existing Fortran examples in examples/ were renamed; new mpi_f08 examples were added * The old Fortran MPI libraries were renamed: * libmpi_f77 -> libmpi_mpifh * libmpi_f90 -> libmpi_usempi * The configury for Fortran was consolidated and significantly slimmed down. Note that the F77 env variable is now IGNORED for configure; you should only use FC. Example: {{{ shell$ ./configure CC=icc CXX=icpc FC=ifort ... }}} All of this work was done in a Mercurial branch off the SVN trunk, and hosted at Bitbucket. This branch has got to be one of OMPI's longest-running branches. Its first commit was Tue Apr 07 23:01:46 2009 -0400 -- it's over 3 years old! :-) We think we've pulled in all relevant changes from the OMPI trunk (e.g., Fortran implementations of the new MPI-3 MPROBE stuff for mpif.h, use mpi, and use mpi_f08, and the recent Fujitsu Fortran patches). I anticipate some instability when we bring this stuff into the trunk, simply because it touches a LOT of code in the MPI layer in the OMPI code base. We'll try our best to make it as pain-free as possible, but please bear with us when it is committed. This commit was SVN r26283.
This commit is contained in:
parent
164eec380c
commit
253444c6d0
186
README
186
README
@ -8,7 +8,7 @@ Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
|
||||
University of Stuttgart. All rights reserved.
|
||||
Copyright (c) 2004-2007 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
Copyright (c) 2006-2010 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
|
||||
Copyright (c) 2006-2011 Mellanox Technologies. All rights reserved.
|
||||
Copyright (c) 2006-2012 Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright (c) 2007 Myricom, Inc. All rights reserved.
|
||||
@ -120,7 +120,7 @@ Compiler Notes
|
||||
--------------
|
||||
|
||||
- Mixing compilers from different vendors when building Open MPI
|
||||
(e.g., using the C/C++ compiler from one vendor and the F77/F90
|
||||
(e.g., using the C/C++ compiler from one vendor and the Fortran
|
||||
compiler from a different vendor) has been successfully employed by
|
||||
some Open MPI users (discussed on the Open MPI user's mailing list),
|
||||
but such configurations are not tested and not documented. For
|
||||
@ -225,72 +225,85 @@ Compiler Notes
|
||||
- Using the Absoft compiler to build the MPI Fortran bindings on Suse
|
||||
9.3 is known to fail due to a Libtool compatibility issue.
|
||||
|
||||
- While it is possible -- on some platforms -- to configure and build
|
||||
Open MPI with one Fortran compiler and then build MPI applications
|
||||
with a different Fortran compiler, this is not recommended. Subtle
|
||||
problems can arise at run time, even if the MPI application
|
||||
compiled and linked successfully.
|
||||
- MPI Fortran API support has been completely overhauled since the
|
||||
Open MPI v1.5/v1.6 series.
|
||||
|
||||
Specifically, the following two cases may not be portable between
|
||||
different Fortran compilers:
|
||||
********************************************************************
|
||||
********************************************************************
|
||||
*** There is now only a single Fortran MPI wrapper compiler:
|
||||
*** mpifort. mpif77 and mpif90 still exist, but they are symbolic
|
||||
*** links to mpifort.
|
||||
********************************************************************
|
||||
*** Similarly, Open MPI's configure script only recongizes the FC
|
||||
*** and FCFLAGS environment variables (to specify the Fortran
|
||||
*** compiler and compiler flags, respectively). The F77 and FFLAGS
|
||||
*** environment variables are IGNORED.
|
||||
********************************************************************
|
||||
********************************************************************
|
||||
|
||||
1. The C constants MPI_F_STATUS_IGNORE and MPI_F_STATUSES_IGNORE
|
||||
will only compare properly to Fortran applications that were
|
||||
created with Fortran compilers that that use the same
|
||||
name-mangling scheme as the Fortran compiler with which Open MPI
|
||||
was configured.
|
||||
You can use ompi_info to see with which Fortran compiler Open MPI
|
||||
was configured and compiled.
|
||||
|
||||
2. Fortran compilers may have different values for the logical
|
||||
.TRUE. constant. As such, any MPI function that uses the Fortran
|
||||
LOGICAL type may only get .TRUE. values back that correspond to
|
||||
the the .TRUE. value of the Fortran compiler with which Open MPI
|
||||
was configured. Note that some Fortran compilers allow forcing
|
||||
.TRUE. to be 1 and .FALSE. to be 0. For example, the Portland
|
||||
Group compilers provide the "-Munixlogical" option, and Intel
|
||||
compilers (version >= 8.) provide the "-fpscomp logicals" option.
|
||||
There are up to three sets of Fortran MPI bindings that may be
|
||||
provided (depending on your Fortran compiler):
|
||||
|
||||
You can use the ompi_info command to see the Fortran compiler with
|
||||
which Open MPI was configured.
|
||||
- mpif.h: This is the first MPI Fortran interface that was defined
|
||||
in MPI-1. It is a file that is included in Fortran source code.
|
||||
Open MPI's mpif.h does not declare any MPI subroutines; they are
|
||||
all implicit.
|
||||
|
||||
- The Fortran 90 MPI bindings can now be built in one of three sizes
|
||||
using --with-mpi-f90-size=SIZE (see description below). These sizes
|
||||
reflect the number of MPI functions included in the "mpi" Fortran 90
|
||||
module and therefore which functions will be subject to strict type
|
||||
checking. All functions not included in the Fortran 90 module can
|
||||
still be invoked from F90 applications, but will fall back to
|
||||
Fortran-77 style checking (i.e., little/none).
|
||||
- mpi module: The mpi module file was added in MPI-2. It provides
|
||||
strong compile-time parameter type checking for MPI subroutines.
|
||||
|
||||
- trivial: Only includes F90-specific functions from MPI-2. This
|
||||
means overloaded versions of MPI_SIZEOF for all the MPI-supported
|
||||
F90 intrinsic types.
|
||||
- mpi_f08 module: The mpi_f08 module was added in MPI-3. It
|
||||
provides many advantages over the mpif.h file and mpi module. For
|
||||
example, MPI handles have distinct types (vs. all being integers).
|
||||
See the MPI-3 document for more details.
|
||||
|
||||
- small (default): All the functions in "trivial" plus all MPI
|
||||
functions that take no choice buffers (meaning buffers that are
|
||||
specified by the user and are of type (void*) in the C bindings --
|
||||
generally buffers specified for message passing). Hence,
|
||||
functions like MPI_COMM_RANK are included, but functions like
|
||||
MPI_SEND are not.
|
||||
*** The mpi_f08 module is STRONGLY is recommended for all new MPI
|
||||
Fortran subroutines and applications. Note that the mpi_f08
|
||||
module can be used in conjunction with the other two Fortran
|
||||
MPI bindings in the same application (only one binding can be
|
||||
used per subroutine/function, however). Full interoperability
|
||||
between mpif.h/mpi module and mpi_f08 module MPI handle types
|
||||
is provided, allowing mpi_f08 to be used in new subroutines in
|
||||
legacy MPI applications.
|
||||
|
||||
- medium: All the functions in "small" plus all MPI functions that
|
||||
take one choice buffer (e.g., MPI_SEND, MPI_RECV, ...). All
|
||||
one-choice-buffer functions have overloaded variants for each of
|
||||
the MPI-supported Fortran intrinsic types up to the number of
|
||||
dimensions specified by --with-f90-max-array-dim (default value is
|
||||
4).
|
||||
The following notes apply to the above-listed Fortran bindings:
|
||||
|
||||
Increasing the size of the F90 module (in order from trivial, small,
|
||||
and medium) will generally increase the length of time required to
|
||||
compile user MPI applications. Specifically, "trivial"- and
|
||||
"small"-sized F90 modules generally allow user MPI applications to
|
||||
be compiled fairly quickly but lose type safety for all MPI
|
||||
functions with choice buffers. "medium"-sized F90 modules generally
|
||||
take longer to compile user applications but provide greater type
|
||||
safety for MPI functions.
|
||||
- The mpi_f08 module is new and has been tested with the Intel
|
||||
Fortran compiler. Other modern Fortran compilers may also work
|
||||
(but are, as yet, currently untested). It is expected that this
|
||||
support will mature over time.
|
||||
|
||||
Note that MPI functions with two choice buffers (e.g., MPI_GATHER)
|
||||
are not currently included in Open MPI's F90 interface. Calls to
|
||||
these functions will automatically fall through to Open MPI's F77
|
||||
interface.
|
||||
The gfortran compiler is *not* supported with the mpi_f08 module
|
||||
(gfortran lacks some necessary modern Fortran features, sorry).
|
||||
|
||||
- All Fortran compilers support the mpif.h-based bindings.
|
||||
|
||||
- If Open MPI is built with a non-GNU Fortran compiler, all MPI
|
||||
subroutines will be prototyped in the mpi module, meaning that all
|
||||
calls to MPI subroutines will have their parameter types checked
|
||||
at compile time.
|
||||
|
||||
- If Open MPI is built with a GNU Fortran compiler (gfortran), it
|
||||
will compile a limited "mpi" module -- not all MPI subroutines
|
||||
will be prototyped due to both poor design of the mpi module in
|
||||
the MPI-2 specification and a lack of features in gfortran.
|
||||
|
||||
Specifically, all MPI subroutines with no "choice" buffers are
|
||||
prototyped and will receive strong parameter type checking at
|
||||
run-time (e.g., MPI_INIT, MPI_COMM_RANK, etc.).
|
||||
|
||||
MPI subroutines with one choice buffer (e.g., MPI_SEND) are
|
||||
prototyped for all intrinsic Fortran types for scalars and ranks 1
|
||||
through 4 (the --with-gfortran-max-array-dim configure switch can
|
||||
be used to increase the max array rank supported to up to 7).
|
||||
|
||||
MPI subroutines with two choice buffers (e.g., MPI_GATHER) are
|
||||
*not* prototyped. These subroutines can still be called in MPI
|
||||
applications; they just will not receive strong parameter type
|
||||
checking.
|
||||
|
||||
|
||||
General Run-Time Support Notes
|
||||
@ -1006,26 +1019,8 @@ MPI FUNCTIONALITY
|
||||
disable the C++ checks during configure; some of Open MPI's tools
|
||||
are written in C++ and therefore require a C++ compiler to be built.
|
||||
|
||||
--disable-mpi-f77
|
||||
Disable building the Fortran 77 MPI bindings.
|
||||
|
||||
--disable-mpi-f90
|
||||
Disable building the Fortran 90 MPI bindings. Also related to the
|
||||
--with-f90-max-array-dim and --with-mpi-f90-size options.
|
||||
|
||||
--with-mpi-f90-size=<SIZE>
|
||||
Three sizes of the MPI F90 module can be built: trivial (only a
|
||||
handful of MPI-2 F90-specific functions are included in the F90
|
||||
module), small (trivial + all MPI functions that take no choice
|
||||
buffers), and medium (small + all MPI functions that take 1 choice
|
||||
buffer). This parameter is only used if the F90 bindings are
|
||||
enabled.
|
||||
|
||||
--with-f90-max-array-dim=<DIM>
|
||||
The F90 MPI bindings are strictly typed, even including the number of
|
||||
dimensions for arrays for MPI choice buffer parameters. Open MPI
|
||||
generates these bindings at compile time with a maximum number of
|
||||
dimensions as specified by this parameter. The default value is 4.
|
||||
--disable-mpi-fortran
|
||||
Disable building the Fortran MPI bindings.
|
||||
|
||||
--enable-mpi-ext(=<list>)
|
||||
Enable Open MPI's non-portable API extensions. If no <list> is
|
||||
@ -1085,8 +1080,7 @@ MPI FUNCTIONALITY
|
||||
|
||||
<cflags>: Flags passed by the mpicc wrapper to the C compiler
|
||||
<cxxflags>: Flags passed by the mpic++ wrapper to the C++ compiler
|
||||
<fflags>: Flags passed by the mpif77 wrapper to the F77 compiler
|
||||
<fcflags>: Flags passed by the mpif90 wrapper to the F90 compiler
|
||||
<fcflags>: Flags passed by the mpifort wrapper to the Fortran compiler
|
||||
<ldflags>: Flags passed by all the wrappers to the linker
|
||||
<libs>: Flags passed by all the wrappers to the linker
|
||||
|
||||
@ -1108,11 +1102,8 @@ CXX - C++ compiler to use
|
||||
CXXFLAGS - Compile flags to pass to the C++ compiler
|
||||
CXXCPPFLAGS - Preprocessor flags to pass to the C++ compiler
|
||||
|
||||
F77 - Fortran 77 compiler to use
|
||||
FFLAGS - Compile flags to pass to the Fortran 77 compiler
|
||||
|
||||
FC - Fortran 90 compiler to use
|
||||
FCFLAGS - Compile flags to pass to the Fortran 90 compiler
|
||||
FC - Fortran compiler to use
|
||||
FCFLAGS - Compile flags to pass to the Fortran compiler
|
||||
|
||||
LDFLAGS - Linker flags to pass to all compilers
|
||||
LIBS - Libraries to pass to all compilers (it is rarely
|
||||
@ -1122,7 +1113,7 @@ PKG_CONFIG - Path to the pkg-config utility
|
||||
|
||||
For example:
|
||||
|
||||
shell$ ./configure CC=mycc CXX=myc++ F77=myf77 F90=myf90 ...
|
||||
shell$ ./configure CC=mycc CXX=myc++ FC=myfortran ...
|
||||
|
||||
***Note: We generally suggest using the above command line form for
|
||||
setting different compilers (vs. setting environment variables and
|
||||
@ -1146,11 +1137,11 @@ Note that you may also want to ensure that the value of
|
||||
LD_LIBRARY_PATH is set appropriately (or not at all) for your build
|
||||
(or whatever environment variable is relevant for your operating
|
||||
system). For example, some users have been tripped up by setting to
|
||||
use non-default Fortran compilers via FC / F77, but then failing to
|
||||
set LD_LIBRARY_PATH to include the directory containing that
|
||||
non-default Fortran compiler's support libraries. This causes Open
|
||||
MPI's configure script to fail when it tries to compile / link / run
|
||||
simple Fortran programs.
|
||||
use a non-default Fortran compiler via FC, but then failing to set
|
||||
LD_LIBRARY_PATH to include the directory containing that non-default
|
||||
Fortran compiler's support libraries. This causes Open MPI's
|
||||
configure script to fail when it tries to compile / link / run simple
|
||||
Fortran programs.
|
||||
|
||||
It is required that the compilers specified be compile and link
|
||||
compatible, meaning that object files created by one compiler must be
|
||||
@ -1335,8 +1326,10 @@ Here's how we apply those rules specifically to Open MPI:
|
||||
applications.
|
||||
|
||||
* libmpi
|
||||
* libmpi_f77
|
||||
* libmpi_f90
|
||||
* libmpi_mpifh
|
||||
* libmpi_usempi_tkr
|
||||
* libmpi_usempi_ignore_tkr
|
||||
* libmpi_usempif08
|
||||
* libmpi_cxx
|
||||
|
||||
4. Note, however, that libmpi.so can have its "revision" number
|
||||
@ -1532,8 +1525,7 @@ compiling MPI applications:
|
||||
|
||||
C: mpicc
|
||||
C++: mpiCC (or mpic++ if your filesystem is case-insensitive)
|
||||
Fortran 77: mpif77
|
||||
Fortran 90: mpif90
|
||||
Fortran: mpifort
|
||||
|
||||
For example:
|
||||
|
||||
@ -1568,9 +1560,7 @@ ompi Synonym for "ompi-c"; Open MPI applications using the C
|
||||
MPI bindings
|
||||
ompi-c Open MPI applications using the C MPI bindings
|
||||
ompi-cxx Open MPI applications using the C or C++ MPI bindings
|
||||
ompi-f77 Open MPI applications using the C or "mpif.h" MPI bindings
|
||||
ompi-f90 Open MPI applications using the C, "mpif.h" or "use mpi" MPI
|
||||
bindings
|
||||
ompi-fort Open MPI applications using the Fortran MPI bindings
|
||||
------------------------------------------------------------------------
|
||||
|
||||
The following pkg-config(1) configuration files *may* be installed,
|
||||
|
7
VERSION
7
VERSION
@ -21,7 +21,7 @@ release=0
|
||||
# only requirement is that it must be entirely printable ASCII
|
||||
# characters and have no white space.
|
||||
|
||||
greek=a1
|
||||
greek=mpif08-6
|
||||
|
||||
# If want_repo_rev=1, then the repo revision number will be included
|
||||
# in the overall Open MPI version number in some form.
|
||||
@ -90,8 +90,9 @@ date="Unreleased developer copy"
|
||||
|
||||
libmpi_so_version=0:0:0
|
||||
libmpi_cxx_so_version=0:0:0
|
||||
libmpi_f77_so_version=0:0:0
|
||||
libmpi_f90_so_version=0:0:0
|
||||
libmpi_mpifh_so_version=0:0:0
|
||||
libmpi_usempi_tkr_so_version=0:0:0
|
||||
libmpi_usempi_ignore_tkr_so_version=0:0:0
|
||||
libopen_rte_so_version=0:0:0
|
||||
libopen_pal_so_version=0:0:0
|
||||
libmpi_java_so_version=0:0:0
|
||||
|
22
autogen.pl
22
autogen.pl
@ -804,6 +804,7 @@ GNU tools:
|
||||
##############################################################################
|
||||
|
||||
sub safe_system {
|
||||
print "Running: " . join(/ /, @_) . "\n";
|
||||
my $ret = system(@_);
|
||||
$ret >>= 8;
|
||||
if (0 != $ret) {
|
||||
@ -1088,6 +1089,27 @@ if ($include_arg) {
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
++$step;
|
||||
verbose "\n$step. Running template-generating scripts\n\n";
|
||||
|
||||
# These scripts generate files that are used by configure (i.e., we
|
||||
# generate one .h.in file from another .h.in file so that humans don't
|
||||
# have to maintain two copies).
|
||||
|
||||
my @scripts;
|
||||
push(@scripts, "ompi/include/mpif-common.pl");
|
||||
|
||||
foreach my $s (@scripts) {
|
||||
verbose "=== $s\n";
|
||||
if (! -x $s) {
|
||||
print "Cannot find executable $s!\nAborting.\n";
|
||||
my_exit(1);
|
||||
}
|
||||
system($s);
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
# Find projects, frameworks, components
|
||||
++$step;
|
||||
verbose "\n$step. Searching for projects, MCA frameworks, and MCA components\n";
|
||||
|
@ -5,7 +5,7 @@ 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 (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
dnl Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
|
||||
dnl $COPYRIGHT$
|
||||
dnl
|
||||
dnl Additional copyrights may follow
|
||||
@ -47,7 +47,7 @@ AC_DEFUN([OMPI_CHECK_COMPILER_WORKS],
|
||||
* 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.
|
||||
* available in the config.log file in the Open MPI build directory.
|
||||
**********************************************************************
|
||||
EOF
|
||||
$5], [$4])
|
||||
|
@ -9,6 +9,7 @@ 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) 2012 Cisco Systems, Inc. All rights reserved.
|
||||
dnl $COPYRIGHT$
|
||||
dnl
|
||||
dnl Additional copyrights may follow
|
||||
@ -46,12 +47,12 @@ AC_DEFUN([OMPI_INTL_PTHREAD_TRY_LINK], [
|
||||
])dnl
|
||||
|
||||
|
||||
AC_DEFUN([OMPI_INTL_PTHREAD_TRY_LINK_F77], [
|
||||
# BEGIN: OMPI_INTL_PTHREAD_TRY_LINK_F77
|
||||
AC_DEFUN([OMPI_INTL_PTHREAD_TRY_LINK_FORTRAN], [
|
||||
# BEGIN: OMPI_INTL_PTHREAD_TRY_LINK_FORTRAN
|
||||
#
|
||||
# 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])
|
||||
OMPI_FORTRAN_MAKE_C_FUNCTION([ompi_ac_thread_fn], [pthreadtest])
|
||||
|
||||
# Fortran module
|
||||
cat > conftestf.f <<EOF
|
||||
@ -94,7 +95,7 @@ EOF
|
||||
OPAL_LOG_COMMAND(
|
||||
[$CC $CFLAGS -I. -c conftest.c],
|
||||
OPAL_LOG_COMMAND(
|
||||
[$F77 $FFLAGS conftestf.f conftest.o -o conftest $LDFLAGS $LIBS],
|
||||
[$FC $FCFLAGS conftestf.f conftest.o -o conftest $LDFLAGS $LIBS],
|
||||
[HAPPY=1],
|
||||
[HAPPY=0]),
|
||||
[HAPPY=0])
|
||||
@ -115,7 +116,7 @@ fi
|
||||
|
||||
unset HAPPY ompi_conftest_h
|
||||
rm -rf conftest*
|
||||
# END: OMPI_INTL_PTHREAD_TRY_LINK_F77
|
||||
# END: OMPI_INTL_PTHREAD_TRY_LINK_FORTRAN
|
||||
])dnl
|
||||
|
||||
|
||||
@ -224,8 +225,8 @@ 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 "$ompi_pthread_fortran_success" = "0" -a "$OMPI_WANT_FORTRAN_BINDINGS" = "1"; then
|
||||
AC_MSG_CHECKING([if Fortran compiler and POSIX threads work as is])
|
||||
if test "$HAVE_POSIX_THREADS" = "1" ; then
|
||||
run_this_test=1
|
||||
else
|
||||
@ -242,10 +243,10 @@ if test "$ompi_pthread_f77_success" = "0" -a "$OMPI_WANT_F77_BINDINGS" = "1"; th
|
||||
|
||||
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)
|
||||
OMPI_INTL_PTHREAD_TRY_LINK_FORTRAN(ompi_pthread_fortran_success=1,
|
||||
ompi_pthread_fortran_success=0)
|
||||
AC_LANG_POP(C)
|
||||
if test "$ompi_pthread_f77_success" = "1"; then
|
||||
if test "$ompi_pthread_fortran_success" = "1"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
@ -274,9 +275,9 @@ AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
||||
[OMPI_INTL_POSIX_THREADS_PLAIN_CXX],
|
||||
[ompi_pthread_cxx_success=1])
|
||||
|
||||
AC_PROVIDE_IFELSE([AC_PROG_F77],
|
||||
AC_PROVIDE_IFELSE([AC_PROG_FC],
|
||||
[OMPI_INTL_POSIX_THREADS_PLAIN_FC],
|
||||
[ompi_pthread_f77_success=1])
|
||||
[ompi_pthread_fortran_success=1])
|
||||
|
||||
# End: OMPI_INTL_POSIX_THREADS_PLAIN
|
||||
])dnl
|
||||
@ -343,15 +344,15 @@ 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
|
||||
if test "$ompi_pthread_fortran_success" = "0" -a "$OMPI_WANT_FORTRAN_BINDINGS" = "1"; then
|
||||
for pf in $pflags; do
|
||||
AC_MSG_CHECKING([if F77 compiler and POSIX threads work with $pf])
|
||||
AC_MSG_CHECKING([if Fortran 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)
|
||||
OMPI_INTL_PTHREAD_TRY_LINK_FORTRAN(ompi_pthread_fortran_success=1,
|
||||
ompi_pthread_fortran_success=0)
|
||||
AC_LANG_POP(C)
|
||||
if test "$ompi_pthread_f77_success" = "1"; then
|
||||
if test "$ompi_pthread_fortran_success" = "1"; then
|
||||
PTHREAD_FFLAGS="$pf"
|
||||
AC_MSG_RESULT([yes])
|
||||
break
|
||||
@ -400,9 +401,9 @@ AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
||||
[OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS_CXX],
|
||||
[ompi_pthread_cxx_success=1])
|
||||
|
||||
AC_PROVIDE_IFELSE([AC_PROG_F77],
|
||||
AC_PROVIDE_IFELSE([AC_PROG_FC],
|
||||
[OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS_FC],
|
||||
[ompi_pthread_f77_success=1])
|
||||
[ompi_pthread_fortran_success=1])
|
||||
|
||||
# End: OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS
|
||||
])dnl
|
||||
@ -528,15 +529,15 @@ 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_fortran_success" = "0" -a "$OMPI_WANT_FORTRAN_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])
|
||||
AC_MSG_CHECKING([if Fortran 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)
|
||||
OMPI_INTL_PTHREAD_TRY_LINK_FORTRAN(ompi_pthread_fortran_success=1,
|
||||
ompi_pthread_fortran_success=0)
|
||||
AC_LANG_POP(C)
|
||||
if test "$ompi_pthread_f77_success" = "1"; then
|
||||
if test "$ompi_pthread_fortran_success" = "1"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
LIBS="$orig_LIBS"
|
||||
@ -545,13 +546,13 @@ if test "$ompi_pthread_f77_success" = "0" -a "$OMPI_WANT_F77_BINDINGS" = "1"; th
|
||||
fi
|
||||
else
|
||||
for pl in $plibs; do
|
||||
AC_MSG_CHECKING([if F77 compiler and POSIX threads work with $pl])
|
||||
AC_MSG_CHECKING([if Fortran 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)
|
||||
OMPI_INTL_PTHREAD_TRY_LINK_FORTRAN(ompi_pthread_fortran_success=1,
|
||||
ompi_pthread_fortran_success=0)
|
||||
AC_LANG_POP(C)
|
||||
if test "$ompi_pthread_f77_success" = "1"; then
|
||||
if test "$ompi_pthread_fortran_success" = "1"; then
|
||||
PTHREAD_LIBS="$pl"
|
||||
AC_MSG_RESULT([yes])
|
||||
break
|
||||
@ -587,9 +588,9 @@ AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
||||
[OMPI_INTL_POSIX_THREADS_LIBS_CXX],
|
||||
[ompi_pthread_cxx_success=1])
|
||||
|
||||
AC_PROVIDE_IFELSE([AC_PROG_F77],
|
||||
AC_PROVIDE_IFELSE([AC_PROG_FC],
|
||||
[OMPI_INTL_POSIX_THREADS_LIBS_FC],
|
||||
[ompi_pthread_f77_success=1])
|
||||
[ompi_pthread_fortran_success=1])
|
||||
|
||||
# End: OMPI_INTL_POSIX_THREADS_LIBS]
|
||||
)dnl
|
||||
@ -604,7 +605,7 @@ AC_DEFUN([OMPI_CONFIG_POSIX_THREADS],[
|
||||
AC_REQUIRE([AC_PROG_GREP])
|
||||
|
||||
ompi_pthread_c_success=0
|
||||
ompi_pthread_f77_success=0
|
||||
ompi_pthread_fortran_success=0
|
||||
ompi_pthread_cxx_success=0
|
||||
|
||||
orig_CFLAGS="$CFLAGS"
|
||||
@ -667,13 +668,13 @@ CXXCPPFLAGS="$orig_CXXCPPFLAGS"
|
||||
LDFLAGS="$orig_LDFLAGS"
|
||||
LIBS="$orig_LIBS"
|
||||
|
||||
if test "$OMPI_WANT_F77_BINDINGS" != "1"; then
|
||||
ompi_pthread_f77_success=1
|
||||
if test "$OMPI_WANT_FORTRAN_BINDINGS" != "1"; then
|
||||
ompi_pthread_fortran_success=1
|
||||
fi
|
||||
|
||||
if test "$ompi_pthread_c_success" = "1" -a \
|
||||
"$ompi_pthread_cxx_success" = "1" -a \
|
||||
"$ompi_pthread_f77_success" = "1"; then
|
||||
"$ompi_pthread_fortran_success" = "1"; then
|
||||
internal_useless=1
|
||||
$1
|
||||
else
|
||||
@ -681,6 +682,6 @@ else
|
||||
$2
|
||||
fi
|
||||
|
||||
unset ompi_pthread_c_success ompi_pthread_f77_success ompi_pthread_cxx_success
|
||||
unset ompi_pthread_c_success ompi_pthread_fortran_success ompi_pthread_cxx_success
|
||||
unset internal_useless
|
||||
])dnl
|
||||
|
@ -3,7 +3,7 @@ dnl
|
||||
dnl Copyright (c) 2004-2009 The Trustees of Indiana University and Indiana
|
||||
dnl University Research and Technology
|
||||
dnl Corporation. All rights reserved.
|
||||
dnl Copyright (c) 2009-2010 Cisco Systems, Inc. All rights reserved.
|
||||
dnl Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
|
||||
dnl Copyright (c) 2011-2012 Oak Ridge National Labs. All rights reserved.
|
||||
dnl $COPYRIGHT$
|
||||
dnl
|
||||
@ -68,15 +68,7 @@ AC_DEFUN([OMPI_EXT],[
|
||||
m4_ifdef([ompi_mpiext_list], [],
|
||||
[m4_fatal([Could not find MPI Extensions list. Aborting.])])
|
||||
|
||||
EXT_NO_CONFIG_CONFIG_FILES()
|
||||
EXT_CONFIGURE()
|
||||
|
||||
AC_SUBST(EXT_C_HEADERS)
|
||||
AC_SUBST(EXT_F77_HEADERS)
|
||||
AC_SUBST(EXT_F90_HEADERS)
|
||||
AC_SUBST(EXT_C_LIBS)
|
||||
AC_SUBST(EXT_F77_LIBS)
|
||||
AC_SUBST(EXT_F90_LIBS)
|
||||
EXT_CONFIGURE
|
||||
])
|
||||
|
||||
|
||||
@ -89,12 +81,6 @@ AC_DEFUN([OMPI_EXT],[
|
||||
#
|
||||
######################################################################
|
||||
AC_DEFUN([EXT_CONFIGURE],[
|
||||
OPAL_VAR_SCOPE_PUSH([all_components outfile outfile_real])
|
||||
|
||||
all_components=
|
||||
static_components=
|
||||
static_ltlibs=
|
||||
|
||||
outdir=ompi/include
|
||||
|
||||
# first create the output include directory
|
||||
@ -125,9 +111,8 @@ extern "C" {
|
||||
|
||||
EOF
|
||||
|
||||
|
||||
###############
|
||||
# F77 Bindings
|
||||
# mpif.h Bindings
|
||||
###############
|
||||
|
||||
# remove any previously generated #include files
|
||||
@ -138,29 +123,44 @@ EOF
|
||||
cat > $mpif_ext_h <<EOF
|
||||
! -*- fortran -*-
|
||||
! \$HEADER\$
|
||||
!
|
||||
! *** THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
! *** Any manual edits will be lost!
|
||||
!
|
||||
integer OMPI_HAVE_MPI_EXT
|
||||
parameter (OMPI_HAVE_MPI_EXT=1)
|
||||
!
|
||||
EOF
|
||||
|
||||
###############
|
||||
# "use mpi" Bindings
|
||||
###############
|
||||
|
||||
###############
|
||||
# F90 Bindings
|
||||
###############
|
||||
# Although Fortran module files are essentially compiled header
|
||||
# files, we don't create them in ompi/include, like we do for
|
||||
# mpi.h and mpif.h. Instead, we build them down in ompi/fortran,
|
||||
# when we build the rest of the Fortran modules. Indeed, in the
|
||||
# "use mpi" case, it needs some of the same internal modules that
|
||||
# the mpi_f08 module itself needs. So the mpi_f08_ext module has
|
||||
# to be built *after* the mpi_f08 module (so that all the internal
|
||||
# modules it needs are already built).
|
||||
|
||||
# remove any previously generated #include files
|
||||
mpif90_ext_h=$outdir/mpif90-ext.f90
|
||||
rm -f $mpif90_ext_h
|
||||
outdir=ompi/mpi/fortran/mpiext
|
||||
mkdir -p $outdir
|
||||
mpiusempi_ext_h=$outdir/mpi-ext-module.F90
|
||||
rm -f $mpiusempi_ext_h
|
||||
|
||||
# Create the final mpif90-ext.h file.
|
||||
cat > $mpif90_ext_h <<EOF
|
||||
# Create the final mpiusempi-ext.h file.
|
||||
cat > $mpiusempi_ext_h <<EOF
|
||||
! -*- fortran -*-
|
||||
! \$HEADER\$
|
||||
!
|
||||
! *** THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
! *** Any manual edits will be lost!
|
||||
!
|
||||
module mpi_ext
|
||||
|
||||
! Eventhough this is not a useful parameter (cannot be used as a
|
||||
! Even though this is not a useful parameter (cannot be used as a
|
||||
! preprocessor catch) define it to keep the linker from complaining
|
||||
! during the build.
|
||||
integer OMPI_HAVE_MPI_EXT
|
||||
@ -168,6 +168,59 @@ module mpi_ext
|
||||
!
|
||||
EOF
|
||||
|
||||
# Make an AM conditional to see whether we're building the mpi_ext
|
||||
# module. Note that we only build it if we support the ignore-tkr
|
||||
# mpi module.
|
||||
AS_IF([test $OMPI_BUILD_FORTRAN_USEMPI_BINDINGS -eq 1 -a \
|
||||
$OMPI_FORTRAN_HAVE_IGNORE_TKR -eq 1],
|
||||
[OMPI_BUILD_FORTRAN_USEMPI_EXT=1],
|
||||
[OMPI_BUILD_FORTRAN_USEMPI_EXT=0])
|
||||
AM_CONDITIONAL(OMPI_BUILD_FORTRAN_USEMPI_EXT,
|
||||
[test $OMPI_BUILD_FORTRAN_USEMPI_EXT -eq 1])
|
||||
|
||||
###############
|
||||
# "use mpi_f08" Bindings
|
||||
###############
|
||||
|
||||
# See note above: we generate the mpi_f08_ext module in
|
||||
# ompi/mpi/fortran/mpiext
|
||||
|
||||
# remove any previously generated #include files
|
||||
mpiusempif08_ext_h=$outdir/mpi-f08-ext-module.F90
|
||||
rm -f $mpiusempif08_ext_h
|
||||
|
||||
# Create the final mpiusempi-ext.h file.
|
||||
cat > $mpiusempif08_ext_h <<EOF
|
||||
! -*- fortran -*-
|
||||
! \$HEADER\$
|
||||
!
|
||||
! *** THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
! *** Any manual edits will be lost!
|
||||
!
|
||||
module mpi_f08_ext
|
||||
! Even though this is not a useful parameter (cannot be used as a
|
||||
! preprocessor catch) define it to keep the linker from complaining
|
||||
! during the build.
|
||||
integer OMPI_HAVE_MPI_EXT
|
||||
parameter (OMPI_HAVE_MPI_EXT=1)
|
||||
!
|
||||
EOF
|
||||
|
||||
# Only build this mpi_f08_ext module if we're building the "use
|
||||
# mpi_f08" module *and* it's the non-descriptor one.
|
||||
AS_IF([test $OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS -eq 1 -a \
|
||||
$OMPI_BUILD_FORTRAN_F08_SUBARRAYS -eq 0],
|
||||
[OMPI_BUILD_FORTRAN_USEMPIF08_EXT=1],
|
||||
[OMPI_BUILD_FORTRAN_USEMPIF08_EXT=0])
|
||||
AM_CONDITIONAL(OMPI_BUILD_FORTRAN_USEMPIF08_EXT,
|
||||
[test $OMPI_BUILD_FORTRAN_USEMPIF08_EXT -eq 1])
|
||||
|
||||
# Make an AM conditional to see whether we're building either the
|
||||
# mpi_ext or mpi_f08_Ext modules.
|
||||
AM_CONDITIONAL(OMPI_BUILD_FORTRAN_USEMPI_OR_USEMPIF08_EXT,
|
||||
[test $OMPI_BUILD_FORTRAN_USEMPI_EXT -eq 1 -o \
|
||||
$OMPI_BUILD_FORTRAN_USEMPIF08_EXT -eq 1])
|
||||
|
||||
#
|
||||
# Process each component
|
||||
#
|
||||
@ -182,9 +235,11 @@ EOF
|
||||
m4_foreach(extension, [ompi_mpiext_list],
|
||||
[m4_ifval(extension,
|
||||
[EXT_CONFIGURE_M4_CONFIG_COMPONENT(extension,
|
||||
[all_components],
|
||||
[static_components],
|
||||
[static_ltlibs])])])
|
||||
[OMPI_MPIEXT_ALL],
|
||||
[OMPI_MPIEXT_C],
|
||||
[OMPI_MPIEXT_MPIFH],
|
||||
[OMPI_MPIEXT_USEMPI],
|
||||
[OMPI_MPIEXT_USEMPIF08])])])
|
||||
|
||||
###############
|
||||
# C Bindings
|
||||
@ -201,7 +256,7 @@ EOF
|
||||
EOF
|
||||
|
||||
###############
|
||||
# F77 Bindings
|
||||
# mpif.h Bindings
|
||||
###############
|
||||
# Create the final mpif-ext.h file.
|
||||
cat >> $mpif_ext_h <<EOF
|
||||
@ -209,14 +264,22 @@ EOF
|
||||
EOF
|
||||
|
||||
###############
|
||||
# F90 Bindings
|
||||
# "use mpi" Bindings
|
||||
###############
|
||||
# Create the final mpif90-ext.h file.
|
||||
cat >> $mpif90_ext_h <<EOF
|
||||
# Create the final mpiusempi-ext.h file.
|
||||
cat >> $mpiusempi_ext_h <<EOF
|
||||
!
|
||||
end module mpi_ext
|
||||
EOF
|
||||
|
||||
###############
|
||||
# "use mpi_f08" Bindings
|
||||
###############
|
||||
# Create the final mpiusempi-ext.h file.
|
||||
cat >> $mpiusempif08_ext_h <<EOF
|
||||
!
|
||||
end module mpi_f08_ext
|
||||
EOF
|
||||
|
||||
# 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
|
||||
@ -256,16 +319,19 @@ EOF
|
||||
fi
|
||||
rm -f $outfile.struct $outfile.extern
|
||||
|
||||
OMPI_EXT_MAKE_DIR_LIST(OMPI_MPIEXT_ALL_SUBDIRS, [$all_components])
|
||||
OMPI_EXT_MAKE_DIR_LIST(OMPI_MPIEXT_SUBDIRS, [$static_components])
|
||||
# We have all the results we need. Now put them in various
|
||||
# variables/defines so that others can see the results.
|
||||
|
||||
comps=`echo $static_components | sed -e 's/^[ \t]*//;s/[ \t]*$//;s/ /, /g'`
|
||||
AC_DEFINE_UNQUOTED([OMPI_MPIEXT_COMPONENTS], ["$comps"], [MPI Extensions included in libmpi])
|
||||
OMPI_EXT_MAKE_DIR_LIST(OMPI_MPIEXT_ALL_SUBDIRS, $OMPI_MPIEXT_ALL)
|
||||
|
||||
OMPI_MPIEXT_LIBS="${static_ltlibs}"
|
||||
AC_SUBST(OMPI_MPIEXT_LIBS)
|
||||
OMPI_EXT_MAKE_LISTS(OMPI_MPIEXT_C, $OMPI_MPIEXT_C, c, c)
|
||||
OMPI_EXT_MAKE_LISTS(OMPI_MPIEXT_MPIFH, $OMPI_MPIEXT_MPIFH, mpif-h, mpifh)
|
||||
OMPI_EXT_MAKE_LISTS(OMPI_MPIEXT_USEMPI, $OMPI_MPIEXT_USEMPI, use-mpi, usempi)
|
||||
OMPI_EXT_MAKE_LISTS(OMPI_MPIEXT_USEMPIF08, $OMPI_MPIEXT_USEMPIF08, use-mpi-f08, usempif08)
|
||||
|
||||
OPAL_VAR_SCOPE_POP
|
||||
comps=`echo $OMPI_MPIEXT_C | sed -e 's/^[ \t]*//;s/[ \t]*$//;s/ /, /g'`
|
||||
AC_DEFINE_UNQUOTED([OMPI_MPIEXT_COMPONENTS], ["$comps"],
|
||||
[MPI Extensions included in libmpi])
|
||||
])
|
||||
|
||||
|
||||
@ -275,10 +341,17 @@ EOF
|
||||
#
|
||||
#
|
||||
# USAGE:
|
||||
# EXT_CONFIGURE_PROJECT(component_name
|
||||
# all_components_variable,
|
||||
# static_components_variable,
|
||||
# static_ltlibs_variable)
|
||||
# EXT_CONFIGURE_M4_CONFIG_COMPONENT((1) component_name,
|
||||
# (2) all_components_variable,
|
||||
# (3) c_components_variable,
|
||||
# (4) mpifh_components_variable,
|
||||
# (5) usempi_components_variable,
|
||||
# (6) usempif08_components_variable)
|
||||
#
|
||||
# - component_name is a single, naked string (no prefix)
|
||||
# - all others are naked component names (e.g., "example"). If an
|
||||
# extension is named in that variable, it means that that extension
|
||||
# has bindings of that flavor.
|
||||
#
|
||||
######################################################################
|
||||
AC_DEFUN([EXT_CONFIGURE_M4_CONFIG_COMPONENT],[
|
||||
@ -291,16 +364,11 @@ AC_DEFUN([EXT_CONFIGURE_M4_CONFIG_COMPONENT],[
|
||||
m4_ifdef([OMPI_MPIEXT_$1_CONFIG], [],
|
||||
[m4_fatal([Could not find OMPI_MPIEXT_]$1[_CONFIG macro for ]$1[ component])])
|
||||
|
||||
OMPI_MPIEXT_$1_CONFIG([should_build=${should_build}],
|
||||
[should_build=0])
|
||||
OMPI_MPIEXT_$1_CONFIG([should_build=${should_build}], [should_build=0])
|
||||
|
||||
AS_IF([test "$should_build" = "1"],
|
||||
[EXT_PROCESS_COMPONENT($1, $2, $4)
|
||||
# add component to static component list
|
||||
$3="$$3 $1" ],
|
||||
[EXT_PROCESS_DEAD_COMPONENT($1)
|
||||
# add component to all component list
|
||||
$2="$$2 $1"])
|
||||
AS_IF([test $should_build -eq 1],
|
||||
[EXT_PROCESS_COMPONENT([$1], [$2], [$3], [$4], [$5], [$6])],
|
||||
[EXT_PROCESS_DEAD_COMPONENT([$1], [$2])])
|
||||
])
|
||||
|
||||
######################################################################
|
||||
@ -311,23 +379,63 @@ AC_DEFUN([EXT_CONFIGURE_M4_CONFIG_COMPONENT],[
|
||||
# calling that this component can build properly (and exists)
|
||||
#
|
||||
# USAGE:
|
||||
# EXT_CONFIGURE_ALL_CONFIG_COMPONENTS(component_name
|
||||
# all_components_variable (2),
|
||||
# static_ltlibs_variable (3),
|
||||
# compile_mode_variable (4))
|
||||
# EXT_CONFIGURE_ALL_CONFIG_COMPONENTS((1) component_name
|
||||
# (2) all_components_variable,
|
||||
# (3) c_components_variable,
|
||||
# (4) mpifh_components_variable,
|
||||
# (5) usempi_components_variable,
|
||||
# (6) usempif08_components_variable)
|
||||
#
|
||||
# NOTE: component_name may not be determined until runtime....
|
||||
# C bindings are mandatory. Other bindings are optional / built if
|
||||
# they are found. Here's the files that the m4 expects:
|
||||
#
|
||||
#--------------------
|
||||
#
|
||||
# C:
|
||||
# - c/mpiext_<component>_c.h: is included in mpi_ext.h
|
||||
# - c/libmpiext_<component>.la: convneience library slurped into libmpi.la
|
||||
#
|
||||
# mpi.f.h:
|
||||
# - mpif-h/mpiext_<component>_mpifh.h: is included mpi mpif_ext.h
|
||||
# - mpif-h/libmpiext_<component>_mpifh.la: convenience library slurped
|
||||
# into libmpi_mpifh.la
|
||||
#
|
||||
# If the ..._mpifh.h file exists, it is assumed that "make all" will
|
||||
# build the .la file. And therefore we'll include full support for
|
||||
# the mpif.h bindings for this extension in OMPI.
|
||||
#
|
||||
#--------------------
|
||||
#
|
||||
# use mpi:
|
||||
# - use-mpi/mpiext_<component>_usempi.h: included in the mpi_ext module
|
||||
#
|
||||
# Only supported when the ignore-tkr mpi module is built (this
|
||||
# currently means: when you don't use gfortran).
|
||||
#
|
||||
# If the ..._usempi.h file exists, it is assumed that we'll include
|
||||
# full support for the mpi_ext bindings for this extension in OMPI.
|
||||
#
|
||||
# NO LIBRARY IS SUPPORTED FOR THE mpi MODULE BINDINGS! It is assumed
|
||||
# that all required symbols will be in the
|
||||
# libmpiext_<component>_mpifh.la library, and all that this set of
|
||||
# bindings does it give strong type checking to those subroutines.
|
||||
#
|
||||
#--------------------
|
||||
#
|
||||
# use mpi_f08:
|
||||
# - use-mpi-f08/mpiext_<component>_usempif08.h: included in the mpi_ext module
|
||||
# - use-mpi-f08/libmpiext_<component>_usempif08.la: convenience
|
||||
# library slurped into libmpi_usempif08.la
|
||||
#
|
||||
# Only supported when the non-descriptor-based mpi_f08 module is built
|
||||
# (this currently means: when you don't use gfortran).
|
||||
#
|
||||
# If the ..._usempif08.h file exists, it is assumed that "make all"
|
||||
# will build the .la file. And therefore we'll include full support
|
||||
# for the mpi_f08 bindings for this extension in OMPI.
|
||||
#
|
||||
# M4 directive to disable language support in configure.m4
|
||||
# Need to build a list of .la for each lang. to pull into final library
|
||||
# List ext_c_headers, ext_c_libs {same for other lang.}
|
||||
# C: framework_component_c{.h, .la}
|
||||
# F77: framework_component_f77{.h, .la}
|
||||
# F90: framework_component_f90{.h, .la} ???
|
||||
######################################################################
|
||||
AC_DEFUN([EXT_PROCESS_COMPONENT],[
|
||||
AC_REQUIRE([AC_PROG_GREP])
|
||||
|
||||
component=$1
|
||||
|
||||
# Output pretty results
|
||||
@ -340,67 +448,57 @@ AC_DEFUN([EXT_PROCESS_COMPONENT],[
|
||||
###############
|
||||
# C Bindings
|
||||
###############
|
||||
test_header="${srcdir}/ompi/mpiext/$component/mpiext_${component}_c.h"
|
||||
test_header="${srcdir}/ompi/mpiext/$component/c/mpiext_${component}_c.h"
|
||||
|
||||
AC_MSG_CHECKING([if MPI Extension $component has C bindings])
|
||||
AC_MSG_CHECKING([if MPI Extension $component has C bindings])
|
||||
|
||||
if test -e "$test_header" ; then
|
||||
AC_MSG_RESULT([yes])
|
||||
AS_IF([test ! -e "$test_header"],
|
||||
[ # There *must* be C bindings
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_WARN([C bindings for MPI extensions are required])
|
||||
AC_MSG_ERROR([Cannot continue])])
|
||||
|
||||
# Save the list of headers and convenience libraries that this component will output
|
||||
EXT_C_HEADERS="$EXT_C_HEADERS mpiext/$component/mpiext_${component}_c.h"
|
||||
EXT_C_LIBS="$EXT_C_LIBS mpiext/$component/libext_mpiext_${component}.la"
|
||||
$3="mpiext/${component}/libext_mpiext_${component}.la $$3"
|
||||
AC_MSG_RESULT([yes (required)])
|
||||
|
||||
component_header="mpiext_${component}_c.h"
|
||||
# Save the list of headers and convenience libraries that this
|
||||
# component will output
|
||||
thisdir="mpiext/$component"
|
||||
$2="$$2 $thisdir"
|
||||
$3="$$3 $component"
|
||||
|
||||
cat >> $mpi_ext_h <<EOF
|
||||
# JMS Where is this needed?
|
||||
EXT_C_HEADERS="$EXT_C_HEADERS mpiext/$component/c/mpiext_${component}_c.h"
|
||||
|
||||
component_header="mpiext_${component}_c.h"
|
||||
|
||||
cat >> $mpi_ext_h <<EOF
|
||||
/* Enabled Extension: $component */
|
||||
#define $component_define 1
|
||||
#include "openmpi/ompi/mpiext/$component/$component_header"
|
||||
#include "openmpi/ompi/mpiext/$component/c/$component_header"
|
||||
|
||||
EOF
|
||||
#
|
||||
# Profiling interface
|
||||
#
|
||||
test_header="${srcdir}/ompi/mpiext/$component/c/profile/defines.h"
|
||||
AC_MSG_CHECKING([if MPI Extension $component has C bindings for profiling])
|
||||
if test -e "$test_header" ; then
|
||||
AC_MSG_RESULT([yes])
|
||||
|
||||
# Save the list of headers and convenience libraries that this component will output
|
||||
$3="mpiext/${component}/c/profile/libext_pmpiext_c_${component}.la $$3"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
else
|
||||
# There *must* be C bindings
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_WARN([C Bindings are required])
|
||||
AC_MSG_ERROR([Cannot continue])
|
||||
fi
|
||||
|
||||
###############
|
||||
# F77 Bindings
|
||||
# mpif.h bindings
|
||||
###############
|
||||
#
|
||||
# Test if this extension has f77 bindings
|
||||
# Test if this extension has mpif.h bindings
|
||||
# If not, skip this step.
|
||||
#
|
||||
test_header="${srcdir}/ompi/mpiext/$component/mpiext_${component}_f77.h"
|
||||
enabled_f77=0
|
||||
test_header="${srcdir}/ompi/mpiext/$component/mpif-h/mpiext_${component}_mpifh.h"
|
||||
enabled_mpifh=0
|
||||
|
||||
AC_MSG_CHECKING([if MPI Extension $component has F77 bindings])
|
||||
AC_MSG_CHECKING([if MPI Extension $component has mpif.h bindings])
|
||||
|
||||
if test -e "$test_header" ; then
|
||||
AC_MSG_RESULT([yes])
|
||||
enabled_f77=1
|
||||
enabled_mpifh=1
|
||||
|
||||
EXT_F77_HEADERS="$EXT_F77_HEADERS mpiext/$component/mpiext_${component}_f77.h"
|
||||
EXT_F77_LIBS="$EXT_F77_LIBS mpiext/$component/libext_mpiext_${component}_f77.la"
|
||||
$3="$$3 mpiext/${component}/libext_mpiext_${component}_f77.la"
|
||||
# JMS Where is this needed?
|
||||
EXT_MPIFH_HEADERS="$EXT_MPIFH_HEADERS mpiext/$component/mpif-h/mpiext_${component}_mpifh.h"
|
||||
$4="$$4 $component"
|
||||
|
||||
component_header="mpiext_${component}_f77.h"
|
||||
component_header="mpiext_${component}_mpifh.h"
|
||||
|
||||
cat >> $mpif_ext_h <<EOF
|
||||
!
|
||||
@ -409,92 +507,130 @@ EOF
|
||||
integer $component_define
|
||||
parameter ($component_define=1)
|
||||
|
||||
include 'openmpi/ompi/mpiext/$component/$component_header'
|
||||
include 'openmpi/ompi/mpiext/$component/mpif-h/$component_header'
|
||||
|
||||
EOF
|
||||
#
|
||||
# Profiling interface
|
||||
#
|
||||
test_header="${srcdir}/ompi/mpiext/$component/f77/profile/defines.h"
|
||||
AC_MSG_CHECKING([if MPI Extension $component has F77 bindings for profiling])
|
||||
if test -e "$test_header" ; then
|
||||
AC_MSG_RESULT([yes])
|
||||
|
||||
# Save the list of headers and convenience libraries that this component will output
|
||||
$3="mpiext/${component}/f77/profile/libext_pmpiext_f77_${component}.la $$3"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
|
||||
cat >> $mpif_ext_h <<EOF
|
||||
!
|
||||
! Enabled Extension: $component
|
||||
! No F77 Bindings available
|
||||
! No mpif.h bindings available
|
||||
!
|
||||
integer $component_define
|
||||
parameter ($component_define=0)
|
||||
|
||||
EOF
|
||||
|
||||
fi
|
||||
|
||||
###############
|
||||
# F90 Bindings
|
||||
# "use mpi" bindings
|
||||
###############
|
||||
#
|
||||
# Test if this extension has f90 bindings
|
||||
# Test if this extension has "use mpi" bindings
|
||||
# If not, skip this step.
|
||||
#
|
||||
test_header="${srcdir}/ompi/mpiext/$component/mpiext_${component}_f90.h"
|
||||
test_header="${srcdir}/ompi/mpiext/$component/use-mpi/mpiext_${component}_usempi.h"
|
||||
|
||||
AC_MSG_CHECKING([if MPI Extension $component has F90 bindings])
|
||||
AC_MSG_CHECKING([if MPI Extension $component has "use mpi" bindings])
|
||||
|
||||
if test -e "$test_header" ; then
|
||||
AC_MSG_RESULT([yes])
|
||||
|
||||
EXT_F90_HEADERS="$EXT_F90_HEADERS mpiext/$component/mpiext_${component}_f90.h"
|
||||
#EXT_F90_LIBS="$EXT_F90_LIBS mpiext/$component/libext_mpiext_${component}_f90.la"
|
||||
#$3="$$3 mpiext/${component}/libext_mpiext_${component}_f90.la"
|
||||
# JMS Where is this needed?
|
||||
EXT_USEMPI_HEADERS="$EXT_USEMPI_HEADERS mpiext/$component/use-mpi/mpiext_${component}_usempi.h"
|
||||
$5="$$5 $component"
|
||||
component_header="mpiext_${component}_usempi.h"
|
||||
|
||||
component_header="mpiext_${component}_f90.h"
|
||||
|
||||
cat >> $mpif90_ext_h <<EOF
|
||||
cat >> $mpiusempi_ext_h <<EOF
|
||||
!
|
||||
! Enabled Extension: $component
|
||||
!
|
||||
EOF
|
||||
#
|
||||
# Include the f77 header if it is available
|
||||
# Cannot do this from inside the f90.h since, for VPATH builds,
|
||||
# the top_ompi_srcdir is needed to find the header.
|
||||
# Include the mpif.h header if it is available. Cannot do
|
||||
# this from inside the usempi.h since, for VPATH builds, the
|
||||
# top_ompi_srcdir is needed to find the header.
|
||||
#
|
||||
if test "$enabled_f77" = 1; then
|
||||
f77_component_header="mpiext_${component}_f77.h"
|
||||
cat >> $mpif90_ext_h <<EOF
|
||||
include '$top_ompi_srcdir/ompi/mpiext/$component/$f77_component_header'
|
||||
if test "$enabled_mpifh" = 1; then
|
||||
mpifh_component_header="mpiext_${component}_mpifh.h"
|
||||
cat >> $mpiusempi_ext_h <<EOF
|
||||
include '$top_ompi_srcdir/ompi/mpiext/$component/mpif-h/$mpifh_component_header'
|
||||
EOF
|
||||
fi
|
||||
|
||||
cat >> $mpif90_ext_h <<EOF
|
||||
include '$top_ompi_srcdir/ompi/mpiext/$component/$component_header'
|
||||
cat >> $mpiusempi_ext_h <<EOF
|
||||
include '$top_ompi_srcdir/ompi/mpiext/$component/use-mpi/$component_header'
|
||||
|
||||
EOF
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
|
||||
cat >> $mpif90_ext_h <<EOF
|
||||
cat >> $mpiusempi_ext_h <<EOF
|
||||
!
|
||||
! Enabled Extension: $component
|
||||
! No F90 Bindings available
|
||||
! No "use mpi" bindings available
|
||||
!
|
||||
|
||||
EOF
|
||||
fi
|
||||
|
||||
###############
|
||||
# "use mpi_f08" bindings
|
||||
###############
|
||||
#
|
||||
# Test if this extension has "use mpi_f08" bindings
|
||||
# If not, skip this step.
|
||||
#
|
||||
test_header="${srcdir}/ompi/mpiext/$component/use-mpi-f08/mpiext_${component}_usempif08.h"
|
||||
|
||||
# Add this subdir to the mast list of all EXT component subdirs
|
||||
AC_MSG_CHECKING([if MPI Extension $component has "use mpi_f08" bindings])
|
||||
|
||||
if test -e "$test_header" ; then
|
||||
AC_MSG_RESULT([yes])
|
||||
|
||||
# JMS Where is this needed?
|
||||
EXT_USEMPIF08_HEADERS="$EXT_USEMPIF08_HEADERS mpiext/$component/use-mpi-f08/mpiext_${component}_usempif08.h"
|
||||
$6="$$6 $component"
|
||||
|
||||
component_header="mpiext_${component}_usempif08.h"
|
||||
|
||||
cat >> $mpiusempif08_ext_h <<EOF
|
||||
!
|
||||
! Enabled Extension: $component
|
||||
!
|
||||
EOF
|
||||
#
|
||||
# Include the mpif.h header if it is available. Cannot do
|
||||
# this from inside the usempif08.h since, for VPATH builds,
|
||||
# the top_ompi_srcdir is needed to find the header.
|
||||
#
|
||||
if test "$enabled_mpifh" = 1; then
|
||||
mpifh_component_header="mpiext_${component}_mpifh.h"
|
||||
cat >> $mpiusempif08_ext_h <<EOF
|
||||
include '$top_ompi_srcdir/ompi/mpiext/$component/mpif-h/$mpifh_component_header'
|
||||
EOF
|
||||
fi
|
||||
|
||||
cat >> $mpiusempif08_ext_h <<EOF
|
||||
include '$top_ompi_srcdir/ompi/mpiext/$component/use-mpi-f08/$component_header'
|
||||
|
||||
EOF
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
|
||||
cat >> $mpiusempif08_ext_h <<EOF
|
||||
!
|
||||
! Enabled Extension: $component
|
||||
! No "use mpi_f08" bindings available
|
||||
!
|
||||
|
||||
EOF
|
||||
fi
|
||||
|
||||
# Add this component name to the master list of all EXT component
|
||||
# subdirs
|
||||
$2="$$2 ${component}"
|
||||
|
||||
m4_ifdef([OMPI_MPIEXT_]$1[_NEED_INIT],
|
||||
@ -526,13 +662,19 @@ EOF
|
||||
# to make sure the user isn't doing something stupid.
|
||||
#
|
||||
# USAGE:
|
||||
# EXT_PROCESS_DEAD_COMPONENT(component_name)
|
||||
# EXT_PROCESS_DEAD_COMPONENT((1) component_name,
|
||||
# (2) all_components_variable)
|
||||
#
|
||||
# NOTE: component_name may not be determined until runtime....
|
||||
# NOTE: component_name will not be determined until run time.
|
||||
#
|
||||
######################################################################
|
||||
AC_DEFUN([EXT_PROCESS_DEAD_COMPONENT],[
|
||||
AC_MSG_CHECKING([if MPI Extension $1 can compile])
|
||||
|
||||
# Need to add this component to the "all" list so that it is
|
||||
# included in DIST SUBDIRS
|
||||
$2="$$2 $1"
|
||||
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
|
||||
@ -603,6 +745,8 @@ AC_DEFUN([EXT_COMPONENT_BUILD_CHECK],[
|
||||
|
||||
|
||||
# OMPI_EXT_MAKE_DIR_LIST(subst'ed variable, shell list)
|
||||
#
|
||||
# Prefix every extension name with "mpiext/" and AC subst it.
|
||||
# -------------------------------------------------------------------------
|
||||
AC_DEFUN([OMPI_EXT_MAKE_DIR_LIST],[
|
||||
$1=
|
||||
@ -611,3 +755,28 @@ AC_DEFUN([OMPI_EXT_MAKE_DIR_LIST],[
|
||||
done
|
||||
AC_SUBST($1)
|
||||
])
|
||||
|
||||
# OMPI_EXT_MAKE_LISTS((1) subst'ed variable prefix,
|
||||
# (2) shell list,
|
||||
# (3) bindings dir name,
|
||||
# (4) bindings suffix)
|
||||
#
|
||||
# Prefix every extension name with "mpiext/".
|
||||
# -------------------------------------------------------------------------
|
||||
AC_DEFUN([OMPI_EXT_MAKE_LISTS],[
|
||||
# Make the directory list
|
||||
tmp=
|
||||
for item in $2 ; do
|
||||
tmp="$tmp mpiext/$item/$3"
|
||||
done
|
||||
$1_DIRS=$tmp
|
||||
AC_SUBST($1_DIRS)
|
||||
|
||||
# Make the list of libraries
|
||||
tmp=
|
||||
for item in $2 ; do
|
||||
tmp="$tmp "'$(top_builddir)'"/ompi/mpiext/$item/$3/libmpiext_${item}_$4.la"
|
||||
done
|
||||
$1_LIBS=$tmp
|
||||
AC_SUBST($1_LIBS)
|
||||
])
|
||||
|
@ -2,7 +2,7 @@ dnl -*- shell-script -*-
|
||||
dnl
|
||||
dnl Copyright (c) 2006 Los Alamos National Security, LLC. All rights
|
||||
dnl reserved.
|
||||
dnl Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
dnl Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
|
||||
dnl $COPYRIGHT$
|
||||
dnl
|
||||
dnl Additional copyrights may follow
|
||||
@ -21,12 +21,8 @@ AC_DEFUN([OMPI_LANG_LINK_WITH_C], [
|
||||
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])],
|
||||
[m4_define([ompi_lang_link_with_c_fortran], 1)
|
||||
OMPI_FORTRAN_MAKE_C_FUNCTION([testfunc_name], [testfunc])],
|
||||
[testfunc_name="testfunc"])
|
||||
|
||||
# Write out C part
|
||||
|
@ -10,7 +10,7 @@
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
# All rights reserved.
|
||||
# Copyright (c) 2006-2011 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
|
||||
# Copyright (c) 2006-2008 Sun Microsystems, Inc. All rights reserved.
|
||||
# Copyright (c) 2006-2011 Los Alamos National Security, LLC. All rights
|
||||
# reserved.
|
||||
@ -121,8 +121,9 @@ OPAL_SAVE_VERSION([OPAL], [Open Portable Access Layer], [$srcdir/VERSION],
|
||||
m4_ifdef([project_ompi],
|
||||
[AC_SUBST(libmpi_so_version)
|
||||
AC_SUBST(libmpi_cxx_so_version)
|
||||
AC_SUBST(libmpi_f77_so_version)
|
||||
AC_SUBST(libmpi_f90_so_version)
|
||||
AC_SUBST(libmpi_mpifh_so_version)
|
||||
AC_SUBST(libmpi_usempi_tkr_so_version)
|
||||
AC_SUBST(libmpi_usempi_ignore_tkr_so_version)
|
||||
AC_SUBST(libmpi_java_so_version)
|
||||
# It's icky that we have to hard-code the names of the
|
||||
# common components here. :-( This could probably be done
|
||||
@ -347,6 +348,7 @@ AC_CHECK_TYPES(__float128)
|
||||
AC_CHECK_TYPES(long double)
|
||||
# We only need these types if we're building the OMPI project, but
|
||||
# OPAL currently doesn't protect for their lack of presence well.
|
||||
AC_CHECK_HEADERS(complex.h)
|
||||
AC_CHECK_TYPES(float _Complex)
|
||||
AC_CHECK_TYPES(double _Complex)
|
||||
AC_CHECK_TYPES(long double _Complex)
|
||||
@ -927,7 +929,6 @@ LIBS="$LIBS $THREAD_LIBS"
|
||||
WRAPPER_EXTRA_CFLAGS="$WRAPPER_EXTRA_CFLAGS $THREAD_CFLAGS"
|
||||
m4_ifdef([project_ompi],
|
||||
[WRAPPER_EXTRA_CXXFLAGS="$WRAPPER_EXTRA_CXXFLAGS $THREAD_CXXFLAGS"
|
||||
WRAPPER_EXTRA_FFLAGS="$WRAPPER_EXTRA_FFLAGS $THREAD_FFLAGS"
|
||||
WRAPPER_EXTRA_FCFLAGS="$WRAPPER_EXTRA_FCFLAGS $THREAD_FFLAGS"])
|
||||
WRAPPER_EXTRA_LDFLAGS="$WRAPPER_EXTRA_LDFLAGS $THREAD_LDFLAGS"
|
||||
# no need to update WRAPPER_EXTRA_LIBS - we'll get it from LT later
|
||||
|
@ -10,6 +10,7 @@
|
||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
# All rights reserved.
|
||||
# Copyright (c) 2006-2007 Sun Microsystems, Inc. All rights reserved.
|
||||
# Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
|
||||
# Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
@ -25,8 +26,7 @@
|
||||
CC = mpicc
|
||||
CXX = mpic++
|
||||
CCC = mpic++
|
||||
F90 = mpif90
|
||||
F77 = mpif77
|
||||
FC = mpifort
|
||||
JAVAC = mpijavac
|
||||
|
||||
# Using -g is not necessary, but it is helpful for example programs,
|
||||
@ -37,13 +37,24 @@ JAVAC = mpijavac
|
||||
CFLAGS = -g
|
||||
CXXFLAGS = -g
|
||||
CCFLAGS = -g
|
||||
F77FLAGS = -g
|
||||
F90FLAGS = -g
|
||||
FCFLAGS = -g
|
||||
|
||||
# Example programs to build
|
||||
|
||||
EXAMPLES = hello_c hello_cxx hello_f77 hello_f90 Hello.class \
|
||||
ring_c ring_cxx ring_f77 ring_f90 connectivity_c Ring.class
|
||||
EXAMPLES = \
|
||||
hello_c \
|
||||
hello_cxx \
|
||||
hello_mpifh \
|
||||
hello_usempi \
|
||||
hello_usempif08 \
|
||||
Hello.class \
|
||||
ring_c \
|
||||
ring_cxx \
|
||||
ring_mpifh \
|
||||
ring_usempi \
|
||||
ring_usempif08 \
|
||||
Ring.class \
|
||||
connectivity_c
|
||||
|
||||
# Default target. Always build the C example. Only build the others
|
||||
# if Open MPI was build with the relevant language bindings.
|
||||
@ -52,41 +63,42 @@ all: hello_c ring_c connectivity_c
|
||||
@ if ompi_info --parsable | grep bindings:cxx:yes >/dev/null; then \
|
||||
$(MAKE) hello_cxx ring_cxx; \
|
||||
fi
|
||||
@ if ompi_info --parsable | grep bindings:f77:yes >/dev/null; then \
|
||||
$(MAKE) hello_f77 ring_f77; \
|
||||
@ if ompi_info --parsable | grep bindings:mpif.h:yes >/dev/null; then \
|
||||
$(MAKE) hello_mpifh ring_mpifh; \
|
||||
fi
|
||||
@ if ompi_info --parsable | grep bindings:f90:yes >/dev/null; then \
|
||||
$(MAKE) hello_f90 ring_f90; \
|
||||
@ if ompi_info --parsable | grep bindings:use_mpi:yes >/dev/null; then \
|
||||
$(MAKE) hello_usempi ring_usempi; \
|
||||
fi
|
||||
@ if ompi_info --parsable | grep bindings:use_mpi_f08:yes >/dev/null; then \
|
||||
$(MAKE) hello_usempif08 ring_usempif08; \
|
||||
fi
|
||||
@ if ompi_info --parsable | grep bindings:java:yes >/dev/null; then \
|
||||
$(MAKE) Hello.class; \
|
||||
$(MAKE) Hello.class Ring.class; \
|
||||
fi
|
||||
@ if ompi_info --parsable | grep bindings:java:yes >/dev/null; then \
|
||||
$(MAKE) Ring.class; \
|
||||
fi
|
||||
|
||||
|
||||
# The usual "clean" target
|
||||
|
||||
clean:
|
||||
rm -f $(EXAMPLES) *~ *.o
|
||||
|
||||
# Don't rely on default rules for the fortran and Java examples
|
||||
# Don't rely on default rules for the Fortran and Java examples
|
||||
|
||||
hello_f77: hello_f77.f
|
||||
$(F77) $(F77FLAGS) $^ -o $@
|
||||
ring_f77: ring_f77.f
|
||||
$(F77) $(F77FLAGS) $^ -o $@
|
||||
hello_mpifh: hello_mpifh.f
|
||||
$(FC) $(FCFLAGS) $^ -o $@
|
||||
ring_mpifh: ring_mpifh.f
|
||||
$(FC) $(FCFLAGS) $^ -o $@
|
||||
|
||||
hello_f90: hello_f90.f90
|
||||
$(F90) $(F90FLAGS) $^ -o $@
|
||||
ring_f90: ring_f90.f90
|
||||
$(F90) $(F90FLAGS) $^ -o $@
|
||||
hello_usempi: hello_usempi.f90
|
||||
$(FC) $(FCFLAGS) $^ -o $@
|
||||
ring_usempi: ring_usempi.f90
|
||||
$(FC) $(FCFLAGS) $^ -o $@
|
||||
|
||||
hello_usempif08: hello_usempif08.f90
|
||||
$(FC) $(FCFLAGS) $^ -o $@
|
||||
ring_usempif08: ring_usempif08.f90
|
||||
$(FC) $(FCFLAGS) $^ -o $@
|
||||
|
||||
Hello.class: Hello.java
|
||||
$(JAVAC) Hello.java
|
||||
|
||||
Ring.class: Ring.java
|
||||
$(JAVAC) Ring.java
|
||||
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
# All rights reserved.
|
||||
# Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
|
||||
# Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
|
||||
# Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
# Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
@ -34,12 +34,14 @@ EXTRA_DIST += \
|
||||
examples/Makefile \
|
||||
examples/hello_c.c \
|
||||
examples/hello_cxx.cc \
|
||||
examples/hello_f77.f \
|
||||
examples/hello_f90.f90 \
|
||||
examples/hello_mpifh.f \
|
||||
examples/hello_usempi.f90 \
|
||||
examples/hello_usempif08.f90 \
|
||||
examples/ring_c.c \
|
||||
examples/ring_cxx.cc \
|
||||
examples/ring_f77.f \
|
||||
examples/ring_f90.f90 \
|
||||
examples/ring_mpifh.f \
|
||||
examples/ring_usempi.f90 \
|
||||
examples/ring_usempif08.f90 \
|
||||
examples/connectivity_c.c \
|
||||
examples/Hello.java \
|
||||
examples/Ring.java
|
||||
|
@ -1,10 +1,12 @@
|
||||
Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
||||
University Research and Technology
|
||||
Corporation. All rights reserved.
|
||||
Copyright (c) 2006-2011 Cisco Systems, Inc. All rights reserved.
|
||||
Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
|
||||
Copyright (c) 2007-2009 Sun Microsystems, Inc. All rights reserved.
|
||||
Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
$COPYRIGHT$
|
||||
|
||||
The files in this directory are sample MPI applications provided both
|
||||
as a trivial primer to MPI as well as simple tests to ensure that your
|
||||
Open MPI installation is working properly.
|
||||
@ -17,36 +19,44 @@ not enough. Excellent MPI tutorials are available here:
|
||||
Get a free account and login; you can then browse to the list of
|
||||
available courses. Look for the ones with "MPI" in the title.
|
||||
|
||||
There are 2 MPI examples in this directory, each in five languages:
|
||||
There are two MPI examples in this directory, each using one of six
|
||||
different MPI interfaces:
|
||||
|
||||
- Hello world
|
||||
C: hello_c.c
|
||||
C++: hello_cxx.cc
|
||||
F77: hello_f77.f
|
||||
F90: hello_f90.f90
|
||||
Java: Hello.java
|
||||
C: hello_c.c
|
||||
C++: hello_cxx.cc
|
||||
Fortran mpif.h: hello_mpifh.f
|
||||
Fortran use mpi: hello_usempi.f90
|
||||
Fortran use mpi_f08: hello_usempif08.f90
|
||||
Java: Hello.java
|
||||
|
||||
- Send a trivial message around in a ring
|
||||
C: ring_c.c
|
||||
C++: ring_cxx.cc
|
||||
F77: ring_f77.f
|
||||
F90: ring_f90.f90
|
||||
Java: Ring.java
|
||||
C: ring_c.c
|
||||
C++: ring_cxx.cc
|
||||
Fortran mpif.h: ring_mpifh.f
|
||||
Fortran use mpi: ring_usempi.f90
|
||||
Fortran use mpi_f08: ring_usempif08.f90
|
||||
Java: Ring.java
|
||||
|
||||
Additionally, there's one further example application, but this one
|
||||
only uses the MPI C bindings:
|
||||
|
||||
- Test the connectivity between all processes
|
||||
C: connectivity_c.c
|
||||
|
||||
The Makefile in this directory will build as many of the examples as
|
||||
you have language support (e.g., if you do not have F90 bindings
|
||||
compiled as part of Open MPI, the F90 examples will be skipped).
|
||||
you have language support (e.g., if you do not have the Fortran "use
|
||||
mpi" bindings compiled as part of Open MPI, the those examples will be
|
||||
skipped).
|
||||
|
||||
The Makefile assumes that the wrapper compilers mpicc, mpic++, mpif77,
|
||||
and mpif90 are in your path.
|
||||
The Makefile assumes that the wrapper compilers mpicc, mpic++, and
|
||||
mpifort are in your path.
|
||||
|
||||
Although the Makefile is tailored for Open MPI (e.g., it checks the
|
||||
"ompi_info" command to see if you have support for C++, F77, and F90),
|
||||
all of the example programs are pure MPI, and therefore not specific
|
||||
to Open MPI. Hence, you can use a different MPI implementation to
|
||||
compile and run these programs if you wish.
|
||||
"ompi_info" command to see if you have support for C++, mpif.h, use
|
||||
mpi, and use mpi_f08 F90), all of the example programs are pure MPI,
|
||||
and therefore not specific to Open MPI. Hence, you can use a
|
||||
different MPI implementation to compile and run these programs if you
|
||||
wish.
|
||||
|
||||
Make today an Open MPI day!
|
||||
|