1
1

* Change Myrinet/gm btl and mpool to use configure.m4 instead of

configure.stub

This commit was SVN r6608.
Этот коммит содержится в:
Brian Barrett 2005-07-26 21:56:36 +00:00
родитель 169d9a33fb
Коммит 9a83910165
14 изменённых файлов: 249 добавлений и 532 удалений

Просмотреть файл

@ -53,6 +53,7 @@ sinclude(config/ompi_case_sensitive_fs_setup.m4)
sinclude(config/ompi_check_broken_qsort.m4)
sinclude(config/ompi_check_optflags.m4)
sinclude(config/ompi_check_icc.m4)
sinclude(config/ompi_check_gm.m4)
sinclude(config/ompi_check_bproc.m4)
sinclude(config/ompi_check_mvapi.m4)
sinclude(config/ompi_check_package.m4)

150
config/ompi_check_gm.m4 Обычный файл
Просмотреть файл

@ -0,0 +1,150 @@
# -*- 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$
#
AC_DEFUN([_OMPI_CHECK_GM_CONFIG],[
u_OMPI_CHECK_GM_CONFIG_SAVE_CPPFLAGS="$CPPFLAGS"
u_OMPI_CHECK_GM_CONFIG_SAVE_LDFLAGS="$LDFLAGS"
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_btl_gm_broken=0 gm_build_broken=no ],
[ mca_btl_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_btl_gm_broken,
[The GM build has or not a broker gm_get function] )
unset gm_build_broken mca_btl_gm_broken
AC_DEFINE_UNQUOTED( [OMPI_MCA_]m4_translit([$1], [a-z], [A-Z])[_SUPPORT_REGISTERING], 0,
[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-btl-gm=GM_DIR],
[Additional directory to search for GM installation])])
AC_ARG_WITH([gm-libdir],
[AC_HELP_STRING([--with-btl-gm-libdir=IBLIBDIR],
[directory where the IB library can be found, if it is not in GM_DIR/lib or GM_DIR/lib64])])
AS_IF([test ! -z "$with_btl_gm" -a "$with_btl_gm" != "yes"],
[ompi_check_gm_dir="$with_btl_gm"])
AS_IF([test ! -z "$with_btl_gm_libdir" -a "$with_btl_gm_libdir" != "yes"],
[ompi_check_gm_libdir="$with_btl_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"])
AS_IF([test "$ompi_check_gm_happy" = "yes"],
[_OMPI_CHECK_GM_CONFIG($1)
$2],
[AS_IF([test ! -z "$with_btl_gm" -a "$with_btl_gm" != "no"],
[AC_MSG_ERROR([GM support requested but not found. Aborting])])
$3])
])

Просмотреть файл

@ -18,7 +18,9 @@
include $(top_ompi_srcdir)/config/Makefile.options
sources = \
AM_CPPFLAGS = $(btl_gm_CPPFLAGS)
gm_sources = \
btl_gm.c \
btl_gm.h \
btl_gm_component.c \
@ -29,28 +31,26 @@ sources = \
btl_gm_proc.c \
btl_gm_proc.h \
btl_gm_error.h
# Make the output library in this directory, and name it either
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
# (for static builds).
if OMPI_BUILD_btl_gm_DSO
lib =
lib_sources =
component = mca_btl_gm.la
component_sources = $(sources)
component_noinst =
component_install = mca_btl_gm.la
else
lib = libmca_btl_gm.la
lib_sources = $(sources)
component =
component_sources =
component_noinst = libmca_btl_gm.la
component_install =
endif
mcacomponentdir = $(libdir)/openmpi
mcacomponent_LTLIBRARIES = $(component)
mca_btl_gm_la_SOURCES = $(component_sources)
mca_btl_gm_la_LDFLAGS = -module -avoid-version
mcacomponent_LTLIBRARIES = $(component_install)
mca_btl_gm_la_SOURCES = $(gm_sources)
mca_btl_gm_la_LIBADD = $(btl_gm_LIBS)
mca_btl_gm_la_LDFLAGS = -module -avoid-version $(btl_gm_LDFLAGS)
noinst_LTLIBRARIES = $(lib)
libmca_btl_gm_la_SOURCES = $(lib_sources)
libmca_btl_gm_la_LDFLAGS = -module -avoid-version
noinst_LTLIBRARIES = $(component_noinst)
libmca_btl_gm_la_SOURCES = $(gm_sources)
libmca_btl_gm_la_LIBADD = $(btl_gm_LIBS)
libmca_btl_gm_la_LDFLAGS = -module -avoid-version $(btl_gm_LDFLAGS)

