-
Notifications
You must be signed in to change notification settings - Fork 25
Build: Added HDF5PLUGIN_SYSTEM_LIBRARIES
env. var. to build using system libraries
#333
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
Conversation
Tested with conda: no longer link with available system libs if not requested + use them if requested through the |
|
I have only found things like this: https://stackoverflow.com/questions/42585210/extending-setuptools-extension-to-use-cmake-in-setup-py |
if field in ('extra_link_args', 'libraries'): | ||
return [] |
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.
'side question' not sure I get this part. Why is this returning a list ? I would expect an empty dict.
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.
If field
is None
, it returns a dict
which contains the build config for the static lib which is passed to BuildCLib
setuptools command.
If field
is provided, it returns the value of the field. It is called with way from the hdf5 plugin code using the compression lib to get what needs to be passed for linking with the compression lib to the setuptools Extension
. Extension
expects list
s for 'extra_link_args' and 'libraries'.
It cannot be all stored in a dict
since 'extra_link_args' and 'libraries' are not expected by BuildCLib
.
It would probably be best to use a class/dataclass/namedtuple here, or a function to extract what's relevant to BuildCLib
. Here I've minimised the rewrite, but I agree it makes things complex
Let's merge PR #335 first |
95b258f
to
750b8ab
Compare
Also prevent gcc to use the dynamic library if it is installed on the OS and this is not requested
This PR reworks the management of C libraries in
setup.py
to: