Skip to content

build, Windows compatibility — absorb PR #74 fixes, resolve write ambiguity, add Windows CI runner #112

@steven-varga

Description

@steven-varga

Problem

H5CPP does not compile on Windows. Three distinct blockers are known.

Blocker 1 — aligned_alloc unavailable on MSVC

h5cpp/H5Zpipeline.hpp allocates chunk buffers with aligned_alloc(), which is a C11 function not implemented by MSVC. Needs a platform shim:

#ifdef _MSC_VER
    ptr0.reset( static_cast<char*>(_aligned_malloc( block_size, H5CPP_MEM_ALIGNMENT )) );
#else
    ptr0.reset( static_cast<char*>(aligned_alloc( H5CPP_MEM_ALIGNMENT, block_size )) );
#endif

The h5::impl::free deleter in H5misc.hpp also needs a matching _aligned_free branch on MSVC. PR #74 already has a fix for this; absorb it.

Blocker 2 — h5::write name ambiguity (issue #58)

On Windows, headers like <winsock2.h> or <io.h> inject a POSIX write() into the global namespace. Every call site that resolves h5::write then becomes ambiguous. Fix: qualify all internal call sites, or wrap the HDF5/Windows headers to prevent the leakage.

Blocker 3 — H5Pset_fapl_direct undefined on Windows

h5cpp/H5Pall.hpp references H5Pset_fapl_direct unconditionally. This function requires O_DIRECT (Linux only). PR #74 already has the #ifdef H5_HAVE_DIRECT guard; absorb it.

Scope

  • Absorb the three fixes from PR Compile on windows #74 (C2580, aligned_alloc, H5Pset_fapl_direct)
  • Resolve h5::write / POSIX write ambiguity on Windows Clang and MSVC
  • Add a Windows runner (windows-latest) to the CI matrix with MSVC or Clang-cl
  • Verify find_package(HDF5) works with a pre-installed HDF5 on the Windows runner

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions