Author: Helmut Grohne <helmut@subdivi.de>
Last-Update: Tue, 26 Jun 2018 17:32:08 +0200
Bug-Debian: https://bugs.debian.org/902433
Description: Use MPI_C to enable cross building

--- a/configure.ac
+++ b/configure.ac
@@ -98,7 +98,7 @@ AS_IF([test "x$enable_gprof" = "xyes"],
 AC_ARG_ENABLE([mpi],
               [AS_HELP_STRING([--enable-mpi],
                               [Compile with mpicc instead of gcc.])])
-AS_IF([test "x$enable_mpi" = "xyes"],[CC="mpicc"])
+AS_IF([test "x$enable_mpi" = "xyes"],[PKG_CHECK_MODULES([MPI_C],[mpi-c])])
 AS_IF([test "x$enable_mpi" = "xyes"],AC_DEFINE([MPI],[1],[MPI tag on]))
 AM_CONDITIONAL([WANT_MPI], [test "$enable_mpi" = yes])
 
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -312,7 +312,8 @@ date.c date.h\
 sse.c sse.h\
 avx.c avx.h\
 mpi_boot.c mpi_boot.h
-phyml_mpi_LDADD = -lm
+phyml_mpi_CFLAGS = $(MPI_C_CFLAGS)
+phyml_mpi_LDADD = -lm $(MPI_C_LIBS)
 else
 if WANT_WIN
 phyml_windows_SOURCES = main.c \
