Source: hpcc
Version: 1.5.0-3
Tags: patch
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

hpcc fails to cross build from source, because it uses mpicc. mpicc is
completely unsupportable during cross builds, because there are no
triplet-prefixed variants of mpicc. Instead, common wisdom is to use
pkgconf and use it to look up the required compiler and linker flags.
I'm attaching a patch for your convenience.

Helmut
diff --minimal -Nru hpcc-1.5.0/debian/changelog hpcc-1.5.0/debian/changelog
--- hpcc-1.5.0/debian/changelog 2022-07-28 22:21:34.000000000 +0200
+++ hpcc-1.5.0/debian/changelog 2024-04-29 10:39:50.000000000 +0200
@@ -1,3 +1,10 @@
+hpcc (1.5.0-3.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: Use pkgconf instead of mpicc. (Closes: #-1)
+
+ -- Helmut Grohne <hel...@subdivi.de>  Mon, 29 Apr 2024 10:39:50 +0200
+
 hpcc (1.5.0-3) unstable; urgency=medium
 
   * Refresh patches using gbp pq import/export
diff --minimal -Nru hpcc-1.5.0/debian/control hpcc-1.5.0/debian/control
--- hpcc-1.5.0/debian/control   2022-07-28 22:21:34.000000000 +0200
+++ hpcc-1.5.0/debian/control   2024-04-29 10:39:50.000000000 +0200
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Debian Science Maintainers 
<debian-science-maintain...@lists.alioth.debian.org>
 Uploaders: Lucas Nussbaum <lu...@debian.org>
-Build-Depends: debhelper-compat (= 12), libatlas-base-dev, mpi-default-dev, 
mpi-default-bin
+Build-Depends: debhelper-compat (= 12), libatlas-base-dev, mpi-default-dev, 
mpi-default-bin, pkgconf
 Standards-Version: 4.3.0
 Homepage: https://hpcchallenge.org/hpcc/
 Vcs-Git: https://salsa.debian.org/hpc-team/hpcc.git
diff --minimal -Nru hpcc-1.5.0/debian/patches/add-Make.Debian.patch 
hpcc-1.5.0/debian/patches/add-Make.Debian.patch
--- hpcc-1.5.0/debian/patches/add-Make.Debian.patch     2022-07-28 
22:21:34.000000000 +0200
+++ hpcc-1.5.0/debian/patches/add-Make.Debian.patch     2024-04-29 
10:39:50.000000000 +0200
@@ -14,7 +14,7 @@
 index 0000000..d19bbdf
 --- /dev/null
 +++ b/hpl/Make.Debian
-@@ -0,0 +1,181 @@
+@@ -0,0 +1,185 @@
 +# -*- makefile -*-
 +#
 +#  -- High Performance Computing Linpack Benchmark (HPL)
@@ -184,12 +181,16 @@
 +# - Compilers / linkers - Optimization flags ---------------------------
 +# ----------------------------------------------------------------------
 +#
-+CC           = mpicc
-+CCNOOPT      = $(HPL_DEFS)
-+CCFLAGS      = $(HPL_DEFS) -fomit-frame-pointer -O3 -funroll-loops -W -Wall 
$(shell dpkg-buildflags --get CFLAGS)
++PKG_CONFIG   = pkg-config
++CC           = cc
++MPI_CFLAGS   = $(shell $(PKG_CONFIG) --cflags mpi)
++MPI_LIBS     = $(shell $(PKG_CONFIG) --libs mpi)
++CCNOOPT      = $(MPI_CFLAGS) $(HPL_DEFS)
++CCFLAGS      = $(MPI_CFLAGS) $(HPL_DEFS) -fomit-frame-pointer -O3 
-funroll-loops -W -Wall $(shell dpkg-buildflags --get CFLAGS)
 +#
-+LINKER       = mpicc
++LINKER       = $(CC)
 +LINKFLAGS    = $(CCFLAGS) $(shell dpkg-buildflags --get LDFLAGS)
++HPL_LIBS     += $(MPI_LIBS)
 +#
 +ARCHIVER     = ar
 +ARFLAGS      = r

Reply via email to