Skip to content

cuda-core build_hooks.py missing compiler/linker flags present in cuda-bindings #1882

Closed

Description

@leofang

Summary

cuda_core/build_hooks.py is missing several compiler and linker flags that cuda_bindings/build_hooks.py sets. Symbol stripping was addressed in #1881; this issue tracks the remaining differences.

Differences

1. No optimization flag

cuda_bindings passes -O3 on non-debug Linux builds. cuda_core doesn't set any optimization level, relying on setuptools/compiler defaults.

Note: We may want -O2 rather than -O3 for cuda-core — to be decided.

2. Missing C++ compiler flags (Linux)

cuda_bindings passes:

-std=c++14 -fpermissive -Wno-deprecated-declarations -fno-var-tracking-assignments

cuda_core has none of these. Some may not be needed if cuda-core's Cython code doesn't trigger the same warnings, but -std=c++14 and -fno-var-tracking-assignments (reduces memory usage during compilation) are likely beneficial.

3. No --debug mode support

cuda_bindings supports --debug builds with -g -O0 -D _GLIBCXX_ASSERTIONS and gdb_debug=True for Cython. cuda_core has no such support.

4. Cython directive differences

  • cuda_bindings sets "binding": True
  • cuda_core sets "warn.deprecated.IF": False instead, and doesn't set binding

These may be intentional differences, but worth auditing.

Proposal

Audit each flag and either port it from cuda_bindings with justification, or document why it's not needed for cuda_core.

-- Leo's bot

Activity

  1. added
    packagingAnything related to wheels or Conda packages
    cuda.coreEverything related to the cuda.core module
    on Apr 8, 2026
  2. added this to the cuda.core v1.0.0 milestone on Apr 8, 2026
  3. added theissue type on Apr 8, 2026
  4. added
    P1Medium priority - Should do
    on Apr 14, 2026
  5. leofang commented on Apr 14, 2026

    @leofang
    MemberAuthor

    Some of these are fixed in #1890. Will take care of the rest.

  6. leofang commented on May 1, 2026

    @leofang
    MemberAuthor

    #2002 added C++17 and -O2. Pushing the rest out of v1.0.0.

  7. removed their assignment
    on May 1, 2026
  8. isVoid commented on May 22, 2026

    @isVoid
    Contributor

    So I investigated the C++ flags difference:

    Both -fpermissive -Wno-deprecated-declarations are relaxing flags on the compiler and I would suggest if cuda_core compiles fine today, they shouldn't be added.

    -fno-var-tracking-assignments is the one that could be useful. So I did a local profile build with/without the flag. Finding ~0.4% time difference in build time, so it's not necessarily useful in this case.

    As for the cython compiler flags. bindings:True is specific to cuda_binding. It makes Cython generate richer Python function binding behavior. And the warn.deprecated.IF is specific to cuda_core since there are places that writes IF CUDA_CORE_BUILD_MAJOR >= 13 around the code.

    So I don't think there's materialistic difference between the two sets of compiler flags as of now.

  9. rparolin commented on Jul 17, 2026

    @rparolin
    Collaborator

    @leofang @isVoid Based on the comment above I'm going to close this issue. Please reopen if I closed the issue in error.

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

Metadata

Metadata

Assignees

Labels

P1Medium priority - Should docuda.coreEverything related to the cuda.core modulepackagingAnything related to wheels or Conda packages

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions