OpenCL-Headers icon indicating copy to clipboard operation
OpenCL-Headers copied to clipboard

Which compilers, compiler options, and C/C++ standard versions do the headers support?

Open bashbaug opened this issue 5 years ago • 5 comments

We haven't documented which compilers and compiler options including C and C++ standard versions the headers support, which makes it difficult to determine if issues like #115 and #121 are header issues or unsupported configurations. We should document (and test for!) the compilers and compiler options we're intending to support and be clear that other configurations may not work or have limitations.

FWIW, there is a similar issue already for the C++ bindings: https://github.com/KhronosGroup/OpenCL-CLHPP/issues/78

bashbaug avatar Oct 06 '20 22:10 bashbaug

I'm currently cooking up Github Actions CI, which I intend on propagating through the OpenCL repos (Headers, CLHPP, ICD, SDK). In the specific case of the C headers, I'm initially looking to implement this matrix:

Linux

  • COMP: GCC-7, GCC-8, GCC-9, LLVM-9, LLVM-10, LLVM-11
  • STD: c90, c99, c11, c18, gnu90, gnu99, gnu11, gnu18
  • GEN: GNU Makefiles, Ninja
  • VAR: Debug, Release

Windows

  • COMP: MSVC-v140, MSVC-v141, MSVC-v142, LLVM-9, LLVM-10, LLVM-11
  • STD: c90, c11, ms90
  • GEN: MSBuild, Ninja
  • VAR: Debug, Release

MacOS

  • COMP: ? (Need little help with defining a reasonable compiler set)
  • STD: c90, c11, c18
  • GEN: Ninja
  • VAR: Debug, Release

MathiasMagnus avatar Oct 07 '20 07:10 MathiasMagnus

Requiring support for 30 year old C standards seems excessive, but whatever you do, suggest you state it explicitly in the API spec, as Vulkan does (if there is any such statement, I couldn't easily find it).

oddhack avatar Oct 07 '20 09:10 oddhack

@oddhack It's not for me to say. C not having a standard release for 21 years between 90 and 11 is something we have to deal with. 10 years old code had to be developed against a 30 year old standard. As much as I love upgrading stuff, before calling it quits on code that's not even 10 years old... That's almost as if your compiler would tell you C++11 is so passé, I'll reject compiling it tomorrow.

MathiasMagnus avatar Oct 07 '20 14:10 MathiasMagnus

@oddhack It's not for me to say. C not having a standard release for 21 years between 90 and 11 is something we have to deal with.

We baselined Vulkan on C99, which is AFAIK a standard (ISO/IEC 9899:1999).

oddhack avatar Oct 07 '20 23:10 oddhack

@oddhack I stand corrected. My familiarity with C standards is lacking, as can be seen.

MathiasMagnus avatar Oct 08 '20 05:10 MathiasMagnus