abinit icon indicating copy to clipboard operation
abinit copied to clipboard

'abinit --version' prints UNKNOWN when built from a tarball and not from the git repository

Open yurivict opened this issue 1 year ago • 7 comments

'abinit --version' fails:

$ abinit --version
UNKNOWN

Build instructions don't say anything about how to set version. configure and build succeeds and produce a faulty executable.

Some computations fail as well:

--- !WARNING
src_file: m_hdr.F90
src_line: 3196
message: |
    Cannot find major.minor pattern in codvsn: UNKNOWN
...

Version: 10.0.7 FreeBSD 14.1

yurivict avatar Aug 29 '24 16:08 yurivict

What is your output of ~abinit/configure --version ? If the output is UNKNOWN, it is because autoconf sets PACKAGE_VERSION=UNKNOWN in configure, line 584. Maybe it is an autoconf issue

ilygatsika avatar Aug 30 '24 14:08 ilygatsika

Temporary solution: changing all 'UNKNOWN' occurrences within the configure file to '10.0.7' allows to run computations successfully without the warning and corrects the output when asking abinit version

ilygatsika avatar Aug 30 '24 14:08 ilygatsika

The problem occurs in case when tarball is used that isn't a git repository.

You should provide a way for users to specify the version in such case.

Also configure should fail when the version isn't available because otherwise the produced abinit executable is broken.

Workaround: I replaced all occurrences of UNKNOWN with version in config/scripts/git-version-gen.

yurivict avatar Aug 30 '24 15:08 yurivict

This occurs (at least) for latest release tarballs (v10.0.3, v10.0.5, v10.0.7) that do not include neither .version nor .tarball-version. Some propositions for completing the docs on how to set the version number:

  1. on the top of the source tree, echo "10.0.7" > .version && echo "10.0.7" > .tarball-version and then launching ./autogen.sh before configure

  2. how to use existing script config/scripts/update-version-number that lets the user specify version within configure.ac

ilygatsika avatar Sep 02 '24 08:09 ilygatsika

see : https://github.com/abinit/abinit/releases/tag/10.0.9

jmbeuken avatar Sep 12 '24 14:09 jmbeuken

These instructions recommended above fixed this problem in the FreeBSD port:

echo "10.0.7" > .version && echo "10.0.7" > .tarball-version

yurivict avatar Mar 06 '25 16:03 yurivict

I think it might be because some versions of sh don't support this syntax. https://github.com/abinit/abinit/blob/578d1fb2aa42e852bbaf1656c497b5bd85c16d9a/config/scripts/git-version-gen#L197 Consider modifying the syntax to v=$(cat .current_version).

tsaihsiaoyi avatar Mar 06 '25 17:03 tsaihsiaoyi