--- configure.orig 2017-10-29 17:15:48.000000000 -0400 +++ configure 2017-11-27 16:51:13.217231652 -0500 @@ -2856,6 +2856,7 @@ try_odbc="no" have_odbc="no" try_mpi="yes" +have_mpi="no" try_libR="yes" have_libR="no" try_libsvm="yes" @@ -16202,28 +16203,11 @@ else -ARCH=`uname -m` -if test "${ARCH}" = "i386" -o "${ARCH}" = "i686" -o "${ARCH}" = "ppc" -o "${ARCH}" = "sparcv9" ; then - MODE=32 -elif test "${ARCH}" = "ia64" ; then - MODE=64 -elif test "${ARCH}" = "s390" ; then - MODE=31 -elif test "${ARCH}" = "s390x" ; then - MODE=64 -elif test "${ARCH}" = "x86_64" -o "${ARCH}" = "ppc64" -o "${ARCH}" = "sparc64" ; then - MODE=64 -fi - -# -# Set up configure script macros -# +# mpi-lib not used, just retained for backward compatibility # Check whether --with-mpi-lib was given. if test "${with_mpi_lib+set}" = set; then : - withval=$with_mpi_lib; MPI_lib_check="$with_mpi_lib $with_mpi_lib/lib${MODE} $with_mpi_lib/lib $with_mpi_lib/lib${MODE}/openmpi $with_mpi_lib/lib/openmpi" -else - MPI_lib_check="/usr/lib /usr/lib/openmpi /usr/lib64/openmpi/lib /usr/lib/openmpi/lib" + withval=$with_mpi_lib; fi @@ -16232,86 +16216,47 @@ if test "${with_mpi_include+set}" = set; then : withval=$with_mpi_include; MPI_inc_check="$with_mpi_include $with_mpi_include/include $with_mpi_include/include/openmpi" else - MPI_inc_check="/usr/include /usr/include/openmpi /usr/include/openmpi-${ARCH} /usr/local/include /usr/local/include/openmpi-${ARCH} /opt/openmpi/include /usr/include/openmpi /usr/lib/openmpi/include" + MPI_inc_check="/usr/include /usr/local/include /usr/include/openmpi /opt/openmpi/include /usr/lib/openmpi/include" fi -# -# Look for MPI library -# -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI library" >&5 -$as_echo_n "checking for MPI library... " >&6; } -MPI_libdir= -for m in ${MPI_lib_check} ; do - if test -d "$m" ; then - if (test -f "$m/libmpi.so" || test -f "$m/libmpi.a" || test -f "$m/libmpi.dylib"); then - MPI_libdir=$m - break - fi - fi -done - -# -# if not found, try for the MPICH library instead -# -if test -z "$MPI_libdir" ; then - for m in ${MPI_lib_check} ; do - if test -d "$m" ; then - if (test -f "$m/libmpich.so" || test -f "$m/libmpich.a" || test -f "$m/libmpich.dylib"); then - MPI_libdir=$m - break - fi - fi - done +# can we find the header just using the default search paths? +ac_fn_c_check_header_mongrel "$LINENO" "mpi.h" "ac_cv_header_mpi_h" "$ac_includes_default" +if test "x$ac_cv_header_mpi_h" = xyes; then : + have_mpi="yes" fi -if test -z "$MPI_libdir" -then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Couldn't find MPI library" >&5 -$as_echo "Couldn't find MPI library" >&6; } - have_mpi=no -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MPI_libdir" >&5 -$as_echo "$MPI_libdir" >&6; } - if test "$MPI_libdir" = "/usr/lib" ; then - MPI_LIBS="-lmpi" - else - MPI_LIBS="-L$MPI_libdir -lmpi" - fi - # - # Look for MPI headers - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI include directory" >&5 -$as_echo_n "checking for MPI include directory... " >&6; } + + +# if not, try our own search +if test $have_mpi = no ; then + ARCH=`uname -m` + ARCHPATHS="/usr/include/openmpi-${ARCH} /usr/lib/${ARCH}-linux-gnu/openmpi/include /usr/local/include/openmpi-${ARCH}" MPI_incdir= - for m in $MPI_inc_check ; do + for m in $MPI_inc_check $ARCHPATHS ; do if test -d "$m" && test -f "$m/mpi.h" ; then MPI_incdir=$m break fi done - if test -z "$MPI_incdir" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: couldn't find mpi.h" >&5 $as_echo "couldn't find mpi.h" >&6; } - have_mpi=no else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MPI_incdir" >&5 -$as_echo "$MPI_incdir" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found mpi.h in $MPI_incdir" >&5 +$as_echo "found mpi.h in $MPI_incdir" >&6; } have_mpi=yes - $as_echo "#define HAVE_MPI 1" >>confdefs.h - - if test "$MPI_incdir" = "/usr/include" ; then - MPI_CFLAGS="" - else + if test "$MPI_incdir" != "/usr/include" ; then MPI_CFLAGS="-I${MPI_incdir}" fi - if test x"${MPICC}" = x ; then - MPICC=mpicc - fi - + fi +fi +if test $have_mpi = yes ; then + $as_echo "#define HAVE_MPI 1" >>confdefs.h + if test x"${MPICC}" = x ; then + MPICC=mpicc fi fi