1
1

The reference implementation of Portals (which runs over TCP on Linux) is

only static libraries.  Previously, we were linking the libraries into 
directly into the common, btl, and mtl code.  This seemed to work fine
for me on my Opteron Fedora box, but caused Lisa some issues (PtlNIInit
would succeed, but the network handle would fail when used with
PtlEQAlloc).

Instead, link the portals libraries directly into libmpi and not at
all into the common, btl, or mtl components.  THen use some linker
tricks to force the linker to bring in the public interface for the
reference implementation (which thankfully is pretty small).

This commit was SVN r15902.
Этот коммит содержится в:
Brian Barrett 2007-08-17 03:56:49 +00:00
родитель c9e3654a85
Коммит 3b98b5f0a1
2 изменённых файлов: 47 добавлений и 4 удалений

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

@ -105,19 +105,25 @@ AC_DEFUN([OMPI_CHECK_PORTALS],[
fi
# check for portals
LIBS="$LIBS $btl_portals_LIBS"
LIBS="$LIBS $check_portals_LIBS"
AC_CHECK_HEADERS([${check_portals_header_prefix}portals3.h],
[AC_MSG_CHECKING([if possible to link Portals application])
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <${check_portals_header_prefix}portals3.h>],
[int i; PtlInit(&i);])],
[AC_MSG_RESULT([yes])
$1_WRAPPER_EXTRA_LDFLAGS="$btl_portals_LDFLAGS"
$1_WRAPPER_EXTRA_LIBS="$btl_portals_LIBS"
ompi_check_portals_happy="yes"],
[AC_MSG_RESULT([no])
ompi_check_portals_happy="yes"])],
ompi_check_portals_happy="no"])],
[ompi_check_portals_happy="no"])
# Deal with static-only Portals UTCP libs. See note in
# ompi/mca/common/portals/configure.m4. Then possibly cry.
if test "$with_portals_config" = "utcp" ; then
if test "$1" != "common_portals" ; then
check_portals_LIBS=
fi
fi
# reset the flags for the next test
CPPFLAGS="$check_portals_save_CPPFLAGS"
LDFLAGS="$check_portals_save_LDFLAGS"

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

@ -26,6 +26,43 @@ AC_DEFUN([MCA_common_portals_CONFIG],[
[common_portals_happy="yes"],
[common_portals_happy="no"])
if test "$common_portals_happy" = "yes" -a "$with_portals_config" = "utcp" ; then
# Portals interface
symbols="PtlInit PtlFini PtlNIInit"
symbols="$symbols PtlNIFini PtlNIStatus PtlNIDist PtlNIHandle"
symbols="$symbols PtlGetUid PtlGetId PtlGetJid "
symbols="$symbols PtlMEAttach PtlMEAttachAny PtlMEInsert PtlMEUnlink"
symbols="$symbols PtlMDAttach PtlMDBind PtlMDUnlink PtlMDUpdate"
symbols="$symbols PtlEQAlloc PtlEQFree PtlEQGet PtlEQWait"
symbols="$symbols PtlEQPoll PtlACEntry"
symbols="$symbols PtlPut PtlPutRegion PtlGet PtlGetRegon PtlGetPut"
# Portals reference implementation debugging stuff
symbols="$symbols PtlMEDump PtlNIEqDump PtlTblDump PtlNIDebug"
symbols="$symbols PtlErrorStr PtlEventKindStr PtlNIFailStr"
# Portals reference implementation RTE interface
symbols="$symbols PtlGetNIDMap PtlGetPIDMap PtlGetRank PtlGetRankId"
symbols="$symbols PtlSetJID PtlSetNIDMap PtlSetPIDMap PtlSetRank"
flags=
for symbol in $symbols ; do
case $host in
*-darwin*)
flags="$flags -Wl,-u,=_$symbol"
;;
*-linux*)
flags="$flags -Wl,-undefined=$symbol"
;;
esac
done
OMPI_LIBMPI_EXTRA_LDFLAGS="$common_portals_LDFLAGS $flags"
OMPI_LIBMPI_EXTRA_LIBS="$common_portals_LIBS"
commmon_portals_LIBS=
fi
AS_IF([test "$common_portals_happy" = "yes"],
[common_portals_WRAPPER_EXTRA_LDFLAGS="$common_portals_LDFLAGS"
common_portals_WRAPPER_EXTRA_LIBS="$common_portals_LIBS"