Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 668140 - media-libs/mesa-18.2.2-r1 and dev-libs/ocl-icd-2.2.12 and app-eselect/eselect-opencl-1.1.0-r4 and virtual/opencl-0-r5 - /usr/include/CL contains broken symlinks
Summary: media-libs/mesa-18.2.2-r1 and dev-libs/ocl-icd-2.2.12 and app-eselect/eselect...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2018-10-09 09:00 UTC by Dennis Schridde
Modified: 2018-10-28 02:20 UTC (History)
7 users (show)

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


Attachments
wine build log (build.log,102.96 KB, text/x-log)
2018-10-21 12:49 UTC, Eugene Shalygin
Details
ocl-icd build log (build.log,39.24 KB, text/x-log)
2018-10-21 12:51 UTC, Eugene Shalygin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Schridde 2018-10-09 09:00:25 UTC
```
# ll /usr/include/CL                         
total 32K                                            
lrwxrwxrwx 1 root root 49 Apr 18 23:02 cl_egl.h -> //usr/lib64/OpenCL/global/include/CL-1.2/cl_egl.h                                                                                                                                                                                                                                                                        
lrwxrwxrwx 1 root root 51 Oct  6 22:55 cl_ext.h -> ../../lib64/OpenCL/vendors/mesa/include/CL/cl_ext.h                                                                                                                                                                                                                                                                      
lrwxrwxrwx 1 root root 54 Oct  6 22:55 cl_gl_ext.h -> ../../lib64/OpenCL/vendors/mesa/include/CL/cl_gl_ext.h
lrwxrwxrwx 1 root root 50 Oct  6 22:55 cl_gl.h -> ../../lib64/OpenCL/vendors/mesa/include/CL/cl_gl.h                                                                                                                                                                                                                                                                        
lrwxrwxrwx 1 root root 47 Oct  6 22:55 cl.h -> ../../lib64/OpenCL/vendors/mesa/include/CL/cl.h
lrwxrwxrwx 1 root root 49 Oct  6 22:55 cl.hpp -> ../../lib64/OpenCL/vendors/mesa/include/CL/cl.hpp
lrwxrwxrwx 1 root root 56 Oct  6 22:55 cl_platform.h -> ../../lib64/OpenCL/vendors/mesa/include/CL/cl_platform.h
lrwxrwxrwx 1 root root 51 Oct  6 22:55 opencl.h -> ../../lib64/OpenCL/vendors/mesa/include/CL/opencl.h
```

All but cl_egl.h are broken symlinks.  Packages trying to build against OpenCL fail to do so.