Просмотреть файл

@ -15,7 +15,6 @@
*/
#include "ompi_config.h"
#include "gm_config.h"
#include <string.h>
#include "opal/util/output.h"
#include "opal/util/if.h"

Просмотреть файл

@ -16,7 +16,6 @@
#include "ompi_config.h"
#include "gm_config.h"
#include "include/constants.h"
#include "opal/event/event.h"
#include "opal/util/if.h"

38
ompi/mca/btl/gm/configure.m4 Обычный файл
Просмотреть файл

@ -0,0 +1,38 @@
# -*- 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$
#
# MCA_btl_gm_CONFIG([action-if-can-compile],
# [action-if-cant-compile])
# ------------------------------------------------
AC_DEFUN([MCA_btl_gm_CONFIG],[
OMPI_CHECK_GM([btl_gm],
[btl_gm_happy="yes"],
[btl_gm_happy="no"])
AS_IF([test "$btl_gm_happy" = "yes"],
[btl_gm_WRAPPER_EXTRA_LDFLAGS="$btl_gm_LDFLAGS"
btl_gm_WRAPPER_EXTRA_LIBS="$btl_gm_LIBS"
$1],
[$2])
# substitute in the things needed to build gm
AC_SUBST([btl_gm_CFLAGS])
AC_SUBST([btl_gm_CPPFLAGS])
AC_SUBST([btl_gm_LDFLAGS])
AC_SUBST([btl_gm_LIBS])
])dnl

Просмотреть файл

@ -18,5 +18,4 @@
# Specific to this module
PARAM_INIT_FILE=btl_gm.c
PARAM_CONFIG_HEADER_FILE="gm_config.h"
PARAM_CONFIG_FILES="Makefile"

Просмотреть файл

