Skip to content

Provide an import .lib for Warp's .dll(s) on Windows #1888

Description

@c0d1f1ed

Currently a native C++ application that wants to use Warp's .dll files directly (e.g. to use APIC .wrp files without Python code) has to dynamically load them and resolve each symbol individually using GetProcAddress(). It's a significant amount of boilerplate code per such application, and it needs to be updated every time Warp's entry points change.

It would be greatly simplified by providing .lib import libraries which automatically load the .dll and resolve the symbols. Applications merely have to link against it and include Warp's corresponding header.

One caveat the users of these .libs must stay aware of is that mismatched .dll versions can cause the application not to launch, or crash, with little or no indication of what went wrong. That said, similar issues also exist on Linux and Darwin where one links directly with the .so or .dylib. The user must ensure to ship the same version of dynamic libraries the application linked against, and put them in the paths the OS searches first.

APIC is still an experimental API and will undergo changes in the near future before settling down. We're also considering providing backward or forward compatibility guarantees through stable API versioning and symbol querying mechanisms as the need arises, but this is out of scope for now.

Activity

  1. added this to the 1.18.0 milestone on Sep 1, 2026
  2. Samyra312007 commented on Sep 2, 2026

    @Samyra312007

    Respected Maintainer and Author, I would like to understand about this issue end to end and work on it. Is it open for contributors?

  3. self-assigned this
    on Sep 2, 2026
  4. shi-eric commented on Sep 12, 2026

    @shi-eric
    Contributor

    This is addressed by 4c281cf.

    Windows wheels now ship warp.lib and warp-clang.lib alongside their DLLs, and native applications can include warp.h, apic.h, and the new warp_clang.h to link directly instead of resolving the covered entry points with GetProcAddress(). The native ABI remains experimental: headers, import libraries, DLLs, and APIC artifacts must come from the same Warp release. Closing this as completed.

    Public API behavior

    • Native C++ consumers on Windows can now link against warp.lib and warp-clang.lib using the declarations shipped in the wheel.
    • The warp-clang C ABI exposed by warp_clang.h is experimental and intentionally limited to the CPU-module functions required by standalone APIC consumers.
    • Python APIs and kernel builtins are unchanged.

    Test coverage

    • tools/ci/windows_import_library_smoke adds the windows_import_library_smoke CTest consumer, which links both libraries from an installed wheel and exercises initialization, version validation, CPU runtime binding, APIC state creation, and warp-clang entry points.
    • .github/workflows/ci.yml runs the installed-wheel test on Windows x86-64 with CUDA 12 and CUDA 13 and on Windows ARM64 CPU. All three jobs passed for this commit.
    • Windows wheel construction now fails when any required DLL or import library is absent.

    Behavioral verification

    A targeted native-linking reproduction confirmed direct linking and execution against both libraries, matching native-library versions through the Python loader, rejection of an incomplete Windows wheel, and inclusion of both DLL/import-library pairs and their public headers in a complete wheel.

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

Metadata

Metadata

Assignees

Labels

feature requestRequest for something to be added

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions