Skip to content

eckit & static builds #336

Open
Open

Description

@pmarguinaud

Is your feature request related to a problem? Please describe.

At Météo-France, we use statically linked executables (apart from Intel libraries and HDF/netcdf, which are installed once and for all, and which are linked dynamically).

Currenly, we rely on gmkpack for creating MASTERODB and other executables, and use workarounds for creating static eckit libraries and linking them in MASTERODB.

Describe the solution you'd like

I would like to be able to create statically linked eckit libraries with cmake, and import them properly to create static executables; the solution I favor implies generating code and add an object at link time to force loading of functions registered :

https://github.com/pmarguinaud/eckit/tree/static-anchor

Describe alternatives you've considered

Another possibility would be to have eckit adding special linker flags will when the libraries are imported in an other packages (namely --whole-archive); this would also imply to have all packages to import eckit publicly, as private use (strangely, but this is cmake) does not add these extra linker flags.

A draft is here :

https://github.com/pmarguinaud/eckit/tree/static

The minimum would be to allow for static libraries creation; the test suite would then not work fully with static libraries; note that builds relying on shared libraries would not be affected.

Then at link time, we would apply --whole-archive on eckit libraries in packages importing it.

What do you think/recommend ?

Additional context

No response

Organisation

Météo-France

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions