Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 937757 - dev-python/numpy-2.0.0 fails src_compile on ppc64 power9
Summary: dev-python/numpy-2.0.0 fails src_compile on ppc64 power9
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-11 10:11 UTC by Chris Kerr
Modified: 2024-11-13 15:17 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Log of failed build (dev-python:numpy-2.0.0:20240811-100249.log.gz,9.84 KB, application/gzip)
2024-08-11 10:12 UTC, Chris Kerr
Details
Log of failed build with `-mvsx` (dev-python:numpy-2.0.0:20240811-100604.log.gz,10.05 KB, application/gzip)
2024-08-14 10:24 UTC, Chris Kerr
Details
Log of failed build of numpy 2.1.0 (dev-python:numpy-2.1.0:20240825-054406.log,155.13 KB, text/plain)
2024-08-25 06:02 UTC, Chris Kerr
Details
Log of build without -mcpu (dev-python:numpy-2.0.0:20241013-111422.log.gz,849.54 KB, application/gzip)
2024-10-13 11:56 UTC, Chris Kerr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Kerr 2024-08-11 10:11:52 UTC
src_compile fails with the following error. Note that -mcpu=power9 is already in CFLAGS (and CXXFLAGS etc). I think -mcpu=power9 implies -mvsx, but just in case I also tried building again after adding -mvsx to *FLAGS and it still gives the same error.



In file included from ../numpy-2.0.0/numpy/_core/src/common/common.hpp:10,
                 from ../numpy-2.0.0/numpy/_core/src/npysort/highway_qsort.hpp:4,
                 from ../numpy-2.0.0/numpy/_core/src/npysort/highway_qsort.dispatch.cpp:1:
../numpy-2.0.0/numpy/_core/src/common/half.hpp: In member function ‘np::Half::operator float() const’:
../numpy-2.0.0/numpy/_core/src/common/half.hpp:95:54: error: ‘__builtin_vsx_vextract_fp_from_shorth’ requires the ‘-mcpu=power9’ and ‘-mvsx’ options
   95 |         return vec_extract(vec_extract_fp_from_shorth(vec_splats(bits_)), 0);


Reproducible: Always




emerge --info dev-python/numpy
Portage 3.0.65 (python 3.12.4-final-0, default/linux/ppc64le/23.0/desktop/plasma/systemd, gcc-13, glibc-2.38-r13, 6.6.30-gentoo-ppc64le ppc64le)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.6.30-gentoo-ppc64le-ppc64le-POWER9,_altivec_supported-with-glibc2.38
KiB Mem:   197158860 total, 146251860 free
KiB Swap:   33554428 total,  32894972 free
Timestamp of repository gentoo: Sat, 10 Aug 2024 10:45:00 +0000
Head commit of repository gentoo: f8b95e9a71e072bd6ee3772810c6c380932913b4
Timestamp of repository haskell: Fri, 09 Aug 2024 20:03:56 +0000
Head commit of repository haskell: b6a2e7d2ae5c2d2f0a8024730ebc396a4b6c87dd

sh bash 5.2_p26-r6
ld GNU ld (Gentoo 2.41 p5) 2.41.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p26-r6::gentoo
dev-build/autoconf:        2.13-r8::gentoo, 2.71-r7::gentoo
dev-build/automake:        1.16.5-r2::gentoo
dev-build/cmake:           3.28.5::gentoo
dev-build/libtool:         2.4.7-r4::gentoo
dev-build/make:            4.4.1-r1::gentoo
dev-build/meson:           1.4.1::gentoo
dev-lang/perl:             5.38.2-r3::gentoo
dev-lang/python:           2.7.18_p16-r2::gentoo, 3.11.9_p1::gentoo, 3.12.4_p3::gentoo
dev-lang/rust:             1.79.0::gentoo
sys-apps/baselayout:       2.15::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-apps/systemd:          255.7-r1::gentoo
sys-devel/binutils:        2.41-r5::gentoo, 2.42-r1::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           16.0.6::gentoo, 17.0.6::gentoo, 18.1.8::gentoo
sys-devel/gcc:             13.3.1_p20240614::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/llvm:            16.0.6::gentoo, 17.0.6::gentoo, 18.1.8-r1::gentoo
sys-kernel/linux-headers:  6.6-r1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.38-r13::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.europe.gentoo.org/gentoo-portage
    priority: -1000
    volatile: False
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts: 

haskell
    location: /var/db/repos/haskell
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/haskell.git
    masters: gentoo
    volatile: False

