-
Notifications
You must be signed in to change notification settings - Fork 0
Fix linux aggressively drop symbols #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -21,9 +21,15 @@ def parse_library_names(libdir): | |||||||||||||
| library_names.extend(['netcdf']) | ||||||||||||||
|
|
||||||||||||||
| # move current library name to first | ||||||||||||||
| current = [item for item in library_names if item.startswith('kintera')] | ||||||||||||||
| other = [item for item in library_names if not item.startswith('kintera')] | ||||||||||||||
| return current + other | ||||||||||||||
| #current = [item for item in library_names if item.startswith('kintera')] | ||||||||||||||
| #other = [item for item in library_names if not item.startswith('kintera')] | ||||||||||||||
| # 1) non-cuda libs first (consumers) | ||||||||||||||
| kintera_non_cuda = [l for l in library_names if l.startswith("kintera") and "cuda" not in l] | ||||||||||||||
| # 2) cuda libs last (providers) | ||||||||||||||
|
Comment on lines
+26
to
+28
|
||||||||||||||
| # 1) non-cuda libs first (consumers) | |
| kintera_non_cuda = [l for l in library_names if l.startswith("kintera") and "cuda" not in l] | |
| # 2) cuda libs last (providers) | |
| # 1) non-CUDA kintera libs first (they may depend on CUDA symbols) | |
| kintera_non_cuda = [l for l in library_names if l.startswith("kintera") and "cuda" not in l] | |
| # 2) CUDA kintera libs last (they provide the CUDA symbols for earlier deps) |
Copilot
AI
Feb 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The --no-as-needed linker flag is being added to test executables in CMake to prevent Linux from aggressively dropping symbols. However, the Python extension in setup.py also links to the same kintera libraries and may suffer from the same symbol dropping issue on Linux. Consider adding -Wl,--no-as-needed to extra_link_args for non-Darwin platforms (lines 64-69) to ensure consistent behavior and prevent potential symbol resolution issues in the Python extension.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
--no-as-neededlinker flag is being added tosetup_testto prevent Linux from aggressively dropping symbols. However,macro_setup_problem.cmakehas a similar structure and links the same libraries (kintera::kintera and optionally kintera::kintera_cu) but does not have this flag. For consistency and to prevent similar symbol dropping issues in problem executables, consider adding the same linker flag tosetup_problemas well.