diff --git a/configure b/configure index 5362b8d5f..90c7cdaca 100755 --- a/configure +++ b/configure @@ -16880,8 +16880,9 @@ fi fi MPILDF=`"$MPI_CC" --showme:link` MPICF=`"$MPI_CC" --showme:compile` - LIBS="$LIBS $MPILDF" - PKG_MPI="library/mpi" + MPILIBDIRS=`"$MPI_CC" --showme:libdirs` + LIBS+=" $MPILDF" + PKG_MPI="library/lammpi library/mpi" OLD_CC=${CC} CC=${MPI_CC} for ac_header in mpi.h @@ -16896,6 +16897,11 @@ fi done + case "$target_os" in + *linux*) + for dir in "$MPILIBDIRS"; do LIBS+=" -Wl,-rpath=$dir"; done + ;; + esac CC=${OLD_CC} if test "$yap_cv_mpe" != "no" then @@ -16949,7 +16955,7 @@ fi if test "$ac_cv_lib_mpe_MPE_Init_log" = yes then - MPI_1LIBS="-lmpe" + LIBS="-lmpe" MPI_OBJS="$MPI_OBJS mpe.o" fi for ac_header in mpe.h @@ -16977,6 +16983,7 @@ fi + mkdir -p library/lammpi diff --git a/library/lammpi/configure.in b/library/lammpi/configure.in index 621a27e3b..a5b11c674 100644 --- a/library/lammpi/configure.in +++ b/library/lammpi/configure.in @@ -42,11 +42,17 @@ if test "$yap_cv_mpi" != "no" -a "$INSTALL_DLLS" != "no"; then fi MPILDF=`"$MPI_CC" --showme:link` MPICF=`"$MPI_CC" --showme:compile` - LIBS="$LIBS $MPILDF" - PKG_MPI="library/mpi" + MPILIBDIRS=`"$MPI_CC" --showme:libdirs` + LIBS+=" $MPILDF" + PKG_MPI="library/lammpi library/mpi" OLD_CC=${CC} CC=${MPI_CC} AC_CHECK_HEADERS(mpi.h) + case "$target_os" in + *linux*) + for dir in "$MPILIBDIRS"; do LIBS+=" -Wl,-rpath=$dir"; done + ;; + esac CC=${OLD_CC} if test "$yap_cv_mpe" != "no" then @@ -57,7 +63,7 @@ if test "$yap_cv_mpi" != "no" -a "$INSTALL_DLLS" != "no"; then [AC_DEFINE(HAVE_LIBMPE, 0, [MPI Debugging off])]) if test "$ac_cv_lib_mpe_MPE_Init_log" = yes then - MPI_1LIBS="-lmpe" + LIBS="-lmpe" MPI_OBJS="$MPI_OBJS mpe.o" fi AC_CHECK_HEADERS(mpe.h) @@ -69,6 +75,7 @@ else fi + AC_SUBST(PKG_MPI) AC_SUBST(YAPMPILIB) AC_SUBST(MPILDF)