Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*
643 Discussions

Support for GCC's quadmath, syntax of response files and unsupported compiler option

rudi-gaelzer
New Contributor I
273 Views

Using:

Intel(R) oneAPI DPC++/C++ Compiler for applications running on Intel(R) 64, Version 2024.1.2 Build 20240508

 

I'm starting to work with OneAPI's icx compiler and from the start ran into 2 problems:

1. When I try to compile the following example code from the documentation of GCC's quadmath: 

#include <quadmath.h>
#include <stdlib.h>
#include <stdio.h>

int main ()
{
  __float128 r;
  int prec = 20;
  int width = 46;
  char buf[128];

  r = 2.0q;
  r = sqrtq (r);
  int n = quadmath_snprintf (buf, sizeof buf, "%+-#*.20Qe", width, r);
  if ((size_t) n < sizeof buf)
    printf ("%s\n", buf);
    /* Prints: +1.41421356237309504880e+00 */
  quadmath_snprintf (buf, sizeof buf, "%Qa", r);
  if ((size_t) n < sizeof buf)
    printf ("%s\n", buf);
    /* Prints: 0x1.6a09e667f3bcc908b2fb1366ea96p+0 */
  n = quadmath_snprintf (NULL, 0, "%+-#46.*Qe", prec, r);
  if (n > -1)
    {
      char *str = malloc (n + 1);
      if (str)
        {
          quadmath_snprintf (str, n + 1, "%+-#46.*Qe", prec, r);
          printf ("%s\n", str);
          /* Prints: +1.41421356237309504880e+00 */
        }
      free (str);
    }
  return 0;
}

with 

$>icx -c tes_quadmath_snprintf.c

I get the error message:

tes_quadmath_snprintf.c:2:10: fatal error: 'quadmath.h' file not found

When I was using icc, I did not need to explicitly include the path to the headers of  quadmath  in order to compile the code.

I thought that OneAPI was supposed to fully support GCC.  What is the best way to circumvent this error? Should I simply statically include (with '-I') the path to the headers?

 

2.  When I use response files to set the compiler options, according to the documentation here: 

https://www.intel.com/content/www/us/en/docs/dpcpp-cpp-compiler/developer-guide-reference/2024-1/use-response-files.html

it seems that comments starting with '#' can not be included in the file, otherwise a lot of error messages pop up.  For instance, if I create the response1.txt file with 


# response file: response1.txt
# compile with these options
-W0
# end of response1 file

and try to compile with 

$>icx @response1.txt .. 

i get:

icx: error: no such file or directory: '#'
icx: error: no such file or directory: 'response'
icx: error: no such file or directory: 'file:'
icx: error: no such file or directory: '#'
icx: error: no such file or directory: 'compile'
icx: error: no such file or directory: 'with'
icx: error: no such file or directory: 'these'
icx: error: no such file or directory: 'options'
icx: error: no such file or directory: '#'
icx: error: no such file or directory: 'end'
icx: error: no such file or directory: 'of'
icx: error: no such file or directory: 'response1'
icx: error: no such file or directory: 'file'

Is this just a bug?

 

0 Kudos
1 Solution
Alex_Y_Intel
Moderator
137 Views

Yes looks like you need to use that workaround for now. 

icx compiler cannot parse the comments in response files, so that document is wrong, and I will submit an issue ticket. Also please note that -w0 is not supported by icx compiler either, I will submit another issue ticket for that. 

 

View solution in original post

0 Kudos
3 Replies
Alex_Y_Intel
Moderator
174 Views

_Quad type is not supported. If you want compile on Linux with icx, try to include the quad.c under your gcc/x86_64-linux-gnu directory. 

 

0 Kudos
rudi-gaelzer
New Contributor I
149 Views

OK.  That concerns the first question.

Indeed, compiling with 

$>icx -I/usr/lib/gcc/x86_64-redhat-linux/14/include -lquadmath tes_quadmath_snprintf.c

works and produces the same results as when compiling with gcc.

So, for now I'm stuck with this workaround?  Will icx support quadmath in the near future?

 

As for the second question, have you verified that icx does not support comments in response files, contrary to the example in the documentation?

 

0 Kudos
Alex_Y_Intel
Moderator
138 Views

Yes looks like you need to use that workaround for now. 

icx compiler cannot parse the comments in response files, so that document is wrong, and I will submit an issue ticket. Also please note that -w0 is not supported by icx compiler either, I will submit another issue ticket for that. 

 

0 Kudos
Reply