2004-01-12 00:35:37 +03:00
# -*- shell-script -*-
#
2004-11-22 04:38:40 +03:00
# 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.
2004-11-28 23:09:25 +03:00
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
2005-03-24 15:43:37 +03:00
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
2004-11-22 04:38:40 +03:00
# $COPYRIGHT$
#
# Additional copyrights may follow
#
2004-01-12 00:35:37 +03:00
# $HEADER$
#
############################################################################
Major simplifications to component versioning:
- After long discussions and ruminations on how we run components in
LAM/MPI, made the decision that, by default, all components included
in Open MPI will use the version number of their parent project
(i.e., OMPI or ORTE). They are certaint free to use a different
number, but this simplification makes the common cases easy:
- components are only released when the parent project is released
- it is easy (trivial?) to distinguish which version component goes
with with version of the parent project
- removed all autogen/configure code for templating the version .h
file in components
- made all ORTE components use ORTE_*_VERSION for version numbers
- made all OMPI components use OMPI_*_VERSION for version numbers
- removed all VERSION files from components
- configure now displays OPAL, ORTE, and OMPI version numbers
- ditto for ompi_info
- right now, faking it -- OPAL and ORTE and OMPI will always have the
same version number (i.e., they all come from the same top-level
VERSION file). But this paves the way for the Great Configure
Reorganization, where, among other things, each project will have
its own version number.
So all in all, we went from a boatload of version numbers to
[effectively] three. That's pretty good. :-)
This commit was SVN r6344.
2005-07-05 00:12:36 +04:00
# Initialization and other random setup/init stuff
2004-01-12 00:35:37 +03:00
############################################################################
# Init autoconf
AC_INIT(@PARAM_INIT_FILE@)
AC_PREREQ(2.57)
AC_CONFIG_AUX_DIR(@PARAM_CONFIG_AUX_DIR@)
#
# Start it up
#
2004-06-07 19:33:53 +04:00
OMPI_CONFIGURE_SETUP
Major simplifications to component versioning:
- After long discussions and ruminations on how we run components in
LAM/MPI, made the decision that, by default, all components included
in Open MPI will use the version number of their parent project
(i.e., OMPI or ORTE). They are certaint free to use a different
number, but this simplification makes the common cases easy:
- components are only released when the parent project is released
- it is easy (trivial?) to distinguish which version component goes
with with version of the parent project
- removed all autogen/configure code for templating the version .h
file in components
- made all ORTE components use ORTE_*_VERSION for version numbers
- made all OMPI components use OMPI_*_VERSION for version numbers
- removed all VERSION files from components
- configure now displays OPAL, ORTE, and OMPI version numbers
- ditto for ompi_info
- right now, faking it -- OPAL and ORTE and OMPI will always have the
same version number (i.e., they all come from the same top-level
VERSION file). But this paves the way for the Great Configure
Reorganization, where, among other things, each project will have
its own version number.
So all in all, we went from a boatload of version numbers to
[effectively] three. That's pretty good. :-)
This commit was SVN r6344.
2005-07-05 00:12:36 +04:00
ompi_show_title "Configuring MCA @MCA_TYPE@ @MCA_COMPONENT_NAME@ component"
2004-06-07 19:33:53 +04:00
ompi_show_subtitle "Initialization, setup"
2004-01-12 00:35:37 +03:00
#
# Init automake
# The third argument to AM_INIT_AUTOMAKE surpresses the PACKAGE and
Major simplifications to component versioning:
- After long discussions and ruminations on how we run components in
LAM/MPI, made the decision that, by default, all components included
in Open MPI will use the version number of their parent project
(i.e., OMPI or ORTE). They are certaint free to use a different
number, but this simplification makes the common cases easy:
- components are only released when the parent project is released
- it is easy (trivial?) to distinguish which version component goes
with with version of the parent project
- removed all autogen/configure code for templating the version .h
file in components
- made all ORTE components use ORTE_*_VERSION for version numbers
- made all OMPI components use OMPI_*_VERSION for version numbers
- removed all VERSION files from components
- configure now displays OPAL, ORTE, and OMPI version numbers
- ditto for ompi_info
- right now, faking it -- OPAL and ORTE and OMPI will always have the
same version number (i.e., they all come from the same top-level
VERSION file). But this paves the way for the Great Configure
Reorganization, where, among other things, each project will have
its own version number.
So all in all, we went from a boatload of version numbers to
[effectively] three. That's pretty good. :-)
This commit was SVN r6344.
2005-07-05 00:12:36 +04:00
# VERSION macros
2004-01-12 00:35:37 +03:00
#
Major simplifications to component versioning:
- After long discussions and ruminations on how we run components in
LAM/MPI, made the decision that, by default, all components included
in Open MPI will use the version number of their parent project
(i.e., OMPI or ORTE). They are certaint free to use a different
number, but this simplification makes the common cases easy:
- components are only released when the parent project is released
- it is easy (trivial?) to distinguish which version component goes
with with version of the parent project
- removed all autogen/configure code for templating the version .h
file in components
- made all ORTE components use ORTE_*_VERSION for version numbers
- made all OMPI components use OMPI_*_VERSION for version numbers
- removed all VERSION files from components
- configure now displays OPAL, ORTE, and OMPI version numbers
- ditto for ompi_info
- right now, faking it -- OPAL and ORTE and OMPI will always have the
same version number (i.e., they all come from the same top-level
VERSION file). But this paves the way for the Great Configure
Reorganization, where, among other things, each project will have
its own version number.
So all in all, we went from a boatload of version numbers to
[effectively] three. That's pretty good. :-)
This commit was SVN r6344.
2005-07-05 00:12:36 +04:00
AM_INIT_AUTOMAKE(@PARAM_AM_NAME@, irrelevant-version-number, 'no')
2004-01-12 00:35:37 +03:00
2004-08-23 10:45:48 +04:00
#
# GNU C and autotools are inconsistent about whether this is defined
# so let's make it true everywhere for now...
#
AC_GNU_SOURCE
2004-08-02 04:24:22 +04:00
# Setup the top-level MCA component config.h file
2004-01-12 00:35:37 +03:00
AH_TOP([/* -*- c -*-
*
2004-11-22 04:38:40 +03:00
* 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.
2004-11-28 23:09:25 +03:00
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
2005-03-24 15:43:37 +03:00
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
2004-11-22 04:38:40 +03:00
* $COPYRIGHT$
*
* Additional copyrights may follow
*
2004-01-12 00:35:37 +03:00
* $HEADER$
*
2004-07-07 16:45:36 +04:00
* Open MPI configuation header file.
2004-08-02 04:24:22 +04:00
* MCA @MCA_TYPE@: @MCA_COMPONENT_NAME@ component
2004-01-12 00:35:37 +03:00
*/
#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
#
2004-06-07 19:33:53 +04:00
OMPI_BASIC_SETUP
2004-01-12 00:35:37 +03:00
#
# Check to see if the user wants this @MCA_TYPE@ to be the default
#
2004-08-02 04:24:22 +04:00
AC_MSG_CHECKING([if want the @MCA_COMPONENT_NAME@ @MCA_TYPE@ to be the default])
2004-01-12 00:35:37 +03:00
want_default=0
result=no
AC_ARG_WITH(@PROCESSED_MCA_TYPE@,
AC_HELP_STRING([--with-@PROCESSED_MCA_TYPE@=name],
2004-08-02 04:24:22 +04:00
[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
2004-01-12 00:35:37 +03:00
want_default=1
result=yes
fi
AC_DEFINE_UNQUOTED(@PARAM_VAR_PREFIX@_DEFAULT, $want_default,
2004-08-02 04:24:22 +04:00
[Whether the @MCA_COMPONENT_NAME@ @MCA_TYPE@ is the default @PROCESSED_MCA_TYPE@ or not])
2004-01-12 00:35:37 +03:00
AC_MSG_RESULT([$result])
#
2004-07-07 16:45:36 +04:00
# Part one of libtool magic
2004-01-12 00:35:37 +03:00
#
2004-07-07 16:45:36 +04:00
AM_ENABLE_SHARED
AM_DISABLE_STATIC
#
2004-08-02 04:24:22 +04:00
# Find which components should be built as run-time loadable components
2004-07-07 16:45:36 +04:00
# Acceptable combinations:
#
# [default -- no option given]
# --enable-mca-dso
# --enable-mca-dso=[.+,]*COMPONENT_TYPE[.+,]*
# --enable-mca-dso=[.+,]*COMPONENT_TYPE-COMPONENT_NAME[.+,]*
# --disable-mca-dso
2004-01-12 00:35:37 +03:00
#
2004-07-07 16:45:36 +04:00
AC_MSG_CHECKING([if want component to be a DSO])
AC_ARG_ENABLE(mca-dso,
AC_HELP_STRING([--enable-mca-dso=LIST],
2004-10-10 03:29:11 +04:00
[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).]))
2004-01-12 00:35:37 +03:00
# Manual conversion of $kind to its generic name (e.g., crmpi->cr,
2004-06-07 19:33:53 +04:00
# crompi->cr).
2004-01-12 00:35:37 +03:00
case "@MCA_TYPE@" in
crmpi)
generic_type="cr"
;;
2004-06-07 19:33:53 +04:00
crompi)
2004-01-12 00:35:37 +03:00
generic_type="cr"
;;
*)
generic_type="@MCA_TYPE@"
;;
esac
2004-08-02 04:24:22 +04:00
BUILD_@MCA_TYPE@_@MCA_COMPONENT_NAME@_DSO=0
2004-01-12 00:35:37 +03:00
msg=no
2004-07-07 16:45:36 +04:00
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
2004-08-02 04:24:22 +04:00
BUILD_@MCA_TYPE@_@MCA_COMPONENT_NAME@_DSO=1
2004-01-12 00:35:37 +03:00
msg=yes
2004-07-07 16:45:36 +04:00
else
2004-01-12 00:35:37 +03:00
ifs_save="$IFS"
IFS="${IFS}$PATH_SEPARATOR,"
2004-07-07 16:45:36 +04:00
for item in $enable_mca_dso; do
2004-08-02 04:24:22 +04:00
if test "$item" = "@MCA_TYPE@-@MCA_COMPONENT_NAME@" -o \
2004-07-07 16:45:36 +04:00
"$item" = "@MCA_TYPE@" -o "$item" = "$generic_type"; then
2004-08-02 04:24:22 +04:00
BUILD_@MCA_TYPE@_@MCA_COMPONENT_NAME@_DSO=1
2004-01-12 00:35:37 +03:00
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@
2004-07-07 16:45:36 +04:00
##################################
# 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)/../../../..'
2005-07-09 01:05:18 +04:00
INCFLAGS='-I$(top_ompi_srcdir)/include -I$(top_ompi_builddir)/include -I$(top_ompi_srcdir) -I$(top_ompi_builddir) -I$(top_ompi_srcdir)/opal -I$(top_ompi_builddir)/opal -I$(top_ompi_srcdir)/orte -I$(top_ompi_builddir)/orte -I$(top_ompi_srcdir)/ompi -I$(top_ompi_builddir)/ompi'" $CPPFLAGS"
2004-07-07 16:45:36 +04:00
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
2004-10-12 18:21:35 +04:00
top_ompi_srcdir=""
2004-07-07 16:45:36 +04:00
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
2004-10-12 18:21:35 +04:00
if test -d $with_opemnpi ; then
if test -d "$with_openmpi/include/openmpi" -a \
2005-01-26 08:07:18 +03:00
-f "$with_openmpi/include/openmpi/include/ompi_socket_errno.h"; then
2004-10-12 18:21:35 +04:00
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 \
2005-01-26 08:07:18 +03:00
-f "$with_openmpi/openmpi/include/ompi_socket_errno.h"; then
2004-10-12 18:21:35 +04:00
INCFLAGS="-I$with_openmpi/openmpi I$with_openmpi/openmpi"
2004-07-07 16:45:36 +04:00
found_ompi_headers=1
AC_MSG_RESULT([$with_openmpi/openmpi])
2005-01-26 08:07:18 +03:00
elif test -f "$with_openmpi/include/ompi_socket_errno.h"; then
2004-10-12 18:21:35 +04:00
INCFLAGS="-I$with_openmpi -I$with_openmpi/.."
2004-07-07 16:45:36 +04:00
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
2005-01-26 08:07:18 +03:00
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[#include "include/ompi_socket_errno.h"]],
2004-07-07 16:45:36 +04:00
[[]]),
[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)
2004-01-12 00:35:37 +03:00
##################################
2004-08-02 04:24:22 +04:00
# @MCA_TYPE@ @MCA_COMPONENT_NAME@ component specific setup
2004-01-12 00:35:37 +03:00
##################################
2004-07-08 17:08:44 +04:00
#
# 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.
#
2004-07-07 16:45:36 +04:00
2004-06-07 19:33:53 +04:00
if test "$OMPI_WANT_DIST" = "no"; then
2004-07-07 16:45:36 +04:00
OMPI_LOG_MSG([Running configure stub macro])
2004-01-12 00:35:37 +03:00
@CONFIGURE_STUB_MACRO@
else
2004-07-07 16:45:36 +04:00
OMPI_LOG_MSG([Running configure dist stub macro])
2004-01-12 00:35:37 +03:00
@CONFIGURE_DIST_STUB_MACRO@
fi
2004-07-08 17:08:44 +04:00
#
# 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
2004-01-12 00:35:37 +03:00
#
2004-07-07 16:45:36 +04:00
# We delayed doing it until now just so that long include paths don't
# show up in any of the configure output -- purely aesthetic.
2004-01-12 00:35:37 +03:00
#
2004-07-07 16:45:36 +04:00
CPPFLAGS="$CPPFLAGS $INCFLAGS"
CXXCPPFLAGS="$CXXCPPFLAGS $INCFLAGS"
2004-06-15 05:23:05 +04:00
2004-01-12 00:35:37 +03:00
#
# Delayed the substitution of these until now because they may have
# been modified throughout the course of this script.
#
AC_SUBST(CPPFLAGS)
2004-07-07 16:45:36 +04:00
AC_SUBST(CXXCPPFLAGS)
2004-01-12 00:35:37 +03:00
############################################################################
# libtool magic
############################################################################
2004-06-07 19:33:53 +04:00
ompi_show_subtitle "GNU libtool setup"
2004-01-12 00:35:37 +03:00
AM_PROG_LIBTOOL
2004-08-02 04:24:22 +04:00
AM_CONDITIONAL(OMPI_BUILD_@MCA_TYPE@_@MCA_COMPONENT_NAME@_DSO,
test "$BUILD_@MCA_TYPE@_@MCA_COMPONENT_NAME@_DSO" = "1")
2004-01-12 00:35:37 +03:00
############################################################################
# Party on
############################################################################
2004-06-07 19:33:53 +04:00
ompi_show_subtitle "Final output"
2004-01-12 00:35:37 +03:00
AM_CONFIG_HEADER([@PARAM_CONFIG_HEADER_FILE@])
AC_CONFIG_FILES([@PARAM_CONFIG_FILES@])
AC_OUTPUT