Skip to content

Conflicting versions of toml11 and nlohmann_json when used as internally shipped dependencies at multiple points in the software stack #5355

Open
@franzpoeschel

Description

@franzpoeschel

Both PIConGPU and the openPMD-api internally ship with the header-only dependencies toml11 and nlohmann_json. These internally shipped versions are used by default in both software packages.

When setting up a default installation of PIConGPU with openPMD-api enabled, this may lead to conflicts when both ship with different versions of one such library. (This is even when they are header-only, since they might still contain symbols with the same name, leading to undefined behavior since the loader jumps to the wrong function, or the same datatype might exist in two non-compatible layouts, …).

I'm not really sure how to best solve this, some ideas:

  1. Include nlohmann_json and toml11 into their own namespaces in PIConGPU to avoid symbol clashes
  2. By default, look for an installed version of nlohmann_json / toml11; use internally-shipped version only if no installed version was found
  3. Reexport the headers in openPMD, include them from there in PIConGPU
  4. Check in PIConGPU which version of toml11/nlohmann_json was used by openPMD, disallow use of shipped dependency if the dependencies do not match (or if the version cannot be figured out)

I don't really like any of these ideas, so feel free to suggest solutions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions