[Bug 1895358] Re: [Bug] A simple code including tgmath.h cannot be compiled with icc with Ubuntu 20.04 OS

Balint Reczey 1895358 at bugs.launchpad.net
Mon Jan 25 19:01:32 UTC 2021


Verified 2.31-0ubuntu9.2 on Focal:

root at ff-icc:~# /opt/intel/oneapi/compiler/2021.1.2/linux/bin/intel64/icc -c test.c
In file included from /opt/intel/oneapi/compiler/2021.1.2/linux/bin/intel64/../../compiler/include/icc/tgmath.h(25),
                 from test.c(1):
/usr/include/tgmath.h(54): error: #error directive: "Unsupported combination of types for <tgmath.h>."
  #  error "Unsupported combination of types for <tgmath.h>."
     ^

compilation aborted for test.c (code 2)
root at ff-icc:~# dpkg -l libc6-dev
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name            Version         Architecture Description
+++-===============-===============-============-=====================================================
ii  libc6-dev:amd64 2.31-0ubuntu9.1 amd64        GNU C Library: Development Libraries and Header Files
root at ff-icc:~# sed -i s/backports/proposed/ /etc/apt/sources.list
root at ff-icc:~# apt update
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Get:3 http://archive.ubuntu.com/ubuntu focal-proposed InRelease [267 kB]
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease
Get:5 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 Packages [213 kB]
Hit:6 https://apt.repos.intel.com/oneapi all InRelease                               
Get:7 http://archive.ubuntu.com/ubuntu focal-proposed/main Translation-en [51.6 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 c-n-f Metadata [2524 B]
Get:9 http://archive.ubuntu.com/ubuntu focal-proposed/restricted amd64 Packages [36.5 kB]
Get:10 http://archive.ubuntu.com/ubuntu focal-proposed/restricted Translation-en [5460 B]
Get:11 http://archive.ubuntu.com/ubuntu focal-proposed/restricted amd64 c-n-f Metadata [116 B]
Get:12 http://archive.ubuntu.com/ubuntu focal-proposed/universe amd64 Packages [51.9 kB]
Get:13 http://archive.ubuntu.com/ubuntu focal-proposed/universe Translation-en [24.3 kB]
Get:14 http://archive.ubuntu.com/ubuntu focal-proposed/universe amd64 c-n-f Metadata [1612 B]
Get:15 http://archive.ubuntu.com/ubuntu focal-proposed/multiverse amd64 Packages [704 B]
Get:16 http://archive.ubuntu.com/ubuntu focal-proposed/multiverse Translation-en [3752 B]
Get:17 http://archive.ubuntu.com/ubuntu focal-proposed/multiverse amd64 c-n-f Metadata [192 B]
Fetched 658 kB in 1s (831 kB/s)          
Reading package lists... Done
Building dependency tree       
Reading state information... Done
25 packages can be upgraded. Run 'apt list --upgradable' to see them.
root at ff-icc:~# apt install libc6-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libfreetype6 libpciaccess0
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  libc-dev-bin libc6
Suggested packages:
  glibc-doc
The following packages will be upgraded:
  libc-dev-bin libc6 libc6-dev
