-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
FetchContent for zlib-ng #544
Conversation
I have also reported the issue in upstream |
Hi @FrancescAlted, I took a look at this and added the necessary logic as a PR to this branch in: |
There is generally a bit of work to be needed on zlib-ng's CMake as well:
I proposed those in zlib-ng/zlib-ng#1560 The code I pushed above will work-around the superbuild issues for now for our purpose. I have to check when I have additional cycles to propose updates to zlib-ng. |
Otherwise: - we cannot use it in our shared lib - downstream consumers will not be able to use it in shared libs, even if c-blosc is build as static Not using -fPIC is a corner-case and should be addressed with proper external dependencies instead of a superbuild (marginal performance gains).
We will need to export the Zlib-NG libs to the build tree, because upstream does not do it yet (work-around). Additionally, we want to install zlib, because users might need it in case they pick up c-blosc2 as a static lib.
Overridden by #547 |
Ok, something unexpected happened with #547. Apparently the good PR is here. Merging. |
I have been playing with the Python wheels and, as the zlib-ng is linked statically with libblosc2, no dependency is added, even for the dynamic blosc2 libraries, so this is great. The only glitch is that the wheels are now bringing the libz.a library (I suppose it is automatically included by the cibuildwheel package):
But 170 KB (uncompressed) is not that much compared with the 3.2 MB wheel of the previous versions (and I'm pretty sure we can get rid of it from the wheel somehow). I suppose we could do the same with zstd, but I'd prefer to do a release first with FetchContent just for zlib-ng, and if everything goes well, then tackle zstd. |
Upon reflection, I think this is a good time for experimenting with FetchContent zstd. @ax3l it would be great if you submit a PR for that in case you have some bandwidth. thanks! |
@FrancescAlted for the first issue, are you referring to Can you help me by opening an issue with the exact prep & commands you used to build there? Are these only the two you mentioned above? For all-static dependency builds, I think we can avoid the install of libz.a/zlib-ng in the wheel by deactivating the install logic via their |
Oops, sorry, it is https://github.com/Blosc/python-blosc2
Sure: Blosc/python-blosc2#128
Just tried this out, but it did not work for me. |
Recent zlib-ng does not work when used as an internal source anymore because zlib-ng uses cmake much more thouroughly and this needs a better integration in C-Blosc2 superbuild. This patch is a (naive) attempt to make recent versions of zlib-ng to work here.
I followed the suggestions here and use modern
FetchContent
machinery in cmake to tackle this. The problem here is that I lack practice enough with name spaces to assess which names should I put there. @ax3l do you think I am follwing the right approach? and if so, have some suggestion for a fix?