Blosc/c-blosc2

C-Blosc 2.9.0 w/ MSVC: use of designated initializers requires at least '/std:c++20'

ax3l opened this issue · 2 comments

ax3l commented

Describe the bug
Compiling the downstream project ADIOS2 v2.9.0 with C-Blosc 2.9.0 throws the error:

  C:\Program Files (x86)\blosc\include\blosc2.h(1056,5): error C7555: use of designated initializers requires at least '/std:c++20'

To Reproduce
Compile ADIOS2 v2.9.0 with -DADIOS2_USE_Blosc2=ON on Windows.

E.g.

  curl -sLo blosc2-2.9.3.zip ^
    https://github.com/Blosc/c-blosc2/archive/refs/tags/v2.9.3.zip
  powershell Expand-Archive blosc2-2.9.3.zip -DestinationPath dep-blosc2

  :: https://github.com/Blosc/c-blosc2/pull/525
  curl -sLo c-blosc2-cmake.patch ^
    https://patch-diff.githubusercontent.com/raw/Blosc/c-blosc2/pull/525.patch
  python -m patch -p 1 -d dep-blosc2/c-blosc2-2.9.3 c-blosc2-cmake.patch

  cmake -S dep-blosc2/c-blosc2-2.9.3 -B build-blosc2 ^
    -DCMAKE_BUILD_TYPE=Release  ^
    -DBUILD_SHARED=OFF          ^
    -DBUILD_STATIC=ON           ^
    -DBUILD_BENCHMARKS=OFF      ^
    -DBUILD_EXAMPLES=OFF        ^
    -DBUILD_FUZZERS=OFF         ^
    -DBUILD_TESTS=OFF           ^
    -DPREFER_EXTERNAL_ZLIB=ON   ^
    -DZLIB_USE_STATIC_LIBS=ON

  curl -sLo adios2-2.9.0.zip ^
    https://github.com/ornladios/ADIOS2/archive/v2.9.0.zip
  powershell Expand-Archive adios2-2.9.0.zip -DestinationPath dep-adios2

  cmake -S dep-adios2/ADIOS2-2.9.0 -B build-adios2 ^
    -DCMAKE_BUILD_TYPE=Release  ^
    -DBUILD_SHARED_LIBS=OFF     ^
    -DBUILD_TESTING=OFF         ^
    -DADIOS2_BUILD_EXAMPLES=OFF ^
    -DADIOS2_USE_Blosc2=ON      ^
    -DADIOS2_USE_BZip2=OFF      ^
    -DADIOS2_USE_Fortran=OFF    ^
    -DADIOS2_USE_HDF5=OFF       ^
    -DADIOS2_USE_MHS=OFF        ^
    -DADIOS2_USE_MPI=OFF        ^
    -DADIOS2_USE_PNG=OFF        ^
    -DADIOS2_USE_Profiling=OFF  ^
    -DADIOS2_USE_Python=OFF     ^
    -DADIOS2_USE_ZeroMQ=OFF     ^
    -DADIOS2_USE_ZFP=OFF         ^
    -DADIOS2_RUN_INSTALL_TEST=OFF

Expected behavior
This should compile with C++14 projects.

Logs
openPMD/openPMD-api#1387

System information:

  • OS: Windows 2019 64bit on GitHub actions windows-2019 image
  • Compiler: Visual Studio 16 2019 w/ MSVC 19.29.30151.0
  • Version: C-Blosc 2.9.3

Additional context

ax3l commented

Is it possible that designated initializers are a C99 but only a C++20 feature?

That would cause that blosc2.h bumps the requirement to C++20 for the project.

Fixed in #527 . Thanks @ax3l !