@ -1,196 +0,0 @@
# -*- 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 The Ohio State University.
# 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],[
# Additional --with flags that can be specified
AC_ARG_WITH(btl-gm,
AC_HELP_STRING([--with-btl-gm=DIR],
[Specify the installation directory of GM]))
AC_ARG_WITH(btl-gm-libdir,
AC_HELP_STRING([--with-btl-gm-libdir=DIR],
[directory where the GM library can be found, if it is not in \$GMDIR/lib or \$GMDIR/binary/lib]))
AC_ARG_ENABLE(gm-ptl-cache,
AC_HELP_STRING([--enable-gm-ptl-cache],[Enable/disable the internal registered memory cache (default=no)]),
[enable_gm_cache=$(enable_gm_ptl_cache)],
[enable_gm_cache="no"])
if test "$enable_gm_cache" = "yes"; then
AC_DEFINE_UNQUOTED( OMPI_MCA_BTL_GM_CACHE_ENABLE, 1,
[Enable GM BTL internal cache for registered memory])
else
AC_DEFINE_UNQUOTED( OMPI_MCA_BTL_GM_CACHE_ENABLE, 0,
[Disable GM BTL internal cache for registered memory])
fi
AM_CONDITIONAL( OMPI_ENABLE_GM_CACHE, test "$enable_gm_cache" = "yes" )
# Add to CPPFLAGS if necessary
EXTRA_CPPFLAGS=
if test -n "$with_btl_gm"; then
if test -d "$with_btl_gm/include"; then
EXTRA_CPPFLAGS="-I$with_btl_gm/include"
else
AC_MSG_WARN([*** Warning: cannot find $with_btl_gm/include])
AC_MSG_WARN([*** Will still try to configure gm ptl anyway...])
fi
fi
# See if we can find gm.h
CPPFLAGS="$CPPFLAGS $EXTRA_CPPFLAGS"
AC_CHECK_HEADERS(gm.h,,
AC_MSG_ERROR([*** Cannot find working gm.h.]))
# Add to LDFLAGS if necessary
EXTRA_LDFLAGS=
if test -n "$with_btl_gm_libdir"; then
if test -d "$with_btl_gm_libdir"; then
EXTRA_LDFLAGS="-L$with_btl_gm_libdir"
else
AC_MSG_WARN([*** Warning: cannot find $with_btl_gm_libdir])
AC_MSG_WARN([*** Will still try to configure gm ptl anyway...])
fi
elif test -n "$with_btl_gm"; then
if test -d "$with_btl_gm/lib"; then
EXTRA_LDFLAGS="-L$with_btl_gm/lib"
elif test -d "$with_btl_gm/binary/lib"; then
EXTRA_LDFLAGS="-L$with_btl_gm/binary/lib"
else
AC_MSG_WARN([*** Warning: cannot find $with_btl_gm/lib])
AC_MSG_WARN([*** or $with_btl_gm/binary/lib])
AC_MSG_WARN([*** Will still try to configure gm ptl anyway...])
fi
fi
# Try to find libgm
LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
AC_CHECK_LIB([gm], [main], [],
AC_MSG_ERROR([*** Cannot find libgm]))
#
# 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_BTL_GM_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_BTL_GM_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_BTL_GM_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_btl_gm_broken=0 gm_build_broken=no ],
[ mca_btl_gm_broken=1 gm_build_broken=yes ])
AC_MSG_RESULT( [$gm_build_broken] )
AC_DEFINE_UNQUOTED( OMPI_MCA_BTL_GM_GET_BROKEN, $mca_btl_gm_broken,
[The GM build has or not a broker gm_get function] )
unset gm_build_broken mca_btl_gm_broken
AC_DEFINE_UNQUOTED( OMPI_MCA_BTL_GM_SUPPORT_REGISTERING, 1,
[The OS support or not the virtal page registration] )
#
# Save extra compiler/linker flags so that they can be added in
# the wrapper compilers, if necessary
#
WRAPPER_EXTRA_LDFLAGS="$EXTRA_LDFLAGS"
WRAPPER_EXTRA_LIBS="-lgm"
])dnl
#
# For dist
#
AC_DEFUN([MCA_CONFIGURE_DIST_STUB],[
AM_CONDITIONAL( OMPI_ENABLE_GM_CACHE, test "yes" = "yes" )
])

Просмотреть файл

@ -1,114 +0,0 @@
/* gm_config.h. Generated by configure. */
/* gm_config.h.in. Generated from configure.ac by autoheader. */
/* -*- 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 btl: gm component
*/
#ifndef MCA_btl_gm_CONFIG_H
#define MCA_btl_gm_CONFIG_H
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Define to 1 if you have the <gm.h> header file. */
#define HAVE_GM_H 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the `gm' library (-lgm). */
#define HAVE_LIBGM 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Whether the gm btl is the default btl or not */
#define MCA_btl_gm_DEFAULT 0
/* OMPI architecture string */
#define OMPI_ARCH "i686-pc-linux-gnu"
/* OMPI underlying C compiler */
#define OMPI_CC "gcc"
/* Version of the GM API to use */
#define OMPI_MCA_BTL_GM_API_VERSION GM_API_VERSION
/* Disable GM BTL internal cache for registered memory */
#define OMPI_MCA_BTL_GM_CACHE_ENABLE 0
/* The GM build has or not a broker gm_get function */
#define OMPI_MCA_BTL_GM_GET_BROKEN 0
/* Whether we have get_get() or not */
#define OMPI_MCA_BTL_GM_HAVE_RDMA_GET 1
/* Whether we have gm_put() or gm_directed_send_with_callback() */
#define OMPI_MCA_BTL_GM_HAVE_RDMA_PUT 1
/* The OS support or not the virtal page registration */
#define OMPI_MCA_BTL_GM_SUPPORT_REGISTERING 1
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""
/* Define to the full name of this package. */
#define PACKAGE_NAME ""
/* Define to the full name and version of this package. */
#define PACKAGE_STRING ""
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME ""
/* Define to the version of this package. */
#define PACKAGE_VERSION ""
/* Define to 1 if you have the ANSI C header files. */
/* #undef STDC_HEADERS */
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
#endif /* _MCA_btl_gm_CONFIG_H */

