Bug 1263862

Summary: libclc has undeclared dependency on gcc (stddef.h)
Product: [Fedora] Fedora Reporter: Dominik 'Rathann' Mierzejewski <dominik>
Component: libclcAssignee: Fabian Deutsch <fabian.deutsch>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: fabian.deutsch, fdeutsch, ignatenko, jvdelisle, mick
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-01-04 10:01:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dominik 'Rathann' Mierzejewski 2015-09-16 22:06:48 UTC
Description of problem:
/usr/include/clc/clctypes.h includes stddef.h, which is not available when all declared dependencies are installed. Running clinfo shows errors.

Version-Release number of selected component (if applicable):
libclc-0.0.1-9.20140901gite822ae3.fc21.x86_64

How reproducible:
Always

Steps to Reproduce:
1. dnf install clinfo mesa-libOpenCL
2. dnf remove gcc
3. clinfo

Actual results:
[...]
  Max work group size                             256
=== CL_PROGRAM_BUILD_LOG ===
In file included from <built-in>:296:
In file included from <command line>:3:
In file included from /usr/include/clc/clc.h:15:
/usr/include/clc/clctypes.h:3:10: fatal error: 'stddef.h' file not found
  Preferred work group size multiple              In file included from <built-in>:296:
In file included from <command line>:3:
In file included from /usr/include/clc/clc.h:15:
/usr/include/clc/clctypes.h:3:10: fatal error: 'stddef.h' file not found

  Preferred / native vector sizes                 
    char                                                16 / 16      
[...]

Expected results:
[...]
  Max work group size                             256
  Preferred work group size multiple              1
  Preferred / native vector sizes                 
    char                                                16 / 16      
[...]

Additional info:
$ rpm -ql gcc |grep stddef.h
/usr/lib/gcc/x86_64-redhat-linux/4.9.2/include/stddef.h

Also, why are there headers in a package without -devel in its name?
$ rpm -ql libclc |egrep '/usr/include/.*\.h$' |wc -l
100

Why does the libclc-devel package contain only its pkg-config file?
$ rpm -ql libclc-devel
/usr/lib64/pkgconfig/libclc.pc
$

Comment 1 Fedora End Of Life 2015-11-04 10:29:43 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 2 Dominik 'Rathann' Mierzejewski 2015-11-04 11:29:34 UTC
I don't have any hardware supported by mesa-libOpenCL running F22 yet, but the F22 package doesn't have the required stddef.h dependency either:

$ grep stddef /usr/include/clc/clctypes.h 
#include <stddef.h>
$ rpm -qf /usr/include/clc/clctypes.h
libclc-0.0.1-9.20140901gite822ae3.fc22.x86_64
$ rpm -qR libclc
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1

Comment 3 Jerry 2015-11-09 20:55:40 UTC
I can confirm.  I can not build OpenCL or many of the AMD SDK samples.

Also the precompiled binaries will not run:

This error message is on current F22:

/usr/include/clc/clctypes.h:3:10: fatal error: 'stddef.h' file not found

Comment 4 Jerry 2015-11-09 20:59:03 UTC
clinfo on Fedora 22 gives

In file included from /usr/include/clc/clc.h:15:
/usr/include/clc/clctypes.h:3:10: fatal error: 'stddef.h' file not found

This is running on AMD APU

  Platform Name                                   Clover
Number of devices                                 1
  Device Name                                     AMD SUMO
  Device Vendor                                   AMD
  Device Vendor ID                                0x1002
  Device Version                                  OpenCL 1.1 MESA 10.6.9
  Driver Version                                  10.6.9
  Device OpenCL C Version                         OpenCL C 1.1 
  Device Type                                     GPU
  Device Profile                                  FULL_PROFILE
  Max compute units                               4
  Max clock frequency                             0MHz
  Max work item dimensions                        3
  Max work item sizes                             256x256x256
  Max work group size                             256
=== CL_PROGRAM_BUILD_LOG ===
In file included from <built-in>:296:
In file included from <command line>:2:
In file included from /usr/include/clc/clc.h:15:
/usr/include/clc/clctypes.h:3:10: fatal error: 'stddef.h' file not found
  Preferred work group size multiple              In file included from <built-in>:296:
In file included from <command line>:2:
In file included from /usr/include/clc/clc.h:15:
/usr/include/clc/clctypes.h:3:10: fatal error: 'stddef.h' file not found

Comment 5 Dominik 'Rathann' Mierzejewski 2015-12-27 00:37:45 UTC
It looks like this is no longer an issue on F23:
$ rpm -qf /usr/include/clc/clctypes.h
libclc-0.0.1-11.20150918git4346c30.fc23.x86_64
$ grep stddef /usr/include/clc/clctypes.h 
$ rpm -q gcc
package gcc is not installed

clinfo works, as well.

Comment 6 Fabian Deutsch 2016-01-04 10:01:00 UTC
Nice!