1
1
openmpi/orte/mca/pls/bproc/configure.stub

117 строки
2.9 KiB
Plaintext
Исходник Обычный вид История

# -*- shell-script -*-
#
# 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$
#
#
# Main function. This will be invoked in the middle of the templated
# configure script.
#
AC_DEFUN([MCA_CONFIGURE_STUB],[
#
# Make a best effort to see if we are on a BPROC system. Also allow
# user to specify location to the bproc prefix, which will work just as
# well :).
#
OMPI_HAVE_BPROC=0
BPROC_LDFLAGS=""
#
AC_ARG_WITH(bproc,
AC_HELP_STRING([--with-bproc=DIR],
[directory where the bproc software was installed]))
#
# Case 1: --without-bproc specified - overrides autodetect
#
if test "$with_bproc" = "no"; then
OMPI_HAVE_BPROC=0
#
# Case 2: --with-bproc specified - look in generic places for bproc libs
#
elif test "$with_bproc" = "yes"; then
# See if we can find the bproc libraries...
LIBS_save="$LIBS"
AC_CHECK_LIB(bproc, bproc_numnodes,
OMPI_HAVE_BPROC=1,
AC_MSG_ERROR([*** Connot find working libbproc.]))
LIBS="$LIBS_save"
#
# Case 3: nothing specified - if it is there, go with it. If not, don't :)
#
elif test -z "$with_bproc"; then
LIBS_save="$LIBS"
AC_CHECK_LIB(bproc, bproc_numnodes, OMPI_HAVE_BPROC=1)
LIBS="$LIBS_save"
#
# Case 4: --with-bproc=<foo> specified - try where they said to find it
#
else
BPROC_DIR=$with_bproc
if test -n "$BPROC_DIR"; then
# Make the tests work...
OLDLDFLAGS="$LDFLAGS"
OLDCPPFLAGS="$CPPFLAGS"
BPROC_LDFLAGS="-L$BPROC_DIR/lib"
LDFLAGS="$LDFLAGS $BPROC_LDFLAGS"
CPPFLAGS="$CPPFLAGS -I$BPROC_DIR/include"
LIBS_save="$LIBS"
AC_CHECK_LIB(bproc, bproc_numnodes, OMPI_HAVE_BPROC=1,
AC_MSG_ERROR([*** Cannot find working libbproc.]))
# Since we are going to add the -L and -l to LIBOMPI_EXTRA_LIBS,
# we reset this to the start ...
LDFLAGS="$OLDLDFLAGS"
CPPFLAGS="$OLDCPPFLAGS"
LIBS="$LIBS_save"
else
AC_CHECK_LIB(bproc, bproc_numnodes, OMPI_HAVE_BPROC=1,
AC_MSG_ERROR([*** Cannot find working libbproc.]))
fi
fi
AC_MSG_CHECKING([if want BPROC support])
if test "$OMPI_HAVE_BPROC" = "1"; then
AC_MSG_RESULT([yes])
#
# Ok, we have bproc support. Add proper things to the various
# compiler flags..
#
WRAPPER_EXTRAN_LDFLAGS="$BPROC_LDFLAGS"
WRAPPER_EXTRA_LIBS="-lbproc"
LIBS="-lbproc"
else
AC_MSG_RESULT([no])
AC_MSG_ERROR([*** Connot find working libbproc.])
LAM_HAVE_BPROC3_API=0
fi
AC_DEFINE_UNQUOTED(OMPI_HAVE_BPROC, $OMPI_HAVE_BPROC,
[Whether we have bproc support or not])
# Clean up
unset BPROC_LDFLAGS
])dnl