ACCEPT_KEYWORDS="ppc64"
ACCEPT_LICENSE="@FREE"
CBUILD="powerpc64le-unknown-linux-gnu"
CFLAGS="-Og -pipe -mcpu=power9 -mtune=power9 -g -ggdb"
CHOST="powerpc64le-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-Og -pipe -mcpu=power9 -mtune=power9 -g -ggdb"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-Og -pipe -mcpu=power9 -mtune=power9 -g -ggdb"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-Og -pipe -mcpu=power9 -mtune=power9 -g -ggdb"
GENTOO_MIRRORS="     https://mirrors.dotsrc.org/gentoo/     https://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ "
LANG="C.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
MAKEOPTS="--jobs=24 --load-average=32"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="X a52 aac acl activities alsa bash-completion bluetooth branding brotli bzip2 cairo caps cdda cdr crypt cryptsetup cups dbus declarative device-mapper dri dts dvd dvdr encode exif firewalld flac gdbm gif gpm grub gtk gui iconv icu ipv6 jpeg jpeg2k kde kf6compat kwallet lcms libnotify lto lvm lz4 lzma lzo mad mng mp3 mp4 mpeg ncurses networkmanager nls ogg opengl openmp pam pango pcre pdf pipewire plasma png policykit ppc64 ppds pulseaudio qml qt5 raw readline screencast sdl seccomp semantic-desktop smartcard sound spell ssl startup-notification svg systemd test-rust tiff truetype udev udisks unicode upower usb vaapi verify-sig vorbis vulkan wayland webp widgets wxwidgets x264 xattr xcb xft xml xv xvid zlib zram zstd" ADA_TARGET="gcc_12" AMDGPU_TARGETS="gfx1012" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_PPC="altivec vsx vsx2 vsx3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en en-GB eo et" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LLVM_TARGETS="AMDGPU BPF PowerPC" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_12" RUBY_TARGETS="ruby31 ruby32" VIDEO_CARDS="amdgpu radeon ast fbdev" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS

=================================================================
                        Package Settings
=================================================================

dev-python/numpy-1.26.4::gentoo was built with the following:
USE="lapack -debug -test" PYTHON_TARGETS="python3_11 python3_12 (-pypy3) -python3_10"
CFLAGS="-Og -pipe -mcpu=power9 -mtune=power9 -g -ggdb -fno-strict-aliasing"
CXXFLAGS="-Og -pipe -mcpu=power9 -mtune=power9 -g -ggdb -fno-strict-aliasing"
FEATURES="binpkg-docompress multilib-strict ipc-sandbox distlocks pid-sandbox usersandbox ebuild-locks unmerge-orphans usersync preserve-libs parallel-fetch unmerge-logs news merge-sync binpkg-dostrip userpriv sandbox protect-owned xattr pkgdir-index-trusted buildpkg binpkg-logs network-sandbox unknown-features-warn strict config-protect-if-modified assume-digests sfperms qa-unresolved-soname-deps userfetch splitdebug buildpkg-live merge-wait fixlafiles"
Comment 1 Chris Kerr 2024-08-11 10:12:51 UTC
Created attachment 899833 [details]
Log of failed build
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2024-08-11 15:06:57 UTC
(In reply to Chris Kerr from comment #0)
> src_compile fails with the following error. Note that -mcpu=power9 is
> already in CFLAGS (and CXXFLAGS etc). I think -mcpu=power9 implies -mvsx,
> but just in case I also tried building again after adding -mvsx to *FLAGS
> and it still gives the same error.

Could you include a log of that?  I see -mcpu=power9 being passed correctly, so I'm confused as to whether -mvsx got stripped somehow or the compiler is misbehaving.
Comment 3 Chris Kerr 2024-08-14 10:24:01 UTC
Created attachment 900101 [details]
Log of failed build with `-mvsx`

Here is the result when building with `-mvsx` in *FLAGS - it is almost exactly the same as without `-mvsx`.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2024-08-14 10:31:41 UTC
Well, FWICS it passes both `-mvsx` and `-mcpu=power9`, so perhaps it is a GCC bug?
Comment 5 Chris Kerr 2024-08-25 06:02:44 UTC
Created attachment 901184 [details]
Log of failed build of numpy 2.1.0

I tried building numpy 2.1.0 and got the same error.
Comment 6 Chris Kerr 2024-10-03 09:39:07 UTC
I tried installing upstream numpy from a git checkout of the v2.0.0 tag with 

./venv-numpy/bin/pip install ./numpy/

That seems to have worked (with no FLAGS in the environment)
Comment 7 dullfire 2024-10-08 07:42:00 UTC
Hit this bug as well

It appears that "-mcpu=power8" and "-O3" are being added to  the build flags (after, and in addition to make.conf:CFLAGS="-mcpu=native" or -mcpu=power9).


I think that would foul up gcc.
Comment 8 Chris Kerr 2024-10-13 11:56:24 UTC
Created attachment 905623 [details]
Log of build without -mcpu

I tried building without any `-mcpu` or `-mtune` in CFLAGS.

This time the src_compile succeeded (the logs show -mcpu=power8 being added by the numpy build script, but no `-DNPY_HAVE_VSX3` etc), but it failed src_test with an error in float128, probably related to the switch to ieee long double while numpy is still expecting the old behaviour?
Comment 9 Chris Kerr 2024-11-13 15:17:51 UTC
numpy 2.0.2-r1 still has the same problem in src_compile with -mcpu=power9, but if I compile it without any -mcpu in CFLAGS then it now also passes src_test (unlike 2.0.0).