Skip to content

Fix python symbol drop#72

Merged
chengcli merged 5 commits intomainfrom
cli/fix_python_symbol_drop
Feb 6, 2026
Merged

Fix python symbol drop#72
chengcli merged 5 commits intomainfrom
cli/fix_python_symbol_drop

Conversation

@chengcli
Copy link
Owner

@chengcli chengcli commented Feb 6, 2026

No description provided.

Cheng Li and others added 2 commits February 6, 2026 06:08
Copilot AI review requested due to automatic review settings February 6, 2026 11:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses Python symbol drop issues on Linux by refining the linker flag strategy for CUDA libraries. The aggressive Linux linker was removing symbols from the kintera_cuda_release library, and this fix applies --no-as-needed specifically around the CUDA library to prevent this.

Changes:

  • Removed obsolete commented-out library reordering code
  • Added conditional logic to wrap kintera_cuda_release library with --no-as-needed linker flags on Linux
  • Removed global --no-as-needed flags in favor of targeted application only to the CUDA library

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"-Wl,-rpath,$ORIGIN/../pyharp/lib",
"-Wl,--as-needed",
]
"-Wl,-rpath,$ORIGIN/../pyharp/lib"
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing comma at the end of line 74. This will cause a syntax error when the list is parsed. The last element in the list should have a trailing comma to match the style of other elements.

Suggested change
"-Wl,-rpath,$ORIGIN/../pyharp/lib"
"-Wl,-rpath,$ORIGIN/../pyharp/lib",

Copilot uses AI. Check for mistakes.
setup.py Outdated
Comment on lines 64 to 68
if 'kintera_cuda_release' in libraries:
libraries.remove('kintera_cuda_release')
cuda_linker = ["-Wl,--no-as-needed",
"-lkintera_cuda_release",
"-Wl,--as-needed"]
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential issue: If the build system creates libraries with different names (e.g., 'kintera_cuda_debug' instead of 'kintera_cuda_release'), this code will not apply the --no-as-needed workaround for those libraries. Consider checking for any library name containing both 'kintera' and 'cuda', or document why only 'kintera_cuda_release' needs this treatment.

Suggested change
if 'kintera_cuda_release' in libraries:
libraries.remove('kintera_cuda_release')
cuda_linker = ["-Wl,--no-as-needed",
"-lkintera_cuda_release",
"-Wl,--as-needed"]
cuda_libraries = [lib for lib in libraries if lib.startswith("kintera") and "cuda" in lib]
if cuda_libraries:
for lib in cuda_libraries:
libraries.remove(lib)
cuda_linker = (
["-Wl,--no-as-needed"]
+ [f"-l{lib}" for lib in cuda_libraries]
+ ["-Wl,--as-needed"]
)

Copilot uses AI. Check for mistakes.
@chengcli chengcli merged commit a7944b1 into main Feb 6, 2026
3 checks passed
@chengcli chengcli deleted the cli/fix_python_symbol_drop branch February 6, 2026 11:57
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

🎉 Released v1.3.0!

What's Changed

Full Changelog: v1.2.10...v1.3.0

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant