Skip to content

Navigation Menu

Sign in
Sign up

Build failure on modern toolchains (GCC 13+ / CUDA 13) due to redefinition errors from forced -include,cassert #122

Open

Description

When compiling SpargeAttn on a modern system using GCC 13+ and newer CUDA toolkits, the build fails via ninja with multiple redefinition errors, such as:
error: redefinition of ‘void std::__terminate()’
Root Cause:
In setup.py, the compilation flags force a global include of cassert:
"-Xcompiler", "-include,cassert"
However, csrc/qattn/qk_int_sv_f8_cuda_sm90.cuh also explicitly declares #include on line 21. On stricter, modern compilers, this double-inclusion bypasses header guards during command-line pre-processing and breaks standard library macros.
Fix:
Remove or comment out "-Xcompiler", "-include,cassert" from setup.py, as the required source files already explicitly include natively.

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

    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

      AltStyle によって変換されたページ (->オリジナル) /