Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 751781 - media-libs/opencv-4.5.0: failed to emerge (error: inlining failed in call to ‘always_inline’ ‘__m128i _mm_cvtps_ph(__m128, int)’: target specific option mismatch)
Summary: media-libs/opencv-4.5.0: failed to emerge (error: inlining failed in call to ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal with 1 vote (vote)
Assignee: Amy Liffey
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2020-10-29 17:31 UTC by Leonid Kopylov
Modified: 2020-12-27 04:34 UTC (History)
3 users (show)

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


Attachments
build.log.xz (build.log.xz,29.86 KB, application/x-xz)
2020-10-29 17:32 UTC, Leonid Kopylov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Leonid Kopylov 2020-10-29 17:31:18 UTC
I saw there are several bugs of this package, now i'm unable to install 4.5.0 version

# emerge -pqv '=media-libs/opencv-4.5.0::gentoo'
[ebuild  N    ] media-libs/opencv-4.5.0  USE="contrib eigen examples features2d gstreamer java jpeg opengl openmp png python qt5 threads tiff v4l -contribcvv -contribdnn -contribfreetype -contribhdf (-contribovis) -contribsfm -contribxfeatures2d -cuda -debug -dnnsamples -download -ffmpeg -gdal -gflags -glog -gphoto2 -gtk3 -ieee1394 -jpeg2k -lapack -lto -opencl -opencvapps -openexr -tesseract -testprograms -vaapi -vtk -webp -xine" ABI_X86="32 (64) (-x32)" CPU_FLAGS_X86="avx avx2 popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3 -avx512f -f16c -fma3" PYTHON_TARGETS="python3_7 -python3_6 -python3_8 -python3_9"

# emerge --info '=media-libs/opencv-4.5.0::gentoo'
Portage 3.0.8 (python 3.7.9-final-0, default/linux/amd64/17.1/desktop/plasma/systemd, gcc-10.2.0, glibc-2.32-r2, 5.9.1-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.9.1-gentoo-x86_64-Intel-R-_Core-TM-_i7-8700B_CPU_@_3.20GHz-with-gentoo-2.7
KiB Mem:     8139740 total,   3244632 free
KiB Swap:    8388604 total,   8384508 free
Timestamp of repository gentoo: Thu, 29 Oct 2020 06:00:01 +0000
Head commit of repository gentoo: f083cbdc44ed3d902d7fe4ee8e8b676f2f32dc61
sh bash 5.0_p18
ld GNU ld (Gentoo 2.35.1 p1) 2.35.1
ccache version 4.0 [disabled]
app-shells/bash:          5.0_p18::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.30.3-r1::gentoo
dev-lang/python:          2.7.18-r4::gentoo, 3.7.9::gentoo, 3.8.6::gentoo, 3.9.0::gentoo, 3.10.0_alpha1::gentoo
dev-util/ccache:          4.0::gentoo
dev-util/cmake:           3.18.4::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.2::gentoo
sys-devel/binutils:       2.35.1::gentoo
sys-devel/gcc:            10.2.0-r2::gentoo
sys-devel/gcc-config:     2.3.2::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.9::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r2::gentoo
Repositories:

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

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA google-chrome OPERA-2014"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /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/php/apache2-php7.4/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY 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"
FCFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
GENTOO_MIRRORS="http://mirror.isoc.org.il/pub/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
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"
USE="X a52 aac accessibility acl acpi activities addc ads alsa amd64 audit berkdb bluetooth branding bzip2 cairo cdda cdr cgroup-hybrid cli contrib crypt cryptsetup cups curl dbus declarative device-mapper doc dot drafts dri dts dvd dvdr emboss encode examples exif experimental farstream flac fortran gd gdbm geoip gif gles2 go gpg gpm grub gstreamer gtk gui html http iconv icu idn ipv6 iscsi jadetex java jpeg json kde kdesu kerberos kipi kwallet lcms ldap libglvnd libkms libnotify libtirpc logrotate mad math mbox mdadm mng mount mount-locking mp3 mp4 mpeg mpx multilib ncurses networkmanager nls nptl nscd offensive ogg opengl openmp openntpd pam pango pass pcre pdf perl phonon plasma png policykit postproc ppds printsupport pulseaudio python qml qrcode qt5 readline samba sasl screencast sdl seccomp semantic-desktop slp smi spell split-usr sqlite sshdump ssl startup-notification svg symlink sync-plugin-portage systemd tcl tcpd tfshark theora threads thunderbolt tiff tk tools truetype udev udisks unicode upower usb user-session v4l vnc vorbis wayland widgets winbind wininst wxwidgets x264 xa xattr xcb xetex xinerama xkb xml xv xvid yaml zlib zstd" ABI_X86="64 32" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache 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_X86="aes avx avx2 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="evdev" KERNEL="linux" L10N="en en-US he ru" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="nlpsolver scripting-beanshell wiki-publisher scripting-javascript" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" RUBY_TARGETS="ruby25 ruby26 ruby27" USERLAND="GNU" VIDEO_CARDS="virtualbox vmware" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Leonid Kopylov 2020-10-29 17:32:23 UTC
Created attachment 669200 [details]
build.log.xz
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-10-29 17:50:27 UTC
FAILED: modules/core/CMakeFiles/opencv_core.dir/src/array.cpp.o 
/usr/bin/x86_64-pc-linux-gnu-g++ -DCVAPI_EXPORTS -DOPENCV_ALLOCATOR_STATS_COUNTER_TYPE="long long" -D_USE_MATH_DEFINES -D__OPENCV_BUILD=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/var/tmp/portage/media-libs/opencv-4.5.0/work/opencv-4.5.0/modules/core/include -Imodules/core -isystem . -isystem /usr/include/eigen3  -march=native -O2 -pipe -fomit-frame-pointer   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mavx -mavx2 -fvisibility=hidden -fvisibility-inlines-hidden -fopenmp -fPIC -std=c++11 -MD -MT modules/core/CMakeFiles/opencv_core.dir/src/array.cpp.o -MF modules/core/CMakeFiles/opencv_core.dir/src/array.cpp.o.d -o modules/core/CMakeFiles/opencv_core.dir/src/array.cpp.o -c /var/tmp/portage/media-libs/opencv-4.5.0/work/opencv-4.5.0/modules/core/src/array.cpp
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include/immintrin.h:113,
                 from /var/tmp/portage/media-libs/opencv-4.5.0/work/opencv-4.5.0/modules/core/include/opencv2/core/cv_cpu_dispatch.h:71,
                 from /var/tmp/portage/media-libs/opencv-4.5.0/work/opencv-4.5.0/modules/core/include/opencv2/core/cvdef.h:343,
                 from /var/tmp/portage/media-libs/opencv-4.5.0/work/opencv-4.5.0/modules/core/include/opencv2/core.hpp:52,
                 from /var/tmp/portage/media-libs/opencv-4.5.0/work/opencv-4.5.0/modules/core/include/opencv2/core/utility.hpp:56,
                 from /var/tmp/portage/media-libs/opencv-4.5.0/work/opencv-4.5.0/modules/core/src/precomp.hpp:49,
                 from /var/tmp/portage/media-libs/opencv-4.5.0/work/opencv-4.5.0/modules/core/src/array.cpp:49:
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include/f16cintrin.h: In constructor ‘cv::float16_t::float16_t(float)’:
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include/f16cintrin.h:67:1: 
   67 | _mm_cvtps_ph (__m128 __A, const int __I)
      | ^~~~~~~~~~~~
In file included from /var/tmp/portage/media-libs/opencv-4.5.0/work/opencv-4.5.0/modules/core/include/opencv2/core.hpp:52,
                 from /var/tmp/portage/media-libs/opencv-4.5.0/work/opencv-4.5.0/modules/core/include/opencv2/core/utility.hpp:56,
                 from /var/tmp/portage/media-libs/opencv-4.5.0/work/opencv-4.5.0/modules/core/src/precomp.hpp:49,
                 from /var/tmp/portage/media-libs/opencv-4.5.0/work/opencv-4.5.0/modules/core/src/array.cpp:49:
/var/tmp/portage/media-libs/opencv-4.5.0/work/opencv-4.5.0/modules/core/include/opencv2/core/cvdef.h:849:38: note: called from here
  849 |         w = (ushort)_mm_cvtsi128_si32(_mm_cvtps_ph(v, 0));
      |                     ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include/immintrin.h:113,
                 from /var/tmp/portage/media-libs/opencv-4.5.0/work/opencv-4.5.0/modules/core/include/opencv2/core/cv_cpu_dispatch.h:71,
                 from /var/tmp/portage/media-libs/opencv-4.5.0/work/opencv-4.5.0/modules/core/include/opencv2/core/cvdef.h:343,
                 from /var/tmp/portage/media-libs/opencv-4.5.0/work/opencv-4.5.0/modules/core/include/opencv2/core.hpp:52,
                 from /var/tmp/portage/media-libs/opencv-4.5.0/work/opencv-4.5.0/modules/core/include/opencv2/core/utility.hpp:56,
                 from /var/tmp/portage/media-libs/opencv-4.5.0/work/opencv-4.5.0/modules/core/src/precomp.hpp:49,
                 from /var/tmp/portage/media-libs/opencv-4.5.0/work/opencv-4.5.0/modules/core/src/array.cpp:49:
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include/f16cintrin.h:67:1: error: inlining failed in call to ‘always_inline’ ‘__m128i _mm_cvtps_ph(__m128, int)’: target specific option mismatch
   67 | _mm_cvtps_ph (__m128 __A, const int __I)
      | ^~~~~~~~~~~~
In file included from /var/tmp/portage/media-libs/opencv-4.5.0/work/opencv-4.5.0/modules/core/include/opencv2/core.hpp:52,
                 from /var/tmp/portage/media-libs/opencv-4.5.0/work/opencv-4.5.0/modules/core/include/opencv2/core/utility.hpp:56,
                 from /var/tmp/portage/media-libs/opencv-4.5.0/work/opencv-4.5.0/modules/core/src/precomp.hpp:49,
                 from /var/tmp/portage/media-libs/opencv-4.5.0/work/opencv-4.5.0/modules/core/src/array.cpp:49:
/var/tmp/portage/media-libs/opencv-4.5.0/work/opencv-4.5.0/modules/core/include/opencv2/core/cvdef.h:849:38: note: called from here
  849 |         w = (ushort)_mm_cvtsi128_si32(_mm_cvtps_ph(v, 0));
      |                     ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
Comment 3 Ross Charles C. 2020-10-30 00:19:15 UTC
Never thought anyone would have disabled f16c and enabled avx. Probably need to add it to REQUIRED_USE
Comment 4 Leonid Kopylov 2020-11-03 10:27:54 UTC
(In reply to Ross Charles C. from comment #3)
> Never thought anyone would have disabled f16c and enabled avx. Probably need
> to add it to REQUIRED_USE

it default CPU_FLAGS, enabling f16c, and disabling avx - didn't helped - still can't build this
Comment 5 Victor Mataré 2020-11-07 14:02:37 UTC
I was using a CPU_FLAGS_X86 that was generated by a very old version of cpuid2cpuflags, and was missing f16c and some other features. Updating CPU_FLAGS_X86 with the output of a newer cpuid2cpuflags fixed this.
Comment 6 Leonid Kopylov 2020-11-07 16:17:24 UTC
i used exactly that tool to generate this - on virtualbox - this flag on CPU not exists
Comment 7 Ross Charles C. 2020-11-11 05:03:13 UTC
That's probably a problem within virtualbox. Sandy Bridge is the only real CPU with AVX that doesn't have F16C. But since you also enabled AVX2, that's not the case.

I think there might be an implicit rule in the CPU flags:

avx2:f16c,avx
f16c:avx

Can you try compiling with '-avx2 -f16c avx' CPUFLAGS?
Comment 8 Leonid Kopylov 2020-11-11 06:05:50 UTC
same failure
Comment 9 Ross Charles C. 2020-11-11 06:18:30 UTC
(In reply to Leonid Kopylov from comment #8)
> same failure

But can you paste the full build log for that? The bug doesn't seem to be reproducible on my computer.
Comment 10 Leonid Kopylov 2020-11-11 19:29:04 UTC
my bad, yes, after disabling avx2 it installed successfully
Comment 11 Valerie 2020-11-18 09:57:12 UTC
Hello,
I have the same issue as OP: see https://forums.gentoo.org/viewtopic-t-1123459.html

After manually removing avx2 flag from CPU_FLAGS, it compiles, but the package is pulled in after a new emerge -avuND @world -_-

Can anyone please help me?
Thank you,
Kind regards,
Valerie
Comment 12 Steve Williams 2020-11-25 16:57:45 UTC
I had a similar issue with compiling opencv-4.5.0. Disabling -flto (in package.env) enabled a successful compile.
Comment 13 Larry the Git Cow gentoo-dev 2020-12-27 04:34:14 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e402fc2e336e59a514557c6c1bdb014cb590fad1

commit e402fc2e336e59a514557c6c1bdb014cb590fad1
Author:     Ross Charles Campbell <rossbridger.cc@gmail.com>
AuthorDate: 2020-12-24 06:05:46 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2020-12-27 04:34:08 +0000

    media-libs/opencv: version bump, remove old
    
     - Added constraint on CPU flags on x86
    
     - Also closed out bugs that wasn't reported reproducible on newer versions
    
    Closes: https://bugs.gentoo.org/751781
    Closes: https://bugs.gentoo.org/703658
    Closes: https://bugs.gentoo.org/706040
    Closes: https://bugs.gentoo.org/721706
    Closes: https://bugs.gentoo.org/689838
    Package-Manager: Portage-3.0.12, Repoman-3.0.2
    Signed-off-by: Ross Charles Campbell <rossbridger.cc@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/18801
    Signed-off-by: Sam James <sam@gentoo.org>

 media-libs/opencv/Manifest                         |  4 ++--
 ...{opencv-4.4.0-r1.ebuild => opencv-4.5.1.ebuild} | 26 +++++++++++++++-------
 2 files changed, 20 insertions(+), 10 deletions(-)