cuda-core build_hooks.py missing compiler/linker flags present in cuda-bindings #1882
Description
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_bindingssets"binding": Truecuda_coresets"warn.deprecated.IF": Falseinstead, and doesn't setbinding
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
leofang commentedon Apr 14, 2026
Some of these are fixed in #1890. Will take care of the rest.
cuda.core: add C++17 standard flag and use -O2 optimization (#2002)
leofang commentedon May 1, 2026
#2002 added C++17 and -O2. Pushing the rest out of v1.0.0.
isVoid commentedon May 22, 2026
So I investigated the C++ flags difference:
Both
-fpermissive -Wno-deprecated-declarationsare relaxing flags on the compiler and I would suggest ifcuda_corecompiles fine today, they shouldn't be added.-fno-var-tracking-assignmentsis 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:Trueis specific tocuda_binding. It makes Cython generate richer Python function binding behavior. And thewarn.deprecated.IFis specific tocuda_coresince there are places that writesIF CUDA_CORE_BUILD_MAJOR >= 13around the code.So I don't think there's materialistic difference between the two sets of compiler flags as of now.
rparolin commentedon Jul 17, 2026
@leofang @isVoid Based on the comment above I'm going to close this issue. Please reopen if I closed the issue in error.
build: consolidate _resolve_toolchain and unify flag set across backends
build: per-project cxx_std + tweak injection; fix Andy's review findings
build: unify compiler flag sets across cuda-bindings and cuda-core
build: unify compiler flags (#2998)