Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 660572 - dev-util/clinfo does not build unless media-libs/mesa builds with USE="opencl"
Summary: dev-util/clinfo does not build unless media-libs/mesa builds with USE="opencl"
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Craig Andrews
URL: https://github.com/Oblomov/clinfo/iss...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-07 00:59 UTC by Michael Crawford (ali3nx)
Modified: 2018-07-08 15:45 UTC (History)
2 users (show)

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


Attachments
clinfo-2.2.18.04.06-build.log (clinfo-2.2.18.04.06-build.log,2.02 KB, application/octet-stream)
2018-07-07 00:59 UTC, Michael Crawford (ali3nx)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Crawford (ali3nx) 2018-07-07 00:59:33 UTC
Created attachment 538658 [details]
clinfo-2.2.18.04.06-build.log

When media-libs/mesa is built with USE="-opencl" dev-util/clinfo will not compile stating that CL/cl.h src/ext.h:24:10: fatal error: CL/cl.h: No such file or directory.

Both currently available ebuild versions for clinfo need a USE flag added for opencl with a dependency on mesa built with USE="opencl"
  
This could be a minor annoyance however with the introduction of ebuilds for dev-libs/amdgpu-pro-opencl as clinfo is also beneficial for diagnostic testing amdgpu compute functionality using this package that does not require mesa built with opencl.

If anyone has a suggestion for addressing being able to use clinfo with mesa build without opencl support for the purpose of solely using amdgpu-pro-opencl without needing to potentially build mesa twice that could be a worthwhile consideration.

>>> Emerging (1 of 1) dev-util/clinfo-2.2.18.03.26::gentoo
 * clinfo-2.2.18.03.26.tar.gz BLAKE2B SHA512 size ;-) ...                                                                                                                                                                             [ ok ]
>>> Unpacking source...
>>> Unpacking clinfo-2.2.18.03.26.tar.gz to /var/tmp/portage/dev-util/clinfo-2.2.18.03.26/work
>>> Source unpacked in /var/tmp/portage/dev-util/clinfo-2.2.18.03.26/work
>>> Preparing source in /var/tmp/portage/dev-util/clinfo-2.2.18.03.26/work/clinfo-2.2.18.03.26 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-util/clinfo-2.2.18.03.26/work/clinfo-2.2.18.03.26 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-util/clinfo-2.2.18.03.26/work/clinfo-2.2.18.03.26 ...
make -j2
cc -march=native -O2 -pipe -std=c99 -Wall -Wextra   -c -o clinfo.o src/clinfo.c
In file included from src/error.h:5:0,
                 from src/clinfo.c:31:
src/ext.h:24:10: fatal error: CL/cl.h: No such file or directory
 #include <CL/cl.h>
          ^~~~~~~~~
compilation terminated.
make: *** [<builtin>: clinfo.o] Error 1
 * ERROR: dev-util/clinfo-2.2.18.03.26::gentoo failed (compile phase):
 *   emake failed

vargur /usr/portage/dev-util/clinfo # emerge -pv mesa

These are the packages that would be merged, in order:

Calculating dependencies                  ... done!
[ebuild   R    ] media-libs/mesa-17.3.9::gentoo  USE="classic dri3 egl gallium gbm llvm nptl pic vaapi vdpau vulkan wayland -bindist -d3d9 -debug -gles1 -gles2 -opencl -openmax -osmesa -pax_kernel (-selinux) -unwind -valgrind -xa -xvmc" ABI_X86="(64) -32 (-x32)" VIDEO_CARDS="i915 intel radeon radeonsi (-freedreno) -i965 (-imx) -nouveau -r100 -r200 -r300 -r600 (-vc4) -virgl (-vivante) -vmware" 0 KiB

vargur # emerge --info
Portage 2.3.40 (python 3.6.5-final-0, default/linux/amd64/17.0/desktop/plasma/systemd, gcc-7.3.0, glibc-2.26-r7, 4.17.4-gentoo x86_64)
=================================================================
System uname: Linux-4.17.4-gentoo-x86_64-Intel-R-_Pentium-R-_CPU_G4560_@_3.50GHz-with-gentoo-2.4.1
KiB Mem:     8028448 total,   2187244 free
KiB Swap:    2097148 total,   2096380 free
Timestamp of repository gentoo: Fri, 06 Jul 2018 00:30:01 +0000
Head commit of repository gentoo: 615edeecfa74bf1040b12d87c0f0cd5b5a24dce8
sh bash 4.4_p12
ld GNU ld (Gentoo 2.30 p2) 2.30.0
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.4_p12::gentoo
dev-lang/perl:            5.24.3-r1::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.6.5::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.15.1-r2::gentoo
sys-devel/binutils:       2.30-r2::gentoo
sys-devel/gcc:            7.3.0-r3::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.26-r7::gentoo
Repositories:

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

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
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/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y --complete-graph y"
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 candy config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en"
MAKEOPTS="-j2"
PKGDIR="/usr/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="/var/tmp"
USE="10bit 12bit X a52 aac acl acpi activities alsa amd64 berkdb bluetooth bluray branding bzip2 cairo caps cdda cdr cjk cli client conntrack cracklib crypt cryptsetup cups cxx dbus declarative device-mapper dri dts dvd dvdr emboss encode exif fam flac fortran gallium gdbm gif glamor gpm gtk iconv idn iproute2 ipv6 ithreads jpeg kde kipi kwallet lcms ldap libnotify libtirpc lz4 lzma lzo mad mng modules mp3 mp4 mpeg multilib nat ncurses netlink nftables nls nptl ogg opengl openmp openssl opus pam pango pcre pdf phonon pic pie plasma png policykit posix ppds pwquality python qml qt5 rar readline samba sdl seccomp semantic-desktop spell ssl startup-notification svg systemd tcpd theora threads tiff truetype udev udisks unicode upower urandom usb user-session v4l v4l2 vaapi vdpau vorbis vulkan widgets wxwidgets x264 x265 xattr xcb xcomposite xml xv xvid zip zlib" ABI_X86="64" 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="ratelimit lbmethod_bybusyness lbmethod_byrequests lbmethod_bytraffic lbmethod_heartbeat http2 cgid unixd authn_core authz_core authz_dbd socache_shmcb apache2_modules_unixd actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status slotmem_shm unique_id userdir usertrack vhost_alias" APACHE2_MPMS="worker" CALLIGRA_FEATURES="karbon plan sheets stage words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" CURL_SSL="openssl" ELIBC="glibc" 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="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-1" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby23" USERLAND="GNU" VIDEO_CARDS="intel i915 amdgpu radeon radeonsi" 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, LANG, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Craig Andrews gentoo-dev 2018-07-07 01:16:44 UTC
What is the output of these commands:
equery belongs cl.h
eselect opencl list

You should have a copy of cl.h provided by app-eselect/eselect-opencl-1.1.0-r4, and clinfo should be using it. If that exists and clinfo isn't finding it, I'll report the issue upstream.
Comment 2 Michael Crawford (ali3nx) 2018-07-07 03:20:54 UTC
vargur ~ # equery belongs cl.h
 * Searching for cl.h ...
app-eselect/eselect-opencl-1.1.0-r4 (/usr/lib64/OpenCL/global/include/CL-1.0/cl.h)
app-eselect/eselect-opencl-1.1.0-r4 (/usr/lib64/OpenCL/global/include/CL-1.1/cl.h)
app-eselect/eselect-opencl-1.1.0-r4 (/usr/lib64/OpenCL/global/include/CL-1.2/cl.h)
app-eselect/eselect-opencl-1.1.0-r4 (/usr/lib64/OpenCL/global/include/CL-2.0/cl.h)
app-eselect/eselect-opencl-1.1.0-r4 (/usr/lib64/OpenCL/global/include/CL-2.1/cl.h)
app-eselect/eselect-opencl-1.1.0-r4 (/usr/include/CL/cl.h -> //usr/lib64/OpenCL/global/include/CL-1.2/cl.h)

vargur /usr/include/CL # eselect opencl list
Available OpenCL implementations:
  [1]   ocl-icd *

** currently do not have mesa build with USE=opencl for testing
Comment 3 Craig Andrews gentoo-dev 2018-07-07 03:35:17 UTC
Reported at https://github.com/Oblomov/clinfo/issues/36
Comment 4 Craig Andrews gentoo-dev 2018-07-07 13:25:29 UTC
Can you run and post the output of:
head -n2 /usr/include/CL/cl.h
Comment 5 Michael Crawford (ali3nx) 2018-07-08 01:59:51 UTC
(In reply to Craig Andrews from comment #4)
> Can you run and post the output of:
> head -n2 /usr/include/CL/cl.h

I've reinstalled since yesterday on the affected gentoo install and now have fully functional amdgpu opencl working.

With that in mind the below output of the above command is from a fresh install with mesa built with USE="opencl"

vargur ~ # head -n2 /usr/include/CL/cl.h
/*******************************************************************************
 * Copyright (c) 2008-2015 The Khronos Group Inc.

I do have a stage4 tarball backup of the install that was used to test this bug and can unpack and chroot to test if there is any discrepancy between the results should it be necessary.
Comment 6 Michael Crawford (ali3nx) 2018-07-08 02:02:59 UTC
vargur ~ # equery belongs cl.h
 * Searching for cl.h ...
app-eselect/eselect-opencl-1.1.0-r4 (/usr/include/CL/cl.h -> //usr/lib64/OpenCL/global/include/CL-1.2/cl.h)
app-eselect/eselect-opencl-1.1.0-r4 (/usr/lib64/OpenCL/global/include/CL-1.2/cl.h)
app-eselect/eselect-opencl-1.1.0-r4 (/usr/lib64/OpenCL/global/include/CL-1.1/cl.h)
app-eselect/eselect-opencl-1.1.0-r4 (/usr/lib64/OpenCL/global/include/CL-1.0/cl.h)
app-eselect/eselect-opencl-1.1.0-r4 (/usr/lib64/OpenCL/global/include/CL-2.0/cl.h)
app-eselect/eselect-opencl-1.1.0-r4 (/usr/lib64/OpenCL/global/include/CL-2.1/cl.h)
media-libs/mesa-17.3.9 (/usr/lib64/OpenCL/vendors/mesa/include/CL/cl.h)


The current results of equery belongs cl.h do not appear to be largely different other than mesa having been built with opencl support
Comment 7 Craig Andrews gentoo-dev 2018-07-08 15:45:02 UTC
Looks like your /usr/include/CL/cl.h was invalid and you have fixed it.