Repository navigation
Prefix the internal symbols with pslp_ - #137
Merged
Merged
Conversation
These functions had external linkage but are only used in the file that defines them, so they were exported from libPSLP for no reason. Two of them (update_act_bound_change, dton_tighten_dominated_row) lose their prototype in a header; the comment moves to the definition. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
libPSLP exported about 240 functions with generic names (transpose, matrix_new, sort_ints, ...) that can clash with the symbols of a program or library that embeds PSLP (#133). include/core/pslp_namespace.h holds one '#define name pslp_name' line for every internal function with external linkage. CMake force-includes it into every source file of the library and of the tests, so the sources keep the short names and only the symbols change. The header is generated from the built library by cmake/pslp_symbols.sh, and CI fails if a symbol is exported that is neither prefixed nor one of the 13 public functions. The public API is unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This was referenced Nov 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses the first part of #133:
libPSLPexported about 240 functions with generic names (transpose,matrix_new,free_matrix,sort_ints,count_rows, ...) that can clash with the symbols of a program or library that embeds PSLP.What changes
include/core/pslp_namespace.hholds one#define name pslp_nameline for each of the 227 internal functions with external linkage. CMake force-includes it (-include,/FIon MSVC) into every source file of the library and ofall_tests. The sources keep the short names; only the symbols change.cmake/pslp_symbols.sh generate <lib>...rewrites the header from built libraries.cmake/pslp_symbols.sh check <lib>...fails if an exported symbol is neitherpslp_*nor listed incmake/public_symbols.txt, or if a public function is missing.static(first commit). They were only used in the file that defines them.The public API is unchanged: the 13 functions of
PSLP_API.hare now the only unprefixed exports.After adding a non-static internal function
Build the library and regenerate the header, passing a Release build and a Debug build with
-DPSLP_BUILD_TESTING=ONso that the debug-only and test-only functions are covered:CI fails with the name of the function if this is forgotten.
Not in this PR
postsolve,default_settings,run_presolver, ...) keep their names, so a host with its ownpostsolvestill clashes. Fixing that is an API change.stderr).Testing
On macOS: Debug and Release, shared and static, with
PSLP_BUILD_TESTING=ON: all tests pass and the symbol check passes. A Release build without testing passes the check andtest_cpplinks. Regenerating the header from the prefixed builds reproduces it byte for byte. Adding an unlisted function makes the check fail and name it. Windows (/FI) is only covered by CI.🤖 Generated with Claude Code