[Opm] Version information?

Atgeirr Rasmussen Atgeirr.Rasmussen at sintef.no
Mon Nov 14 17:26:59 UTC 2016


Hi Bernd,

This is not something we have given very much attention. Basically our assumption has been
that ensuring the releases are solid is enough. However, as maturity increases in general,
and people come to rely on the code we should do something more about this.

The only place such information is currently written is in the build-system-generated file
project-version.h, which is used from for example opm/autodiff/moduleVersion.cpp in the
opm-simulators module (note inclusion with "" rather than <>, it is residing in the build
tree, not the code tree).

For each module, the file looks like this for debug builds:
#ifndef OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED
#define OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED
#define PROJECT_VERSION_NAME "2017.04-pre"
#define PROJECT_VERSION_HASH "debug"
#define PROJECT_VERSION "2017.04-pre (debug)"
#endif // OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED

… and like this for release builds:
#ifndef OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED
#define OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED
#define PROJECT_VERSION_NAME "2017.04-pre"
#define PROJECT_VERSION_HASH "736585e*"
#define PROJECT_VERSION "2017.04-pre (736585e*)"
#endif // OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED

The git hash is of course different from repo to repo, and we do not use it at the moment. The idea
is that it can help identify exact version in case of error, but collecting it across repos is not easy so
we has not done that yet. So the only part we actually use in Flow is the PROJECT_VERSION_NAME.

This is generated from the dune.module file, that contains something like:
Version: 2017.04-pre
Label: 2017.04-pre

For the release branches, we lose the "-pre" part, after the next release (2017.04) the new version will be "2017.10-pre".

I hope this is enough information for you to do what you need. If you have suggestions for improvements,
please tell me!

Atgeirr

Dear Opm,

since Opm interfaces changed without deprecation period, I must have different code paths to support 2016.04 and 2016.10 at the same time. Is there a way to do this? I don't see any Opm version information written into config.h.

Kind regards
Bernd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <//opm-project.org/pipermail/opm/attachments/20161114/b6e0e873/attachment.html>


More information about the Opm mailing list