3 upgraded, 0 newly installed, 0 to remove and 22 not upgraded.
Need to get 5306 kB of archives.
After this operation, 6144 B of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 libc6-dev amd64 2.31-0ubuntu9.2 [2520 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 libc-dev-bin amd64 2.31-0ubuntu9.2 [71.8 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 libc6 amd64 2.31-0ubuntu9.2 [2715 kB]
Fetched 5306 kB in 1s (4268 kB/s)
Preconfiguring packages ...
(Reading database ... 49023 files and directories currently installed.)
Preparing to unpack .../libc6-dev_2.31-0ubuntu9.2_amd64.deb ...
Unpacking libc6-dev:amd64 (2.31-0ubuntu9.2) over (2.31-0ubuntu9.1) ...
Preparing to unpack .../libc-dev-bin_2.31-0ubuntu9.2_amd64.deb ...
Unpacking libc-dev-bin (2.31-0ubuntu9.2) over (2.31-0ubuntu9.1) ...
Preparing to unpack .../libc6_2.31-0ubuntu9.2_amd64.deb ...
Unpacking libc6:amd64 (2.31-0ubuntu9.2) over (2.31-0ubuntu9.1) ...
Setting up libc6:amd64 (2.31-0ubuntu9.2) ...
Setting up libc-dev-bin (2.31-0ubuntu9.2) ...
Setting up libc6-dev:amd64 (2.31-0ubuntu9.2) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.1) ...
root at ff-icc:~# /opt/intel/oneapi/compiler/2021.1.2/linux/bin/intel64/icc -c test.c
root at ff-icc:~# dpkg -l libc6-dev
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name            Version         Architecture Description
+++-===============-===============-============-=====================================================
ii  libc6-dev:amd64 2.31-0ubuntu9.2 amd64        GNU C Library: Development Libraries and Header Files
root at ff-icc:~# cat test.c 
#include <tgmath.h>


** Tags removed: verification-needed verification-needed-focal
** Tags added: verification-done verification-done-focal

** Changed in: intel
       Status: Incomplete => Invalid

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to glibc in Ubuntu.
https://bugs.launchpad.net/bugs/1895358

Title:
  [Bug] A simple code including tgmath.h cannot be compiled with icc
  with Ubuntu 20.04 OS

Status in intel:
  Invalid
Status in glibc package in Ubuntu:
  Fix Released
Status in glibc source package in Focal:
  Fix Committed
Status in glibc source package in Groovy:
  Fix Committed

Bug description:
  [Impact]

   A simple code including tgmath.h cannot be compiled with icc with
  Ubuntu 20.04 OS and later releases.

  [Test Case]
  icc:
   Compile the following code with Intel compiler (icc) by running “icc -c test.c”

  $ cat test.c
  #include <tgmath.h>

  There should not be any compilation error

  
  [Where problems could occur]

  The fix is dropping compile time check preventing using float128 with
  icc. In case of a mistake using float128 becomes prevented in other
  compilers as well, but this is highly unlikely, since the vanilla
  upstream code is known to work.

  Older icc compilers (for which the patch has been introduced) will
  stop compiling code with the _fixed_ tgmath.h because of LP: #1717257.

  Users can still install older icc compilers from 3rd party sources,
  but there is no good way of avoiding that. They can still override the
  packaged tgmath.h.

  [Original Bug Text]

  [Summary]: A simple code including tgmath.h cannot be compiled with
  icc with Ubuntu 20.04 OS

  [Ubuntu OS version]: 20.04

  [Reproduce Steps]: Compile the following code with Intel compiler
  (icc) by running “icc -c test.c”

  $ cat test.c
  #include <tgmath.h>

  [Results]
  Expected: There should not be any compilation error

  Actual: The following error is produced:

  $ icc -c test.c
  In file included from /localdisk2/mkl/aakkas/20200721_rls/lnx/compiler/latest/linux/bin/intel64/../../compiler/include/icc/tgmath.h(25),
                   from test.c(1):
  /usr/include/tgmath.h(54): error: #error directive: "Unsupported combination of types for <tgmath.h>."
    #  error "Unsupported combination of types for <tgmath.h>."
       ^

  compilation aborted for test.c (code 2)

  [Additional Information on Test setup]:

  ICC compiler supports the __float128 type if the reference compiler is
  more recent than GNU version 4.4. Therefore, __HAVE_FLOAT128 should be
  set to 1 when ICC compiler is used with GNU version higher than 4.4.
  Based on this, I believe that the red part below in floatn.h, which
  comes with Ubuntu OS, should be updated/removed.

  #if (defined __x86_64__                                                 \
       ? __GNUC_PREREQ (4, 3)                                             \
       : (defined __GNU__ ? __GNUC_PREREQ (4, 5) : __GNUC_PREREQ (4, 4))) \
       &&  !defined(__CUDACC__) && !defined(__ICC)
  # define __HAVE_FLOAT128 1
  #else
  # define __HAVE_FLOAT128 0
  #endif

  Currently, when the tgmath.h system header file is included on Ubuntu
  20.04 OS system,  __HAVE_FLOAT128 is set to zero and __HAVE_FLOAT64X
  set to 1 for ICC. And this is not a supported combination as checked
  in the new tgmath.h system header file:

  # if ((__HAVE_FLOAT64X && !__HAVE_FLOAT128)             \
        || (__HAVE_FLOAT128 && !__HAVE_FLOAT64X))
  #  error "Unsupported combination of types for <tgmath.h>."
  # endif

  Upstream bug: Not known
  =========================================

To manage notifications about this bug go to:
https://bugs.launchpad.net/intel/+bug/1895358/+subscriptions



More information about the foundations-bugs mailing list