Source: phyml
Version: 3:3.3.20180214+dfsg-1
Tags: patch upstream
User: [email protected]
Usertags: rebootstrap
phyml fails to cross build from source, because it uses mpicc. mpicc
replaces the compiler, but we need the compiler variable to select the
host architecture. Using mpicc fundamentally breaks cross compilation
(and other things). The actual use of mpicc is wrapping the compiler to
pass extra flags for compilation and linking. This task is commonly
solved by pkg-config and the major mpi implementations provide a
mpi-c.pc via an alternative. Using pkg-config avoids replacing the
compiler and is actually rather simple as the attached patch
demonstrates. Please consider applying it as it makes phyml cross
buildable. If backwards compatibility with mpicc must be retained, that
is achievable by adding more arguments to PKG_CHECK_MODULES.
Helmut
--- phyml-3.3.20180214+dfsg.orig/configure.ac
+++ phyml-3.3.20180214+dfsg/configure.ac
@@ -96,7 +96,7 @@
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])
--- phyml-3.3.20180214+dfsg.orig/src/Makefile.am
+++ phyml-3.3.20180214+dfsg/src/Makefile.am
@@ -303,7 +303,8 @@
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 \