Public bug reported:

libsharp 1.0.0-2build1 fails to build from source on amd64v3:
https://launchpad.net/ubuntu/+source/libsharp/1.0.0-2build1/+build/31519162
Build log: 
https://launchpad.net/ubuntu/+source/libsharp/1.0.0-2build1/+build/31519162/+files/buildlog_ubuntu-resolute-amd64v3.libsharp_1.0.0-2build1_BUILDING.txt.gz

  libsharp/sharp_core.c:50:2: error: #error MULTIARCH specified but
platform-specific flags detected

Cause: on amd64, debian/rules adds -DMULTIARCH, which makes libsharp
build generic plus AVX/AVX2/FMA code paths and select one at runtime
(unrelated to Debian multiarch). The check is DEB_HOST_ARCH_CPU ==
amd64, which is also true for amd64v3 builds. There, the default
compiler flags include -march=x86-64-v3, which defines
__AVX__/__AVX2__/__FMA__ for all code, and libsharp refuses that
combination with an explicit #error (sharp_core.c:48-51). Runtime
selection is pointless on amd64v3 anyway, since the baseline already has
AVX2 and FMA.

The failed build is from resolute; stonking only has 1.0.0-2build1
copied from resolute's release pocket, so there is no amd64v3 build of
libsharp in stonking.

Fix: only add -DMULTIARCH when no -march= flag is set (patch attached in
a comment). Checked the resulting CFLAGS: with the normal amd64 flags
-DMULTIARCH is still added (amd64 unchanged); with -march=x86-64-v3
(added via dpkg-buildflags) it is not. A full package build has not been
done.

The change is harmless in Debian and could be forwarded there to avoid
carrying an Ubuntu delta.

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


** Tags: ftbfs

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

Title:
  libsharp FTBFS on amd64v3: -DMULTIARCH combined with -march=x86-64-v3
  hits #error

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


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

Reply via email to