Skip to content
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

Allow using system libraries. #184

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jeandudey
Copy link

@jeandudey jeandudey commented Jul 6, 2023

Fixes #152.

For example, when the dependencies are available on the system one could do:

qmake CONFIG+=config_without_bundled_cppzmq \
      CONFIG+=config_without_bundled_robin_hood \
      CONFIG+=config_without_bundled_secp256k1 \
      LIBS+=-lrocksdb \
      LIBS+=-lsimdjson

And it would choose the system libraries, some distributions (like Guix, Debian, etc.) may remove the bundled code, so, means to use system libraries are needed.

Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
@cculianu
Copy link
Owner

cculianu commented Jul 6, 2023

Looks like the right approach although I’m currently traveling and unable to test this readily. May take a few days to merge but looks good so far in terms of approach.

@jeandudey
Copy link
Author

@cculianu hey! sorry for bothering just pinging in case you forgot about this

@cculianu
Copy link
Owner

Yeah sorry I still need to review this. I feel a bit like "who the hell installs robin_hood in the system and why does it matter".. same for simdjson. These are all basically... header-only and who cares.

@jeandudey
Copy link
Author

Probably nobody installs robin-hood-hashing but at Guix there's package for it which builds with CMake and installs the configuration files needed to search for it so that other projects don't bundle it. Guix also distributes the sources of a program (required by Fulcrum GPL) so in the end most projects that contain bundled libraries will end up with duplicated files.

For example p2pool also bundles robin-hood-hashing and p2pool is also present on Guix, I've yet have to modify it to use the system's robin-hood-hashing library.

For the simdjson case, it can be built as a shared library too and other programs could load it too.


I mean this patch doesn't have to be accepted as this is applied when downloading sources at Guix anyway (see https://issues.guix.gnu.org/66120) but would reduce maintenance of the package to just pass the command line options instead of patching and doing that too.

@cculianu
Copy link
Owner

Ah ok.. I wasn't aware anybody needed this. Ok will review this soon.

I was a bit off-put by switching #include "thing.h" -> #include <thing.h> in some of the files but I guess there is no way around that. Makes me nervous that if the system has the header by accident, Fulcrum will pick that header and then I get users sending me bug reports that it failed to compile because link error etc etc etc... :/

@jeandudey
Copy link
Author

I was a bit off-put by switching #include "thing.h" -> #include <thing.h> in some of the files but I guess there is no way around that.

I don't think it'd affect much since simdjson needs to be opted in and the others are truly header only libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support building with shared simdjson library.
2 participants