diff --git a/ChangeLog b/ChangeLog index b1378dc..062c859 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ +2018-08-03: Ver. 0.3-8 + * Fedora28 use "module load mpi/openmpi-x86_64" to obtain mpiexec. + 2018-07-29: Ver. 0.3-7 * Add "pkg-config" to "configure.ac". - * Check "OpenMPI" and "MPICH2" with "pkg-config" + * Check "OpenMPI" and "MPICH2" with "pkg-config". 2018-05-18: Ver. 0.3-6 * Move "rlecuyer" to Imports. diff --git a/DESCRIPTION b/DESCRIPTION index c4cb78f..7ba2aea 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: pbdMPI -Version: 0.3-7 -Date: 2018-07-29 +Version: 0.3-8 +Date: 2018-08-03 Title: Programming with Big Data -- Interface to MPI Authors@R: c(person("Wei-Chen", "Chen", role = c("aut", "cre"), email = "wccsnow@gmail.com"), @@ -33,3 +33,14 @@ MailingList: Please send questions and comments regarding pbdR to RBigData@gmail.com NeedsCompilation: yes Maintainer: Wei-Chen Chen +Packaged: 2018-07-30 01:19:36 UTC; snoweye +Author: Wei-Chen Chen [aut, cre], + George Ostrouchov [aut], + Drew Schmidt [aut], + Pragneshkumar Patel [aut], + Hao Yu [aut], + Christian Heckendorf [ctb] (FreeBSD), + Brian Ripley [ctb] (Windows HPC Pack 2012), + R Core team [ctb] (some functions are modified from the base packages) +Repository: CRAN +Date/Publication: 2018-08-01 15:20:14 UTC diff --git a/README.md b/README.md index d1f52b2..dc6999a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # pbdMPI +* **Version:** 0.3-4 * **License:** [![License](http://img.shields.io/badge/license-MPL%202-orange.svg?style=flat)](https://www.mozilla.org/MPL/2.0/) * **Download:** [![Download](http://cranlogs.r-pkg.org/badges/pbdMPI)](https://cran.r-project.org/package=pbdMPI) * **Status:** [![Build Status](https://travis-ci.org/snoweye/pbdMPI.png)](https://travis-ci.org/snoweye/pbdMPI) [![Appveyor Build status](https://ci.appveyor.com/api/projects/status/32r7s2skrgm9ubva?svg=true)](https://ci.appveyor.com/project/snoweye/pbdMPI) diff --git a/configure b/configure index 307cbe0..21e66cd 100755 --- a/configure +++ b/configure @@ -673,7 +673,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -751,7 +750,6 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' @@ -1004,15 +1002,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1150,7 +1139,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1303,7 +1292,6 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -2377,53 +2365,17 @@ if test -z "${MPI_INCLUDE_PATH}" ; then TMP_INC="F" TMP_LIB="F" - if test -n "${PKG_CONFIG}" ; then - echo "found pkg-config ..." - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if pkg-config knows about OpenMPI" >&5 -$as_echo_n "checking if pkg-config knows about OpenMPI... " >&6; } - - if "${PKG_CONFIG}" --exists ompi; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - TMP_INC_DIRS=`"${PKG_CONFIG}" --cflags ompi` - echo ">> TMP_INC_DIRS = ${TMP_INC_DIRS}" - - TMP_LIB_DIRS=`"${PKG_CONFIG}" --libs ompi` - echo ">> TMP_LIB_DIRS = ${TMP_LIB_DIRS}" - - if test "${TMP_INC_DIRS}" != "" -a "${TMP_LIB_DIRS}" != "" ; then - TMP_INC=${TMP_INC_DIRS} - TMP_LIB=${TMP_LIB_DIRS} - fi - - if test "${TMP_INC}" != "F" -a "${TMP_LIB}" != "F" ; then - echo "found mpi.h and libmpi.so ..." - echo ">> TMP_INC = ${TMP_INC}" - echo ">> TMP_LIB = ${TMP_LIB}" - MPITYPE="OPENMPI" - MPI_INCLUDE_PATH="${TMP_INC}" - MPI_LIBPATH="${TMP_LIB}" - MPI_LIBNAME="" - MPI_ROOT="NONEED" - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - fi - - if test "$SED" != "F" -a "$MPICC" != "F" -a "$OMPI_INFO" != "F" -a "$TMP_INC" = "F" -a "$TMP_LIB" = "F" ; then - echo "found sed, mpicc, and ompi_info ..." + if test "$SED" != "F" -a "$MPICC" != "F" -a "$OMPI_INFO" != "F" ; then + echo "Try sed, mpicc, and ompi_info ..." TMP_INC_DIRS=`mpicc --showme:incdirs` echo ">> TMP_INC_DIRS = ${TMP_INC_DIRS}" TMP_IFS="${IFS}"; IFS=" " for dir in ${TMP_INC_DIRS}; do - echo "checking ${dir} ..." + echo "Checking ${dir} ..." if test -f "${dir}/mpi.h" ; then - echo "found ${dir}/mpi.h ..." + echo "Found ${dir}/mpi.h ..." TMP_INC=${dir} break fi @@ -2435,15 +2387,15 @@ $as_echo "no" >&6; } TMP_IFS="${IFS}"; IFS=" " for dir in ${TMP_LIB_DIRS}; do - echo "checking ${dir} ..." + echo "Checking ${dir} ..." if test -f "${dir}/libmpi.so" ; then - echo "found ${dir}/libmpi.so ..." + echo "Found ${dir}/libmpi.so ..." TMP_LIB=${dir} TMP_LIBNAME="libmpi.so" break fi if test -f "${dir}/libmpi.dylib" ; then - echo "found ${dir}/libmpi.dylib ..." + echo "Found ${dir}/libmpi.dylib ..." TMP_LIB=${dir} TMP_LIBNAME="libmpi.dylib" break @@ -2452,15 +2404,58 @@ $as_echo "no" >&6; } IFS="${TMP_IFS}" if test "${TMP_INC}" != "F" -a "${TMP_LIB}" != "F" ; then - echo "found mpi.h and libmpi.so ..." + echo "Found mpi.h and libmpi.so ... via mpicc --showme" echo ">> TMP_INC = ${TMP_INC}" echo ">> TMP_LIB = ${TMP_LIB}" MPITYPE="OPENMPI" MPI_INCLUDE_PATH="${TMP_INC}" MPI_LIBPATH="${TMP_LIB}" MPI_LIBNAME="${TMP_LIBNAME}" + else + echo "Found no mpi.h or libmpi.so ... via mpicc --showme" fi fi + + if test "$TMP_INC" = "F" -o "$TMP_LIB" = "F" ; then + if test -n "${PKG_CONFIG}" ; then + echo "Try pkg-config ..." + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if pkg-config knows about OpenMPI" >&5 +$as_echo_n "checking if pkg-config knows about OpenMPI... " >&6; } + + if "${PKG_CONFIG}" --exists ompi; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + + TMP_INC_DIRS=`"${PKG_CONFIG}" --cflags ompi` + echo ">> TMP_INC_DIRS = ${TMP_INC_DIRS}" + + TMP_LIB_DIRS=`"${PKG_CONFIG}" --libs ompi` + echo ">> TMP_LIB_DIRS = ${TMP_LIB_DIRS}" + + if test "${TMP_INC_DIRS}" != "" -a "${TMP_LIB_DIRS}" != "" ; then + TMP_INC=${TMP_INC_DIRS} + TMP_LIB=${TMP_LIB_DIRS} + fi + + if test "${TMP_INC}" != "F" -a "${TMP_LIB}" != "F" ; then + echo "Found mpi.h and libmpi.so ... via pkg-config" + echo ">> TMP_INC = ${TMP_INC}" + echo ">> TMP_LIB = ${TMP_LIB}" + MPITYPE="OPENMPI" + MPI_INCLUDE_PATH="${TMP_INC}" + MPI_LIBPATH="${TMP_LIB}" + MPI_LIBNAME="" + MPI_ROOT="NONEED" + else + echo "Found no mpi.h or libmpi.so ... via pkg-config" + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + fi + fi + fi fi @@ -2471,47 +2466,8 @@ if test -z "${MPI_INCLUDE_PATH}" ; then TMP_INC="F" TMP_LIB="F" - if test -n "${PKG_CONFIG}" ; then - echo "found pkg-config ..." - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if pkg-config knows about MPICH" >&5 -$as_echo_n "checking if pkg-config knows about MPICH... " >&6; } - - if "${PKG_CONFIG}" --exists mpich; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - TMP_INC_DIRS=`"${PKG_CONFIG}" --cflags mpich` - echo ">> TMP_INC_DIRS = ${TMP_INC_DIRS}" - - TMP_LIB_DIRS=`"${PKG_CONFIG}" --libs mpich` - echo ">> TMP_LIB_DIRS = ${TMP_LIB_DIRS}" - - TMP_LIB_PATH=`"${PKG_CONFIG}" --variable=libdir mpich` - echo ">> TMP_LIB_PATH = ${TMP_LIB_PATH}" - - if test "$TMP_INC_DIRS" != "" -a "$TMP_LIB_DIRS" != "" ; then - TMP_INC=${TMP_INC_DIRS} - TMP_LIB="-L${TMP_LIB_PATH} ${TMP_LIB_DIRS}" - fi - - if test "$TMP_INC" != "" -a "$TMP_LIB" != "" ; then - echo "found mpi.h and libmpich.so ..." - echo ">> TMP_INC = ${TMP_INC}" - echo ">> TMP_LIB = ${TMP_LIB}" - MPITYPE="MPICH2" - MPI_INCLUDE_PATH="${TMP_INC}" - MPI_LIBPATH="${TMP_LIB}" - MPI_LIBNAME="" - MPI_ROOT="NONEED" - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - fi - - if test "$SED" != "F" -a "$MPICC" != "F" -a "$TMP_INC" = "F" -a "$TMP_LIB" = "F" ; then - echo "found sed and mpicc ..." + if test "$SED" != "F" -a "$MPICC" != "F" ; then + echo "Try sed and mpicc ..." TMP_CMD=`mpicc -show` echo ">> TMP_CMD = ${TMP_CMD}" @@ -2524,9 +2480,9 @@ $as_echo "no" >&6; } dir_inc=`echo ${dir} | sed -e "s/-I\(.*\)/\1/"` fi - echo "checking ${dir_inc} ..." + echo "Checking ${dir_inc} ..." if test -f "${dir_inc}/mpi.h" ; then - echo "found ${dir_inc}/mpi.h ..." + echo "Found ${dir_inc}/mpi.h ..." TMP_INC=${dir_inc} break fi @@ -2541,15 +2497,15 @@ $as_echo "no" >&6; } dir_lib=`echo ${dir} | sed -e "s/-L\(.*\)/\1/"` fi - echo "checking ${dir_lib} ..." + echo "Checking ${dir_lib} ..." if test -f "${dir_lib}/libmpich.so" ; then - echo "found ${dir_lib}/libmpich.so ..." + echo "Found ${dir_lib}/libmpich.so ... via mpicc --show & sed" TMP_LIB=${dir_lib} TMP_LIBNAME="libmpich.so" break fi if test -f "${dir_lib}/libmpich.dylib" ; then - echo "found ${dir_lib}/libmpich.dylib ..." + echo "Found ${dir_lib}/libmpich.dylib ... via mpicc --show & sed" TMP_LIB=${dir_lib} TMP_LIBNAME="libmpich.dylib" break @@ -2558,15 +2514,61 @@ $as_echo "no" >&6; } IFS="${TMP_IFS}" if test "${TMP_INC}" != "F" -a "${TMP_LIB}" != "F" ; then - echo "found mpi.h and libmpich.so ..." + echo "Found mpi.h and libmpich.so ... via mpicc --show & sed" echo ">> TMP_INC = ${TMP_INC}" echo ">> TMP_LIB = ${TMP_LIB}" MPITYPE="${MPITYPE}" MPI_INCLUDE_PATH="${TMP_INC}" MPI_LIBPATH="${TMP_LIB}" MPI_LIBNAME="${TMP_LIBNAME}" + else + echo "Found no mpi.h or libmpi.so ... via mpicc --show & sed" fi fi + + if test "$TMP_INC" = "F" -o "$TMP_LIB" = "F" ; then + if test -n "${PKG_CONFIG}" ; then + echo "Try pkg-config ..." + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if pkg-config knows about MPICH" >&5 +$as_echo_n "checking if pkg-config knows about MPICH... " >&6; } + + if "${PKG_CONFIG}" --exists mpich; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + + TMP_INC_DIRS=`"${PKG_CONFIG}" --cflags mpich` + echo ">> TMP_INC_DIRS = ${TMP_INC_DIRS}" + + TMP_LIB_DIRS=`"${PKG_CONFIG}" --libs mpich` + echo ">> TMP_LIB_DIRS = ${TMP_LIB_DIRS}" + + TMP_LIB_PATH=`"${PKG_CONFIG}" --variable=libdir mpich` + echo ">> TMP_LIB_PATH = ${TMP_LIB_PATH}" + + if test "$TMP_INC_DIRS" != "" -a "$TMP_LIB_DIRS" != "" ; then + TMP_INC=${TMP_INC_DIRS} + TMP_LIB="-L${TMP_LIB_PATH} ${TMP_LIB_DIRS}" + fi + + if test "$TMP_INC" != "" -a "$TMP_LIB" != "" ; then + echo "Found mpi.h and libmpich.so ... via pkg-config" + echo ">> TMP_INC = ${TMP_INC}" + echo ">> TMP_LIB = ${TMP_LIB}" + MPITYPE="MPICH2" + MPI_INCLUDE_PATH="${TMP_INC}" + MPI_LIBPATH="${TMP_LIB}" + MPI_LIBNAME="" + MPI_ROOT="NONEED" + else + echo "Found no mpi.h or libmpi.so ... via pkg-config" + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + fi + fi + fi fi diff --git a/configure.ac b/configure.ac index f8835c5..5ed7131 100644 --- a/configure.ac +++ b/configure.ac @@ -114,50 +114,17 @@ if test -z "${MPI_INCLUDE_PATH}" ; then TMP_INC="F" TMP_LIB="F" - if test -n "${PKG_CONFIG}" ; then - echo "found pkg-config ..." - AC_MSG_CHECKING([if pkg-config knows about OpenMPI]) - - if "${PKG_CONFIG}" --exists ompi; then - AC_MSG_RESULT([yes]) - - TMP_INC_DIRS=`"${PKG_CONFIG}" --cflags ompi` - echo ">> TMP_INC_DIRS = ${TMP_INC_DIRS}" - - TMP_LIB_DIRS=`"${PKG_CONFIG}" --libs ompi` - echo ">> TMP_LIB_DIRS = ${TMP_LIB_DIRS}" - - if test "${TMP_INC_DIRS}" != "" -a "${TMP_LIB_DIRS}" != "" ; then - TMP_INC=${TMP_INC_DIRS} - TMP_LIB=${TMP_LIB_DIRS} - fi - - if test "${TMP_INC}" != "F" -a "${TMP_LIB}" != "F" ; then - echo "found mpi.h and libmpi.so ..." - echo ">> TMP_INC = ${TMP_INC}" - echo ">> TMP_LIB = ${TMP_LIB}" - MPITYPE="OPENMPI" - MPI_INCLUDE_PATH="${TMP_INC}" - MPI_LIBPATH="${TMP_LIB}" - MPI_LIBNAME="" - MPI_ROOT="NONEED" - fi - else - AC_MSG_RESULT([no]) - fi - fi - - if test "$SED" != "F" -a "$MPICC" != "F" -a "$OMPI_INFO" != "F" -a "$TMP_INC" = "F" -a "$TMP_LIB" = "F" ; then - echo "found sed, mpicc, and ompi_info ..." + if test "$SED" != "F" -a "$MPICC" != "F" -a "$OMPI_INFO" != "F" ; then + echo "Try sed, mpicc, and ompi_info ..." TMP_INC_DIRS=`mpicc --showme:incdirs` echo ">> TMP_INC_DIRS = ${TMP_INC_DIRS}" TMP_IFS="${IFS}"; IFS=" " for dir in ${TMP_INC_DIRS}; do - echo "checking ${dir} ..." + echo "Checking ${dir} ..." if test -f "${dir}/mpi.h" ; then - echo "found ${dir}/mpi.h ..." + echo "Found ${dir}/mpi.h ..." TMP_INC=${dir} break fi @@ -169,16 +136,16 @@ if test -z "${MPI_INCLUDE_PATH}" ; then TMP_IFS="${IFS}"; IFS=" " for dir in ${TMP_LIB_DIRS}; do - echo "checking ${dir} ..." + echo "Checking ${dir} ..." if test -f "${dir}/libmpi.so" ; then - echo "found ${dir}/libmpi.so ..." + echo "Found ${dir}/libmpi.so ..." TMP_LIB=${dir} TMP_LIBNAME="libmpi.so" break fi dnl For Mac OS X if test -f "${dir}/libmpi.dylib" ; then - echo "found ${dir}/libmpi.dylib ..." + echo "Found ${dir}/libmpi.dylib ..." TMP_LIB=${dir} TMP_LIBNAME="libmpi.dylib" break @@ -187,15 +154,56 @@ if test -z "${MPI_INCLUDE_PATH}" ; then IFS="${TMP_IFS}" if test "${TMP_INC}" != "F" -a "${TMP_LIB}" != "F" ; then - echo "found mpi.h and libmpi.so ..." + echo "Found mpi.h and libmpi.so ... via mpicc --showme" echo ">> TMP_INC = ${TMP_INC}" echo ">> TMP_LIB = ${TMP_LIB}" MPITYPE="OPENMPI" MPI_INCLUDE_PATH="${TMP_INC}" MPI_LIBPATH="${TMP_LIB}" MPI_LIBNAME="${TMP_LIBNAME}" + else + echo "Found no mpi.h or libmpi.so ... via mpicc --showme" fi fi + + if test "$TMP_INC" = "F" -o "$TMP_LIB" = "F" ; then + dnl try "pkg-config" + if test -n "${PKG_CONFIG}" ; then + echo "Try pkg-config ..." + AC_MSG_CHECKING([if pkg-config knows about OpenMPI]) + + if "${PKG_CONFIG}" --exists ompi; then + AC_MSG_RESULT([yes]) + + TMP_INC_DIRS=`"${PKG_CONFIG}" --cflags ompi` + echo ">> TMP_INC_DIRS = ${TMP_INC_DIRS}" + + TMP_LIB_DIRS=`"${PKG_CONFIG}" --libs ompi` + echo ">> TMP_LIB_DIRS = ${TMP_LIB_DIRS}" + + if test "${TMP_INC_DIRS}" != "" -a "${TMP_LIB_DIRS}" != "" ; then + TMP_INC=${TMP_INC_DIRS} + TMP_LIB=${TMP_LIB_DIRS} + fi + + if test "${TMP_INC}" != "F" -a "${TMP_LIB}" != "F" ; then + echo "Found mpi.h and libmpi.so ... via pkg-config" + echo ">> TMP_INC = ${TMP_INC}" + echo ">> TMP_LIB = ${TMP_LIB}" + MPITYPE="OPENMPI" + MPI_INCLUDE_PATH="${TMP_INC}" + MPI_LIBPATH="${TMP_LIB}" + MPI_LIBNAME="" + MPI_ROOT="NONEED" + else + echo "Found no mpi.h or libmpi.so ... via pkg-config" + fi + else + AC_MSG_RESULT([no]) + fi + fi + fi + fi fi @@ -207,45 +215,8 @@ if test -z "${MPI_INCLUDE_PATH}" ; then TMP_INC="F" TMP_LIB="F" - if test -n "${PKG_CONFIG}" ; then - echo "found pkg-config ..." - AC_MSG_CHECKING([if pkg-config knows about MPICH]) - - dnl I assume pkg-config only works in MPICH2 - if "${PKG_CONFIG}" --exists mpich; then - AC_MSG_RESULT([yes]) - - TMP_INC_DIRS=`"${PKG_CONFIG}" --cflags mpich` - echo ">> TMP_INC_DIRS = ${TMP_INC_DIRS}" - - TMP_LIB_DIRS=`"${PKG_CONFIG}" --libs mpich` - echo ">> TMP_LIB_DIRS = ${TMP_LIB_DIRS}" - - TMP_LIB_PATH=`"${PKG_CONFIG}" --variable=libdir mpich` - echo ">> TMP_LIB_PATH = ${TMP_LIB_PATH}" - - if test "$TMP_INC_DIRS" != "" -a "$TMP_LIB_DIRS" != "" ; then - TMP_INC=${TMP_INC_DIRS} - TMP_LIB="-L${TMP_LIB_PATH} ${TMP_LIB_DIRS}" - fi - - if test "$TMP_INC" != "" -a "$TMP_LIB" != "" ; then - echo "found mpi.h and libmpich.so ..." - echo ">> TMP_INC = ${TMP_INC}" - echo ">> TMP_LIB = ${TMP_LIB}" - MPITYPE="MPICH2" - MPI_INCLUDE_PATH="${TMP_INC}" - MPI_LIBPATH="${TMP_LIB}" - MPI_LIBNAME="" - MPI_ROOT="NONEED" - fi - else - AC_MSG_RESULT([no]) - fi - fi - - if test "$SED" != "F" -a "$MPICC" != "F" -a "$TMP_INC" = "F" -a "$TMP_LIB" = "F" ; then - echo "found sed and mpicc ..." + if test "$SED" != "F" -a "$MPICC" != "F" ; then + echo "Try sed and mpicc ..." TMP_CMD=`mpicc -show` echo ">> TMP_CMD = ${TMP_CMD}" @@ -260,9 +231,9 @@ if test -z "${MPI_INCLUDE_PATH}" ; then dir_inc=`echo ${dir} | sed -e "s/-I\(.*\)/\1/"` fi - echo "checking ${dir_inc} ..." + echo "Checking ${dir_inc} ..." if test -f "${dir_inc}/mpi.h" ; then - echo "found ${dir_inc}/mpi.h ..." + echo "Found ${dir_inc}/mpi.h ..." TMP_INC=${dir_inc} break fi @@ -279,16 +250,16 @@ if test -z "${MPI_INCLUDE_PATH}" ; then dir_lib=`echo ${dir} | sed -e "s/-L\(.*\)/\1/"` fi - echo "checking ${dir_lib} ..." + echo "Checking ${dir_lib} ..." if test -f "${dir_lib}/libmpich.so" ; then - echo "found ${dir_lib}/libmpich.so ..." + echo "Found ${dir_lib}/libmpich.so ... via mpicc --show & sed" TMP_LIB=${dir_lib} TMP_LIBNAME="libmpich.so" break fi dnl For Mac OS X if test -f "${dir_lib}/libmpich.dylib" ; then - echo "found ${dir_lib}/libmpich.dylib ..." + echo "Found ${dir_lib}/libmpich.dylib ... via mpicc --show & sed" TMP_LIB=${dir_lib} TMP_LIBNAME="libmpich.dylib" break @@ -297,15 +268,60 @@ if test -z "${MPI_INCLUDE_PATH}" ; then IFS="${TMP_IFS}" if test "${TMP_INC}" != "F" -a "${TMP_LIB}" != "F" ; then - echo "found mpi.h and libmpich.so ..." + echo "Found mpi.h and libmpich.so ... via mpicc --show & sed" echo ">> TMP_INC = ${TMP_INC}" echo ">> TMP_LIB = ${TMP_LIB}" MPITYPE="${MPITYPE}" MPI_INCLUDE_PATH="${TMP_INC}" MPI_LIBPATH="${TMP_LIB}" MPI_LIBNAME="${TMP_LIBNAME}" + else + echo "Found no mpi.h or libmpi.so ... via mpicc --show & sed" + fi + fi + + if test "$TMP_INC" = "F" -o "$TMP_LIB" = "F" ; then + dnl try "pkg-config" + if test -n "${PKG_CONFIG}" ; then + echo "Try pkg-config ..." + AC_MSG_CHECKING([if pkg-config knows about MPICH]) + + dnl I assume pkg-config only works in MPICH2 + if "${PKG_CONFIG}" --exists mpich; then + AC_MSG_RESULT([yes]) + + TMP_INC_DIRS=`"${PKG_CONFIG}" --cflags mpich` + echo ">> TMP_INC_DIRS = ${TMP_INC_DIRS}" + + TMP_LIB_DIRS=`"${PKG_CONFIG}" --libs mpich` + echo ">> TMP_LIB_DIRS = ${TMP_LIB_DIRS}" + + TMP_LIB_PATH=`"${PKG_CONFIG}" --variable=libdir mpich` + echo ">> TMP_LIB_PATH = ${TMP_LIB_PATH}" + + if test "$TMP_INC_DIRS" != "" -a "$TMP_LIB_DIRS" != "" ; then + TMP_INC=${TMP_INC_DIRS} + TMP_LIB="-L${TMP_LIB_PATH} ${TMP_LIB_DIRS}" + fi + + if test "$TMP_INC" != "" -a "$TMP_LIB" != "" ; then + echo "Found mpi.h and libmpich.so ... via pkg-config" + echo ">> TMP_INC = ${TMP_INC}" + echo ">> TMP_LIB = ${TMP_LIB}" + MPITYPE="MPICH2" + MPI_INCLUDE_PATH="${TMP_INC}" + MPI_LIBPATH="${TMP_LIB}" + MPI_LIBNAME="" + MPI_ROOT="NONEED" + else + echo "Found no mpi.h or libmpi.so ... via pkg-config" + fi + else + AC_MSG_RESULT([no]) + fi fi fi + fi fi