Просмотреть файл

@ -18,6 +18,8 @@
include $(top_ompi_srcdir)/config/Makefile.options
AM_CPPFLAGS = $(mpool_gm_CPPFLAGS)
sources = \
mpool_gm.h \
mpool_gm_module.c \
@ -37,14 +39,13 @@ endif
# See src/mca/ptl/gm/Makefile.am for an explanation of
# libmca_common_gm.la.
mcacomponentdir = $(libdir)/openmpi
mcacomponent_LTLIBRARIES = $(component_install)
mca_mpool_gm_la_SOURCES = $(sources)
mca_mpool_gm_la_LDFLAGS = -module -avoid-version
mca_mpool_gm_la_LIBADD = $(mpool_gm_LIBS)
mca_mpool_gm_la_LDFLAGS = -module -avoid-version $(mpool_gm_LDFLAGS)
noinst_LTLIBRARIES = $(component_noinst)
libmca_mpool_gm_la_SOURCES = $(sources)
libmca_mpool_gm_la_LDFLAGS = -module -avoid-version
libmca_mpool_gm_la_LIBADD = $(mpool_gm_LIBS)
libmca_mpool_gm_la_LDFLAGS = -module -avoid-version $(mpool_gm_LDFLAGS)

38
ompi/mca/mpool/gm/configure.m4 Обычный файл
Просмотреть файл

@ -0,0 +1,38 @@
# -*- 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$
#
# MCA_mpool_gm_CONFIG([action-if-can-compile],
# [action-if-cant-compile])
# ------------------------------------------------
AC_DEFUN([MCA_mpool_gm_CONFIG],[
OMPI_CHECK_GM([mpool_gm],
[mpool_gm_happy="yes"],
[mpool_gm_happy="no"])
AS_IF([test "$mpool_gm_happy" = "yes"],
[mpool_gm_WRAPPER_EXTRA_LDFLAGS="$mpool_gm_LDFLAGS"
mpool_gm_WRAPPER_EXTRA_LIBS="$mpool_gm_LIBS"
$1],
[$2])
# substitute in the things needed to build gm
AC_SUBST([mpool_gm_CFLAGS])
AC_SUBST([mpool_gm_CPPFLAGS])
AC_SUBST([mpool_gm_LDFLAGS])
AC_SUBST([mpool_gm_LIBS])
])dnl

Просмотреть файл

@ -18,7 +18,6 @@
# Specific to this module
PARAM_INIT_FILE=mpool_gm_module.c
PARAM_CONFIG_HEADER_FILE="gm_config.h"
PARAM_CONFIG_FILES="Makefile"

Просмотреть файл

