Public bug reported:

madness 0.10.1+git20200818.eee5fd9f-4 has been stuck in stonking-
proposed for ~346 days. update_excuses reports:

  missing build on amd64/amd64v3/arm64/ppc64el/s390x: libmadness-dev
(from 0.10.1+git20200818.eee5fd9f-3)

Build log (amd64):
https://launchpad.net/ubuntu/+source/madness/0.10.1+git20200818.eee5fd9f-4/+build/32793501

Failure (7 times, in src/madness/{world,tensor,mra,misc}):

  cc1plus: error: unrecognized argument to '-flto=' option: 'auto -ffat-
lto-objects'

The failing compile lines contain the LTO flags as ONE quoted argument:

  /usr/bin/x86_64-linux-gnu-g++ ... -std=c++17 -fPIC "-flto=auto -ffat-
lto-objects" -MD ...

so g++ sees "-flto=" with the value "auto -ffat-lto-objects". Only the
MPI-using targets are affected (the bundled gtest/muParser/tinyxml
targets build fine), and the build used cmake 4.3.4-1ubuntu1, gcc-15
15.3.0-4ubuntu1.

Cause (analysis, to be confirmed):
The flag does not come from madness itself: debian/rules doesn't set any LTO 
option and madness' CMake files don't add -flto. It comes from MPICH. madness 
Build-Depends on libmpich-dev and uses CMake's FindMPI, which interrogates the 
mpicxx wrapper and turns what it finds into MPI_CXX_COMPILE_OPTIONS / the 
MPI::MPI_CXX interface target.

In stonking, mpich 5.0.1-9 (synced from Debian) bakes the LDFLAGS it was
built with into its wrappers and pkg-config file. On Ubuntu those
LDFLAGS contain our default LTO flags:

  /usr/bin/mpicxx.mpich:
    final_ldflags=" -Wl,-Bsymbolic-functions -Wl,--package-metadata=... 
-flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now ..."
  /usr/lib/x86_64-linux-gnu/mpich/lib/pkgconfig/mpich.pc:
    Libs: ... -flto=auto -ffat-lto-objects ...
    fflags= / fcflags= ... -flto=auto -ffat-lto-objects ...

FindMPI then ends up passing "-flto=auto -ffat-lto-objects" as a single
compile option. Debian doesn't enable LTO by default, so its mpich
wrappers are clean and madness builds there (Debian testing has the -4
binaries). That makes this Ubuntu-specific.

(mpich's debian/rules explicitly clears CPPFLAGS/CFLAGS/CXXFLAGS for
configure, using MPICHLIB_*FLAGS for the library build instead, but does
not do the same for LDFLAGS, which is presumably how the LTO flags leak
into the wrappers.)

Debian / upstream status:
- No open Debian bug against madness (or found against mpich) for this; it is 
Ubuntu-only because of LTO.
- madness upstream is a 2020 git snapshot; nothing to pick up there for this.

Suggested direction (to be done by whoever picks this up):
1. Reproduce: build madness -4 in a stonking chroot/container and confirm the 
quoted flag comes from MPI::MPI_CXX (e.g. check MPI_CXX_COMPILE_OPTIONS in 
CMakeCache.txt, and "mpicxx.mpich -show").
2. Quick unblock for madness: add an Ubuntu delta to debian/rules
     export DEB_BUILD_MAINT_OPTIONS = optimize=-lto
   This might not be enough on its own, since the flags come from mpicxx, not 
from madness' own build flags; if so, sanitise MPI_CXX_COMPILE_OPTIONS (e.g. 
pass -DMPI_CXX_COMPILE_OPTIONS= / -DMPI_CXX_SKIP_MPICXX..., or override at 
configure time).
3. Proper fix: mpich should not leak the build's LDFLAGS (LTO, 
-Wl,--package-metadata, -Bsymbolic-functions, ...) into mpicc/mpicxx/mpifort 
and mpich.pc, e.g. by building with MPICHLIB_LDFLAGS and an empty LDFLAGS for 
configure, like it already does for CFLAGS. That would be an Ubuntu delta for 
mpich (or a Debian bug, since the package-metadata/relro flags leak there too) 
and would also protect other CMake+MPICH reverse build-dependencies. Check 
whether other mpich users in proposed fail the same way before deciding.
4. Then upload/retry madness and check the autopkgtests.

** Affects: madness (Ubuntu)
     Importance: Undecided
         Status: New

** Affects: mpich (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: ftbfs update-excuse

** Tags added: update-excuse

** Tags added: ftbfs

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2170321

Title:
  madness FTBFS in stonking: '-flto=auto -ffat-lto-objects' passed as
  one argument (LTO flags leaked by mpich wrappers)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/madness/+bug/2170321/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to