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 forcing of bundled rapidjson #125

Closed
andresailer opened this issue Jul 2, 2024 · 10 comments
Closed

Allow forcing of bundled rapidjson #125

andresailer opened this issue Jul 2, 2024 · 10 comments

Comments

@andresailer
Copy link

Dear Developers,

Would it be possible to add a cmake option to let us force the use of the bundled or external rapid json?

find_package(RapidJSON QUIET)

It would be unfortunate if we accidentally pick up one or the other depending on the build order of our software stacks (In my case building LCG software stacks).

Thanks!

@mpatrascoiu
Copy link
Contributor

Hello Andre,

I think you are aware already by now, but I'll post here again the summary.

With the discussion that started in the ROOT project (root-project/root#17190) and crossed-over to Davix (#130), I went ahead and patched the Davix-bundled RapidJson library (thanks to #129).

Since the latest officially released rapidjson-devel-1.1.0 package does not have the fix, there's no other way but to use the bundle version at all times. The following commit does exactly that: b4a53f12

This is documented and tracked further here: DMC-1426 / DMC-1427

Over the long-term, the plan is to stop using RapidJson altogether, in favor of a more widely-supported library, such as jsoncpp.

Cheers,
Mihai

@andresailer
Copy link
Author

Ok, no problem if you always use the bundled rapidjson.

@mpatrascoiu
Copy link
Contributor

Hello again,

On a second thought (upon talking with @amadio ), I've decided to allow switching between the bundled/system RapidJSON library via the EMBEDDED_RAPIDJSON=<True|False> CMake variable (default True).

The corresponding JIRA issue (DMC-1427) has been updated.

Cheers,
Mihai

@andresailer
Copy link
Author

Still good for us 👍 :)

@mpatrascoiu
Copy link
Contributor

Yes, you could use the default, bundled RapidJSON library in ROOT and be away from all this headache.

Over the (not-so)long-term, I plan to drop RapidJSON completely from Davix and switch to another JSON library, such as jsoncpp or maybe nlohmann/json. (I think this is what ROOT uses, no?)

@andresailer
Copy link
Author

Do you mean the bundled Davix in ROOT?

@mpatrascoiu
Copy link
Contributor

Yes, I mean when compiling ROOT, you can use the Davix-bundled RapidJSON to compile the ROOT-bundled Davix 🙂

But my second question was general: which JSON library does ROOT use?

Cheers,
Mihai

@andresailer
Copy link
Author

No, no, no I don't want to use rapidjson from ROOT to build Davix, and then use Davix inside ROOT. We want to have Davix stand alone for some reason. We also might want to not use the Davix version that comes along with Root.

Yes, ROOT does use nlohman json, I don't know if they use another one as well.

@amadio
Copy link
Contributor

amadio commented Dec 9, 2024

If you would like to use a library that is always external, while allowing ROOT to build Davix as builtin, you can try nlohmann_json. See here the software that ROOT has bundled to avoid taking from the system when necessary. Cheers,

@mpatrascoiu
Copy link
Contributor

Hello,
@andresailer what I meant: Davix now allows you to choose (via CMake) whether to use the system RapidJSON or the bundled RapidJSON within Davix. There's no RapidJSON dependency that Davix would need in the ROOT layer.

@amadio I see that nlohmann-json is up-to-date in EPEL. I plan to switch Davix to this package (if it's easy to use). My goal is to remove the bundled dependencies and use only system ones

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

No branches or pull requests

3 participants