Portage 2.3.51 (python 2.7.13-final-42, default/linux/amd64/17.1/desktop/plasma/systemd, gcc-8.2.0, glibc-2.27-r6, 4.18.11-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.18.11-gentoo-x86_64-AMD_Ryzen_5_2400G_with_Radeon_Vega_Graphics-with-gentoo-2.6
KiB Mem:    15258936 total,    215976 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Tue, 09 Oct 2018 06:45:01 +0000
Head commit of repository gentoo: 24ce157947b89217937d883202a924b215fc7a68
Head commit of repository flatpak-overlay: c53e0b55cb8753486a98c0ddf7b63f20e2e6be78

Timestamp of repository gnome: Sun, 07 Oct 2018 21:43:48 +0000
Head commit of repository gnome: 322cccb2d84a85510bf7fb09089423769434748d

Timestamp of repository steam-overlay: Wed, 03 Oct 2018 02:36:12 +0000
Head commit of repository steam-overlay: 54efff6f7b6206dfbc62b33b8d2a537a6d8ef589

Head commit of repository local: 97d26f4487412e1d19f079607d7ca2ad1dc2326f

sh bash 4.4_p23
ld GNU ld (Gentoo 2.31.1 p3) 2.31.1
ccache version 3.4.3 [disabled]
app-shells/bash:          4.4_p23::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.26.2::gentoo
dev-lang/python:          2.7.15::gentoo, 3.6.6::gentoo, 3.7.0::gentoo
dev-util/ccache:          3.4.3::gentoo
dev-util/cmake:           3.12.3::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r3::gentoo, 1.13.4-r2::gentoo, 1.15.1-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.31.1-r1::gentoo
sys-devel/gcc:            8.2.0-r3::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.17::gentoo (virtual/os-headers)
sys-libs/glibc:           2.27-r6::gentoo
Repositories:

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

flatpak-overlay
    location: /var/db/repos/flatpak-overlay
    sync-type: git
    sync-uri: https://github.com/fosero/flatpak-overlay.git
    masters: gentoo

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

steam-overlay
    location: /var/db/repos/steam-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/steam-overlay.git
    masters: gentoo

local
    location: /var/cache/portage/local
    sync-type: git
    sync-uri: https://github.com/devurandom/gentoo-overlay.git
    masters: gentoo gnome
    priority: 1000

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-pipe -O2 -march=znver1"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/grs/systems.conf /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/php/apache2-php7.2/ext-active/ /etc/php/cgi-php7.2/ext-active/ /etc/php/cli-php7.2/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="-pipe -O2 -march=znver1"
DISTDIR="/var/cache/portage/distfiles"
EMERGE_DEFAULT_OPTS="--keep-going --nospinner --verbose-conflicts"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY 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="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildsyspkg cgroup compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ftp.spline.inf.fu-berlin.de/mirrors/gentoo/ http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/ http://distfiles.gentoo.org"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
MAKEOPTS="-j6 -l4"
PKGDIR="/var/cache/portage/packages"
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="/tmp"
USE="X a52 aac aacplus aacs acl acpi activities aio alsa amd64 appindicator appstream archive audit avahi ayatana bash-completion bdplus berkdb bluetooth bluray branding bs2b btrfs bzip2 cairo caps cdda cddb cdio cdr celt chromaprint cjk clang cli colord colorio conntrack crypt cups cxx d3d9 dbus declarative device-mapper dirac djvu dri drm dts dvb dvd dvdr editorconfig egl elf emboss encode epub exif fam fax fbcon ffmpeg fftw firefox firewalld fish-completion fits flac fontconfig fontforge fortran fribidi gbm gdbm geoclue geolocation gif git glamor gles gmp google googledrive gpg gps graphicsmagick gstreamer gtk gtk3 harfbuzz hdf5 http2 ibus iconv icu idn imlib inotify introspection ipv6 jemalloc jpeg jpeg2k json kde kipi kms kwallet ladspa latex lcms ldap libatomic libidn2 libinput libnotify libproxy libsecret libsoxr libtirpc libvirt lm_sensors lv2 lvm lz4 lzma lzo mad markdown mbim mercurial metis mjpeg mng mobi modemmanager modplug mp3 mp4 mpeg mplayer mpris mtp multilib mysql ncurses netlink networkmanager nls nptl office ogg openal opencl opencv openexr opengl openh264 openmax openmp opus pam pango pcap pch pcre pcre2 pdf pgo phonon pixman plasma png policykit postscript ppds prison pulseaudio python qml qt5 raw readline redfish samba sasl scanner schroedinger sctp sdl sdl2 seccomp semantic-desktop share snappy sparse speech speex spell ssl startup-notification steamruntime stemmer svg systemd tbb tcpd teamd telepathy tga theora threads tiff timezone truetype tslib udev udisks unicode unwind upnp upnp-av upower usb utempter v4l v4l2 vaapi vkd3d vorbis vpx vulkan wasm wavpack wayland webchannel webengine webp widgets wmf wps x264 x265 xattr xcb xcomposite xinerama xkb xml xmp xrandr xscreensaver xv xvid xwayland xz yaml zeroconf zeromq zlib zstd" ABI_X86="64" ALSA_CARDS="hda-intel" 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 plan sheets stage words" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" ENLIGHTENMENT_MODULES="*" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock 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="joystick libinput" KERNEL="linux" L10N="de de-DE en en-GB ar fa tr ja ko zh zh-CN zh-TW" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LIRC_DEVICES="devinput" LLVM_TARGETS="AMDGPU BPF" LUA_TARGET="lua5-2" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6 pypy pypy3" QEMU_SOFTMMU_TARGETS="riscv32 riscv64 x86_64" QEMU_USER_TARGETS="riscv32 riscv64" RUBY_TARGETS="ruby23" STEAMGAMES="dirt_rally dont_starve portal source_engine te120 trine2 witcher2" USERLAND="GNU" VIDEO_CARDS="amdgpu virgl" 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, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

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

media-libs/mesa-18.2.2-r1::gentoo was built with the following:
USE="d3d9 dri3 egl gallium gbm gles2 llvm lm_sensors opencl osmesa unwind vaapi vulkan wayland -classic -debug -gles1 -pax_kernel -pic (-selinux) -test -valgrind -vdpau -xa -xvmc" ABI_X86="32 (64) (-x32)" VIDEO_CARDS="radeonsi virgl (-freedreno) -i915 -i965 (-imx) -intel -nouveau -r100 -r200 -r300 -r600 -radeon (-vc4) (-vivante) -vmware"
CFLAGS="-pipe -O2 -march=znver1 -g"
CXXFLAGS="-pipe -O2 -march=znver1 -g"


dev-libs/ocl-icd-2.2.12::gentoo was built with the following:
USE="" ABI_X86="(64) -32 (-x32)"


app-eselect/eselect-opencl-1.1.0-r4::gentoo was built with the following:
USE="" ABI_X86="(64)"


virtual/opencl-0-r5::gentoo was built with the following:
USE="" ABI_X86="32 (64) (-x32)" VIDEO_CARDS="amdgpu -i965 -nvidia"
Comment 1 Dennis Schridde 2018-10-09 09:01:34 UTC
Possibly related:

$ sudo eselect opencl set mesa
!!! Error: The mesa OpenCL implementation doesn't seem to provide
!!! Error: libOpenCL.so file. This might be an effect of breakage introduced
!!! Error: by a prioprietary driver installer. Please re-merge the package
!!! Error: providing your OpenCL implementation.
!!! Error: Selected OpenCL implementation incomplete.
exiting
Comment 2 Karl-Johan Karlsson 2018-10-09 11:18:57 UTC
Something weird is going on with Mesa 18.2.2-r1 and bug #546320. I no longer have any OpenCL include files, either from media-libs/mesa-18.2.2-r1 or dev-libs/ocl-icd-2.2.12.

Looking at the ebuild, the code for installing the headers seems to have been deliberately removed from -r1, but I can't see what it's supposed to have been replaced with:

root@luna mesa # diff -u mesa-18.2.2.ebuild mesa-18.2.2-r1.ebuild
[...]
@@ -488,21 +486,6 @@
 
 multilib_src_install() {
        meson_src_install
-
-       if use opencl; then
-               ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching"
-               local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa"
-               dodir ${cl_dir}/{lib,include}
-               if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then
-                       mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \
-                       "${ED}"${cl_dir}
-               fi
-               if [ -f "${ED}/usr/include/CL/opencl.h" ]; then
-                       mv -f "${ED}"/usr/include/CL \
-                       "${ED}"${cl_dir}/include
-               fi
-               eend $?
-       fi
 }
Comment 3 Matt Turner gentoo-dev 2018-10-09 15:48:21 UTC
Cc'ing Jan.
Comment 4 Jan Vesely 2018-10-10 05:57:40 UTC
(In reply to Matt Turner from comment #3)
> Cc'ing Jan.

Look's like the problem is that ocl-icd is an opencl provider but does not provide CL headers.
Comment 5 Dennis Schridde 2018-10-10 06:14:39 UTC
(In reply to Jan Vesely from comment #4)
> (In reply to Matt Turner from comment #3)
> > Cc'ing Jan.
> 
> Look's like the problem is that ocl-icd is an opencl provider but does not
> provide CL headers.

That is because app-eselect/eselect-opencl-1.1.0-r4 itself provides them:
# q file -v /usr/lib64/OpenCL/global/include/CL-*
app-eselect/eselect-opencl-1.1.0-r4 (/usr/lib64/OpenCL/global/include/CL-1.0)
app-eselect/eselect-opencl-1.1.0-r4 (/usr/lib64/OpenCL/global/include/CL-1.1)
app-eselect/eselect-opencl-1.1.0-r4 (/usr/lib64/OpenCL/global/include/CL-1.2)
app-eselect/eselect-opencl-1.1.0-r4 (/usr/lib64/OpenCL/global/include/CL-2.0)
app-eselect/eselect-opencl-1.1.0-r4 (/usr/lib64/OpenCL/global/include/CL-2.1)

Apparently it was just forgotten to link one of them into the right location (/usr/include/CL).
Comment 6 Jan Vesely 2018-10-10 06:58:25 UTC
(In reply to Dennis Schridde from comment #5)
> (In reply to Jan Vesely from comment #4)
> > (In reply to Matt Turner from comment #3)
> > > Cc'ing Jan.
> > 
> > Look's like the problem is that ocl-icd is an opencl provider but does not
> > provide CL headers.
> 
> That is because app-eselect/eselect-opencl-1.1.0-r4 itself provides them:
> # q file -v /usr/lib64/OpenCL/global/include/CL-*
> app-eselect/eselect-opencl-1.1.0-r4 (/usr/lib64/OpenCL/global/include/CL-1.0)
> app-eselect/eselect-opencl-1.1.0-r4 (/usr/lib64/OpenCL/global/include/CL-1.1)
> app-eselect/eselect-opencl-1.1.0-r4 (/usr/lib64/OpenCL/global/include/CL-1.2)
> app-eselect/eselect-opencl-1.1.0-r4 (/usr/lib64/OpenCL/global/include/CL-2.0)
> app-eselect/eselect-opencl-1.1.0-r4 (/usr/lib64/OpenCL/global/include/CL-2.1)
> 
> Apparently it was just forgotten to link one of them into the right location
> (/usr/include/CL).

That would be another solution. https://github.com/gentoo/gentoo/pull/10122 modifies ocl-icd to install khronos headers, dunno which one is preferred.
Comment 7 Dennis Schridde 2018-10-10 12:52:20 UTC
Not sure how the dependency graph actually looks like, but wouldn't it be easier to structure it like this?

virtual/opencl depends on:
  - media-libs/opencl-headers
  - dev-libs/ocl-icd # loader
  - one of: # actual implementation
    - media-libs/mesa
    - ...

media-libs/opencl-headers-1.2:0 (e.g.) would contain the official Khronos OpenCL headers for OpenCL 1.2 in /usr/include/CL.  app-eselect/eselect-opencl would no longer be necessary, since the libraries would be selected at runtime by dev-libs/ocl-icd and the headers would be selected at installation time using the slot for media-libs/opencl-headers.

You could even have multiple virtual/opencl versions, each depending on the corresponding media-libs/opencl-headers package and only those implementations (or versions thereof) that support this version of OpenCL.
Comment 8 Jan Vesely 2018-10-10 15:12:21 UTC
(In reply to Dennis Schridde from comment #7)
> Not sure how the dependency graph actually looks like, but wouldn't it be
> easier to structure it like this?
> 
> virtual/opencl depends on:
>   - media-libs/opencl-headers
>   - dev-libs/ocl-icd # loader
>   - one of: # actual implementation
>     - media-libs/mesa
>     - ...
> 
> media-libs/opencl-headers-1.2:0 (e.g.) would contain the official Khronos
> OpenCL headers for OpenCL 1.2 in /usr/include/CL. 
> app-eselect/eselect-opencl would no longer be necessary, since the libraries
> would be selected at runtime by dev-libs/ocl-icd and the headers would be
> selected at installation time using the slot for media-libs/opencl-headers.
> 
> You could even have multiple virtual/opencl versions, each depending on the
> corresponding media-libs/opencl-headers package and only those
> implementations (or versions thereof) that support this version of OpenCL.

I'm not sure about the metric for 'easier', it would require modifications of all packages providing opencl implementation.
Restricting loader to ocl-icd and droping ocl-icd sounds appealing (Matt proposed something like that in the original PR[0]), but:
a) we need to be sure that all opencl implementatoins can provide ICD
b) there is no reason to ever prefer other loaders than ocl-icd

[0] https://github.com/gentoo/gentoo/pull/9836
Comment 9 Dennis Schridde 2018-10-11 06:39:51 UTC
(In reply to Jan Vesely from comment #8)
> I'm not sure about the metric for 'easier', it would require modifications
> of all packages providing opencl implementation.

I guess this largely depends on how many OpenCL implementations we have.  If it was just a handful, I wouldn't think it's too much work.

> Restricting loader to ocl-icd and droping ocl-icd

?
Comment 10 Jan Vesely 2018-10-11 08:42:45 UTC
(In reply to Dennis Schridde from comment #9)
> (In reply to Jan Vesely from comment #8)
> > I'm not sure about the metric for 'easier', it would require modifications
> > of all packages providing opencl implementation.
> 
> I guess this largely depends on how many OpenCL implementations we have.  If
> it was just a handful, I wouldn't think it's too much work.

it's mostly about testing, and checking that there is no reason (like a special feature) to prefer other loader. I counted 5 packages that provide opencl implementation (and depend on ocl-icd):
dev-libs/amdgpu-pro-opencl
dev-libs/beignet (this one is on life support upstream, dunno if anyone is looking into packaging NEO)
dev-util/intel-ocl-sdk
media-libs/mesa
x11-drivers/nvidia-drivers

I was mainly interested in mesa, because mesa opencl can't load other ICD drivers. afaik both intel-ocl-sdk and beignet can (I've never used the other implementations)

> > Restricting loader to ocl-icd and droping ocl-icd
> 
> ?

dropping eselect-opencl of course
Comment 11 Jan Vesely 2018-10-20 20:33:28 UTC
ocl-icd-2.2.12[khronos-headers] should fix this
Comment 12 Eugene Shalygin 2018-10-20 21:15:56 UTC
(In reply to Jan Vesely from comment #11)
> ocl-icd-2.2.12[khronos-headers] should fix this

But it does not. Building wine:

configure: error: OpenCL development files not found, OpenCL won't be supported.
This is an error since --with-opencl was requested.

# eselect opencl list                                                                                                    
Available OpenCL implementations:
  [1]   ocl-icd *

$ eix ocl-icd | grep Installed
     Installed versions:  2.2.12(23:12:40 2018-10-20)(khronos-headers ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="64 -32 -x32")
Comment 13 Jan Vesely 2018-10-21 05:35:51 UTC
(In reply to Eugene Shalygin from comment #12)
> (In reply to Jan Vesely from comment #11)
> > ocl-icd-2.2.12[khronos-headers] should fix this
> 
> But it does not. Building wine:
> 
> configure: error: OpenCL development files not found, OpenCL won't be
> supported.
> This is an error since --with-opencl was requested.
> 
> # eselect opencl list                                                       
> 
> Available OpenCL implementations:
>   [1]   ocl-icd *
> 
> $ eix ocl-icd | grep Installed
>      Installed versions:  2.2.12(23:12:40 2018-10-20)(khronos-headers
> ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="64
> -32 -x32")

can you post the result of `ls -l /usr/include/CL` and the build log of ocl-icd[khronos-headers]?
Comment 14 Eugene Shalygin 2018-10-21 12:48:40 UTC
ls -l /usr/include/CL
total 28
lrwxrwxrwx 1 root root 50 Oct 20 23:12 cl.h -> ../../lib64/OpenCL/vendors/ocl-icd/include/CL/cl.h
lrwxrwxrwx 1 root root 49 Dec  1  2017 cl_egl.h -> //usr/lib64/OpenCL/global/include/CL-1.2/cl_egl.h
lrwxrwxrwx 1 root root 54 Oct 20 23:12 cl_ext.h -> ../../lib64/OpenCL/vendors/ocl-icd/include/CL/cl_ext.h
lrwxrwxrwx 1 root root 53 Oct 20 23:12 cl_gl.h -> ../../lib64/OpenCL/vendors/ocl-icd/include/CL/cl_gl.h
lrwxrwxrwx 1 root root 57 Oct 20 23:12 cl_gl_ext.h -> ../../lib64/OpenCL/vendors/ocl-icd/include/CL/cl_gl_ext.h
lrwxrwxrwx 1 root root 59 Oct 20 23:12 cl_platform.h -> ../../lib64/OpenCL/vendors/ocl-icd/include/CL/cl_platform.h
lrwxrwxrwx 1 root root 54 Oct 20 23:12 opencl.h -> ../../lib64/OpenCL/vendors/ocl-icd/include/CL/opencl.h
Comment 15 Eugene Shalygin 2018-10-21 12:49:31 UTC
Created attachment 552086 [details]
wine build log
Comment 16 Eugene Shalygin 2018-10-21 12:51:14 UTC
Created attachment 552088 [details]
ocl-icd build log
Comment 17 Jan Vesely 2018-10-21 16:31:04 UTC
(In reply to Eugene Shalygin from comment #14)
> ls -l /usr/include/CL
> total 28
> lrwxrwxrwx 1 root root 50 Oct 20 23:12 cl.h ->
> ../../lib64/OpenCL/vendors/ocl-icd/include/CL/cl.h
> lrwxrwxrwx 1 root root 49 Dec  1  2017 cl_egl.h ->
> //usr/lib64/OpenCL/global/include/CL-1.2/cl_egl.h
> lrwxrwxrwx 1 root root 54 Oct 20 23:12 cl_ext.h ->
> ../../lib64/OpenCL/vendors/ocl-icd/include/CL/cl_ext.h
> lrwxrwxrwx 1 root root 53 Oct 20 23:12 cl_gl.h ->
> ../../lib64/OpenCL/vendors/ocl-icd/include/CL/cl_gl.h
> lrwxrwxrwx 1 root root 57 Oct 20 23:12 cl_gl_ext.h ->
> ../../lib64/OpenCL/vendors/ocl-icd/include/CL/cl_gl_ext.h
> lrwxrwxrwx 1 root root 59 Oct 20 23:12 cl_platform.h ->
> ../../lib64/OpenCL/vendors/ocl-icd/include/CL/cl_platform.h
> lrwxrwxrwx 1 root root 54 Oct 20 23:12 opencl.h ->
> ../../lib64/OpenCL/vendors/ocl-icd/include/CL/opencl.h
This looks like the broken symlinks are fixed.

(In reply to Eugene Shalygin from comment #15)
> Created attachment 552086 [details]
> wine build log
Even wine finds them (from the log):
> checking CL/cl.h usability... yes
> checking CL/cl.h presence... yes
> checking for CL/cl.h... yes
The problem is in linking to libOpenCL.so:
> checking for clGetPlatformInfo in -lOpenCL... no
> configure: error: OpenCL development files not found, OpenCL won't be supported.
> This is an error since --with-opencl was requested.
which is expected since the error happens in 32bit configure:
> * abi_x86_32.x86: running multilib-minimal_abi_src_configure
but you didn't build ocl-icd with 32bit support:
> $ eix ocl-icd | grep Installed
>     Installed versions:  2.2.12(23:12:40 2018-10-20)(khronos-headers ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="64 -32 -x32")
Comment 18 Eugene Shalygin 2018-10-21 16:39:46 UTC
I was happy to help you to locate a problem in either app-emulation/wine-any or virtual/opencl ebuild.
Comment 19 Jan Vesely 2018-10-24 02:11:52 UTC
(In reply to Eugene Shalygin from comment #18)
> I was happy to help you to locate a problem in either app-emulation/wine-any
> or virtual/opencl ebuild.

actually, it's neither. These patches https://github.com/gentoo/gentoo/pull/10209 should help address it. If not please open a new bug report.
Comment 20 Jan Vesely 2018-10-28 02:20:34 UTC
(In reply to Eugene Shalygin from comment #18)
> I was happy to help you to locate a problem in either app-emulation/wine-any
> or virtual/opencl ebuild.

mesa-18.2.3 should now correctly pull in 32bit ocl-icd