-
Notifications
You must be signed in to change notification settings - Fork 150
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
Use rpath to find libstp.so #404
base: main
Are you sure you want to change the base?
Conversation
bsc depends on its wrapper to set the LD_LIBRARY_PATH to it's private version of libstp.so. Link with an rpath to this library and bsc can be run without the wrapper. Signed-off-by: Tom Rix <[email protected]>
Thank you for contributing this. However, I believe that it is already covered by PR #163. That PR addresses a few issues that are not addressed here: the Makefile needs to also work for macOS, and the Yices library also needs to be found. That PR hasn't been merged because it seemed like a better approach would be for the BSC executable to load the library with It's worth noting that the wrapper is still needed, to set BLUESPECDIR. |
yices is in the same dir as stp and has stp as its dependency so the single rpath should work, though duplicating it would be fine too. |
BSC uses a SAT/SMT solver for a number of purposes. Yices and STP are two separate implementations that the user can choose from, by providing the flags The very first thing that BSC does when executed is to check the flags. During that, it checks which solver has been selected; and then it checks to see whether the linked library is of the right version. (Note that this repo supports building a stub in place of either STP or Yices; if, for some reason, you can't build that on your system, or don't want to. So BSC also needs to check that the library is not a stub!) For Yices, there is a function in its API that returns the version number. If the user has selected Yices, but the version does not match the expected version, then BSC warns the user and attempts to use STP instead. STP does not have a version function in its API; but we still want to check that it is a not a stub, so we look for a non-NULL pointer returned by the init function. There have been several proposed improvements to this situation:
Unvendoring Yices/STP and using a standardized API (SMT-lib) might be my preferred choice. Although it could make BSC a little harder to install, because users would have to install an SMT solver first, and there are not convenient packages for those. Applying an RPATH in the meantime is fine with me. But there are still two problems that would need to be addressed: (1) Your change doesn't work for macOS; you'll need an if-else in the Makefile to use a different syntax for mac. Your change doesn't remove the LD_LIBRARY_PATH from the wrapper, so the CI won't be testing it. (2) The relative location of BLUESPECDIR to the binaries ( |
bsc depends on its wrapper to set the LD_LIBRARY_PATH to
it's private version of libstp.so. Link with an rpath
to this library and bsc can be run without the wrapper.
Signed-off-by: Tom Rix [email protected]