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

Boost package does not contain Boost JSON #99

Open
Lysarina opened this issue Jun 17, 2024 · 4 comments
Open

Boost package does not contain Boost JSON #99

Lysarina opened this issue Jun 17, 2024 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@Lysarina
Copy link

I'm working on setting up a Phoenix visualisation tool for LDMX. For this, I need to create JSON files with event data (as Phoenix only accepts certain file types). Currently I am making an analyzer that builds the JSON files with strings, which is not a very efficient when dealing with a large number of events. I was going to use the Boost JSON package, as we have libboost-all-dev in the Docker image, which should contain said JSON package. However, I get this error when adding #include <boost/json.hpp> to my .cxx file and running ldmx compile:

image

Is this intended? Could the package be added to the image?

@Lysarina Lysarina added the help wanted Extra attention is needed label Jun 17, 2024
@Lysarina
Copy link
Author

Apparently ubuntu before 24 does not ship with the json component, despite debian doing so
(╯°□°)╯︵ ┻━┻

// @EinarElen

@tomeichlersmith
Copy link
Member

tomeichlersmith commented Jun 17, 2024

I'm guessing this is a version issue. The version of Boost in Ubuntu 22.04 repositories is 1.74 and I can confirm the version within the image by checking within the container itself

$ ldmx 'dpkg -s libboost-dev | grep Version'
Version: 1.74.0.3ubuntu7

(I'm using 4.2.2 of ldmx/dev by the way.)

Boost.JSON is not in 1.74. I would recommend using nlohmann/json which has already been used for this purpose within the Tracking area for writing files for Phoenix. None of this event display work has been merged into ldmx-sw trunk, but they may offer code snippets ready for you to inspect:

@EinarElen
Copy link
Contributor

EinarElen commented Jun 17, 2024 via email

@tomeichlersmith
Copy link
Member

To help avoid this confusion in the future, I've included Boost as an entry in the base README of this repo e7df517

I guess, this issue then becomes a discussion on if we want to update the image with a JSON parser and (if so) which to choose. Options roughly in order of my personal preference:

  1. Don't update the image. Just use nlohmann/json as a header-only library probably using one of the CMake examples on the doc site
  2. Update the image with Boost v1.85. Could be helpful but may break other things since both us and acts use Boost. Would need to check and test.
  3. Update the image with a system install of nlohmann/json. Would avoid the cost of everyone downloading their own copy of the header (I guess) and help pin the version for everyone developing with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants