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"
Created attachment 899833 [details] Log of failed build
(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.
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`.
Well, FWICS it passes both `-mvsx` and `-mcpu=power9`, so perhaps it is a GCC bug?
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.
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)
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.
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?
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).