Separate shared libraries and python modules #163
Merged
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.
Each of the sub-libraries (core, calibration, dfmux, gcp, maps) are separated into two parts:
A shared library called
libspt3g-<name>
, which is installed to$CMAKE_INSTALL_PREFIX/lib
and contains all of the C++ structures defined in that library. A shared module called_lib<name>
, which is added as an extension module to thespt3g
python package, and whose namespace is internally imported into thespt3g.<name>
python module. This allows linking the shared libraries against each other, while treating the modules as independent endpoints that just expose the appropriate components to python, thus removing the need for thedload
andload_pybindings
infrastructure.Libraries link against the
Python::Module
cmake target and use dynamic lookup to avoid linking againstlibpython
until their associated module is loaded by the interpeter. Compiled executables then link againstlibpython
explicitly via thePython::Python
cmake target.This PR is the last step toward producing a portable package that can be installed using standard python tools like
pip
.