@ -1,196 +0,0 @@
# -*- 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 The Ohio State University.
# 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],[
# Additional --with flags that can be specified
AC_ARG_WITH(btl-gm,
AC_HELP_STRING([--with-btl-gm=DIR],
[Specify the installation directory of GM]))
AC_ARG_WITH(btl-gm-libdir,
AC_HELP_STRING([--with-btl-gm-libdir=DIR],
[directory where the GM library can be found, if it is not in \$GMDIR/lib or \$GMDIR/binary/lib]))
AC_ARG_ENABLE(gm-btl-cache,
AC_HELP_STRING([--enable-gm-btl-cache],[Enable/disable the internal registered memory cache (default=no)]),
[enable_gm_cache=$(enable_gm_btl_cache)],
[enable_gm_cache="no"])
if test "$enable_gm_cache" = "yes"; then
AC_DEFINE_UNQUOTED( OMPI_MCA_MPOOL_GM_CACHE_ENABLE, 1,
[Enable GM MPOOL internal cache for registered memory])
else
AC_DEFINE_UNQUOTED( OMPI_MCA_MPOOL_GM_CACHE_ENABLE, 0,
[Disable GM MPOOL internal cache for registered memory])
fi
AM_CONDITIONAL( OMPI_ENABLE_GM_CACHE, test "$enable_gm_cache" = "yes" )
# Add to CPPFLAGS if necessary
EXTRA_CPPFLAGS=
if test -n "$with_btl_gm"; then
if test -d "$with_btl_gm/include"; then
EXTRA_CPPFLAGS="-I$with_btl_gm/include"
else
AC_MSG_WARN([*** Warning: cannot find $with_btl_gm/include])
AC_MSG_WARN([*** Will still try to configure gm btl anyway...])
fi
fi
# See if we can find gm.h
CPPFLAGS="$CPPFLAGS $EXTRA_CPPFLAGS"
AC_CHECK_HEADERS(gm.h,,
AC_MSG_ERROR([*** Cannot find working gm.h.]))
# Add to LDFLAGS if necessary
EXTRA_LDFLAGS=
if test -n "$with_btl_gm_libdir"; then
if test -d "$with_btl_gm_libdir"; then
EXTRA_LDFLAGS="-L$with_btl_gm_libdir"
else
AC_MSG_WARN([*** Warning: cannot find $with_btl_gm_libdir])
AC_MSG_WARN([*** Will still try to configure gm btl anyway...])
fi
elif test -n "$with_btl_gm"; then
if test -d "$with_btl_gm/lib"; then
EXTRA_LDFLAGS="-L$with_btl_gm/lib"
elif test -d "$with_btl_gm/binary/lib"; then
EXTRA_LDFLAGS="-L$with_btl_gm/binary/lib"
else
AC_MSG_WARN([*** Warning: cannot find $with_btl_gm/lib])
AC_MSG_WARN([*** or $with_btl_gm/binary/lib])
AC_MSG_WARN([*** Will still try to configure gm btl anyway...])
fi
fi
# Try to find libgm
LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
AC_CHECK_LIB([gm], [main], [],
AC_MSG_ERROR([*** Cannot find libgm]))
#
# 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_MPOOL_GM_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_MPOOL_GM_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_MPOOL_GM_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_btl_gm_broken=0 gm_build_broken=no ],
[ mca_btl_gm_broken=1 gm_build_broken=yes ])
AC_MSG_RESULT( [$gm_build_broken] )
AC_DEFINE_UNQUOTED( OMPI_MCA_MPOOL_GM_GET_BROKEN, $mca_btl_gm_broken,
[The GM build has or not a broker gm_get function] )
unset gm_build_broken mca_btl_gm_broken
AC_DEFINE_UNQUOTED( OMPI_MCA_MPOOL_GM_SUPPORT_REGISTERING, 1,
[The OS support or not the virtal page registration] )
#
# Save extra compiler/linker flags so that they can be added in
# the wrapper compilers, if necessary
#
WRAPPER_EXTRA_LDFLAGS="$EXTRA_LDFLAGS"
WRAPPER_EXTRA_LIBS="-lgm"
])dnl
#
# For dist
#
AC_DEFUN([MCA_CONFIGURE_DIST_STUB],[
AM_CONDITIONAL( OMPI_ENABLE_GM_CACHE, test "yes" = "yes" )
])

Просмотреть файл

@ -15,7 +15,6 @@
*/
#include "ompi_config.h"
#include "gm_config.h"
#include <string.h>
#include "opal/util/output.h"
#include "mpool_gm.h"