Coder Social home page Coder Social logo

Comments (5)

tmadlener avatar tmadlener commented on July 23, 2024

I can also reproduce this in my development environment. Quickest workaround for now seems to be to add a #define PODIO_JSON_OUTPUT to each macro that wants to use this. Obviously that is not a longterm solution.

(Adding a few thoughts that we already partially discussed in private):
I gave putting all to_json function implementations into the respective headers a quick go, and that doesn't really work because then we would also have to start replacing forward declarations with #includes of the corresponding headers, which most likely is not viable because relations can lead to cyclic includes here.

I am also not sure whether we can make, e.g. a #define EDM4HEP_PODIO_OUTPUT that we implicitly generate based on the value of PODIO_JSON_OUTPUT work nicely. Maybe the cleanest solution would be to make this explicitly opt-in by creating a new option in the YAML file that enables / disables the json conversion.

from podio.

wdconinc avatar wdconinc commented on July 23, 2024

Another thought. Maybe we can make the current approach work? I don't actually understand what goes wrong in cling. Clearly it finds the dictionary and the (correct, for my system) nlohmann-json headers. So I don't really understand why it thinks the constructor signature doesn't match? Is this maybe due to an implicit c++ option that affects initializer lists?

from podio.

tmadlener avatar tmadlener commented on July 23, 2024

Looking at the error message again, I think the problem is actually in an inline definition of a to_json function, as it is in TrackState.h which is a component. Not sure yet what that teaches us about the problem.

from podio.

tmadlener avatar tmadlener commented on July 23, 2024

Maybe it would be easiest to remove the #ifdef PODIO_JSON_OUTPUT with a

#if __has_include("nlohmann/json.hpp")
  #include "nlohmann/json.hpp"
  // potentially a version check
  #define PODIO_JSON_OUTPUT // or something else for easier internal use
#endif

in that way we would at least not depend on some external -DPODIO_JSON_OUTPUT, but would have some (maybe) consistent internal check.

from podio.

wdconinc avatar wdconinc commented on July 23, 2024

I think it seems like the Components just aren't guarded. Nevermind, that didn't make sense.

from podio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.