diff --git a/src/mca/ptl/elan/configure.stub b/src/mca/ptl/elan/configure.stub index ae165a8df8..5bf5c92770 100644 --- a/src/mca/ptl/elan/configure.stub +++ b/src/mca/ptl/elan/configure.stub @@ -10,9 +10,8 @@ AC_DEFUN([MCA_CONFIGURE_STUB],[ # Look for a bunch of libraries; abort if we don't have them - - PTL_ELAN_LIBS= - pairs="rmscall:rms_getcap elan:elan_init elan4:elan4_init elan3:elan3_create elanctrl:elanctrl_open" + PTL_ELAN_LIBS="$LIBS" + pairs="rmscall:rms_getcap elan:elan_init elan4:elan4_init" for pair in $pairs; do lib="`echo $pair | cut -d: -f1`" func="`echo $pair | cut -d: -f2`" @@ -25,6 +24,23 @@ AC_DEFUN([MCA_CONFIGURE_STUB],[ PTL_ELAN_LIBS="$PTL_ELAN_LIBS -l$lib" done + AC_CHECK_LIB([elan3], [elan3_create], + [ompi_elan_have_libelan3=yes], + [ompi_elan_nolibelan3=1]) + + AC_CHECK_LIB([elanctrl], [elanctrl_open], + [ompi_elan_have_libelanctrl=yes], + [ompi_elan_nolibelanctrl=1]) + + if test "$ompi_elan_have_libelan3" = "yes"; then + PTL_ELAN_LIBS="$PTL_ELAN_LIBS -lelan3" + elif test "$ompi_elan_have_libelanctrl" = "yes"; then + PTL_ELAN_LIBS="$PTL_ELAN_LIBS -lelanctrl" + else + AC_MSG_WARN([*** Cannot find libelan3 or libelanctrl ]) + AC_MSG_ERROR([Cannot continue]) + fi + # Some versions of AC seem to automatically append LIBS with the # result of a successful AC_CHECK_LIB. So ensure to override this # here. @@ -36,11 +52,14 @@ AC_DEFUN([MCA_CONFIGURE_STUB],[ AC_ARG_WITH(ptl_elan_qsnet2libsrc, AC_HELP_STRING([--with-ptl-elan-qsnet2libsrc], [provide the path to qsnet2lib source])) - dir="$with_ptl_elan_qsnet2libsrc" - if test -z "$dir"; then + QSNET2SRC="$with_ptl_elan_qsnet2libsrc" + if test -z "$QSNET2SRC"; then AC_MSG_WARN([*** Need path to qsnet2 library source; please use --with-ptl-elan-qs2netlibsrc=/path/to/qsnet2/source]) AC_MSG_ERROR([Cannot continue]) else - CPPFLAGS="-I${dir}/include -I${dir}/elan4lib/include -I${dir}/elan4lib/elan4 -I${dir}/elan4lib/common" + CPPFLAGS="-I${QSNET2SRC}/include -I${QSNET2SRC}/elan4lib/include -I${QSNET2SRC}/elan4lib/elan4 -I${QSNET2SRC}/elan4lib/common" fi + + AC_SUBST(QSNET2SRC) + ])dnl