Skip to content

Make the C++/CUDA Makefiles portable (Windows build support) #3

Description

@balbasty

Problem

The C++ build system assumes a Unix/clang toolchain, so it does not build on Windows. The new CI test matrices (fastfields-numpy / -cupy / -torch / -bind-py / fastfields) run a windows-latest leg that builds fastfields-dlpack from source, and that leg is currently expected to be red until this is addressed. The windows-latest steps carry a comment saying as much.

What's not portable

The Makefiles in fastfields-cpu-lib, fastfields-cuda-lib, and fastfields-lib (and, transitively, the build fastfields-bind-py/setup.py invokes) rely on:

  • clang-only flags-ferror-limit, -ftemplate-backtrace-limit (rejected by MSVC/cl), and clang/gcc-style -fPIC, -fvisibility=hidden, -Wl,... linker syntax.
  • Unix artifacts — hard-coded .so suffix and $ORIGIN rpath (Windows has no rpath; it needs .dll + delvewheel/PATH-based loading).
  • Submodule symlinks — the dev tree wires layers with symlinks (lib/cpu -> cpu-lib, cpu-lib/impl -> cpu-impl, cpu-impl/kernels -> kernels); Windows checkouts don't get symlinks by default.
  • GNU make + POSIX shell assumptions in the recipes.

Scope / possible approach

  • Support MSVC (cl) and/or clang-cl on Windows; branch the compiler/linker flags per toolchain (the existing PLATFORM detection in the Makefiles is the natural place).
  • Emit .dll/.lib on Windows and drop the $ORIGIN rpath there; let delvewheel vendor the DLLs into the wheel.
  • Make the layer wiring not depend on symlinks (real submodule checkouts, or an include-path variable).
  • Once green, the windows-latest legs in the Python test.yaml matrices can be relied on.

CPU is the source of truth; the CUDA (nvcc) Windows build can follow.

Cross-cutting across fastfields-cpu-lib, fastfields-cuda-lib, fastfields-lib, fastfields-bind-py.

Workstream: claude-jitfields-to-fastfields

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions