-
Notifications
You must be signed in to change notification settings - Fork 452
HTS_VERSION macro #794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Add HTS_VERSION macro to aid writing preprocessor checks to test for the presence of HTSlib facilities, e.g., #if HTS_VERSION >= 101000 // Check for v1.10 or later Like the version numbers in version.sh, NEWS, and the manual pages, this must be updated manually (or via mkrelease) as part of the commit that merges develop to master during the release process. When merging the tagged release commit back to develop, this must be updated again (manually or via tag_release) as described in the comment in <htslib/hts.h>. Fixes samtools#794. (This has been added as 1.9.90, where .90 indicates an in-development Git repository version leading up the next release.)
Add HTS_VERSION and HTS_VERNUM() macros, to aid writing preprocessor checks to test for the presence of HTSlib facilities, e.g., #if HTS_VERSION >= HTS_VERNUM(1,10,0) // Check for v1.10 or later Like the version numbers in version.sh, NEWS, and the manual pages, this must be updated manually (or via mkrelease) as part of the commit that merges develop to master during the release process. When merging the tagged release commit back to develop, this must be updated again (manually or via tag_release) as described in the comment in <htslib/hts.h>. Fixes samtools#794. (This has been added with an in-development subpatch number of "+ 11", corresponding to the Makefile's TWO_TO_THREE_TRANSITION_COUNT.)
Add HTS_VERSION and HTS_VERNUM() macros, to aid writing preprocessor checks to test for the presence of HTSlib facilities, e.g., #if HTS_VERSION >= HTS_VERNUM(1,10,0) // Check for v1.10 or later Like the version numbers in version.sh, NEWS, and the manual pages, this must be updated manually (or via mkrelease) as part of the commit that merges develop to master during the release process. When merging the tagged release commit back to develop, this must be updated again (manually or via tag_release) as described in the comment in <htslib/hts.h>. See samtools#794. (This has been added with an in-development subpatch number of "+ 12", corresponding to the Makefile's TWO_TO_THREE_TRANSITION_COUNT.)
Add HTS_VERSION macro to aid writing preprocessor checks to test for the presence of HTSlib facilities, e.g., #if HTS_VERSION >= 101000 // Check for v1.10 or later This XYYYZZ encoding of X.Y.Z into a single integer is the same encoding as used by boost/version.hpp and similar. It would be nice to be able to hide the encoding behind another macro and write tests like #if HTS_VERSION >= HTS_VERNUM(1,10,0) // Doesn't work but this is a syntax error when compiled against earlier HTSlibs that don't define HTS_VERNUM(). Like the version numbers in version.sh, NEWS, and the manual pages, this must be updated manually (or via mkrelease) as part of the commit that merges develop to master during the release process. When merging the tagged release commit back to develop, this must be updated again (manually or via tag_release) as described in the comment in <htslib/hts.h>. Fixes samtools#794. (This has been added as 1.9.90, where .90 indicates an in-development Git repository version leading up to the next release.)
Add HTS_VERSION and HTS_VERNUM() macros, to aid writing preprocessor checks to test for the presence of HTSlib facilities, e.g., #if HTS_VERSION >= HTS_VERNUM(1,10,0) // Check for v1.10 or later Like the version numbers in version.sh, NEWS, and the manual pages, this must be updated manually (or via mkrelease) as part of the commit that merges develop to master during the release process. When merging the tagged release commit back to develop, this must be updated again (manually or via tag_release) as described in the comment in <htslib/hts.h>. See samtools#794. (This has been added with an in-development subpatch number of "+ 12", corresponding to the Makefile's TWO_TO_THREE_TRANSITION_COUNT.)
Add HTS_VERSION macro to aid writing preprocessor checks to test for the presence of HTSlib facilities, e.g., #if HTS_VERSION >= 101000 // Check for v1.10 or later This XYYYZZ encoding of X.Y.Z into a single integer is the same encoding as used by boost/version.hpp and similar. It would be nice to be able to hide the encoding behind another macro and write tests like #if HTS_VERSION >= HTS_VERNUM(1,10,0) // Doesn't work but this is a syntax error when compiled against earlier HTSlibs that don't define HTS_VERNUM(). Like the version numbers in version.sh, NEWS, and the manual pages, this must be updated manually (or via mkrelease) as part of the commit that merges develop to master during the release process. When merging the tagged release commit back to develop, this must be updated again (manually or via tag_release) as described in the comment in <htslib/hts.h>. Fixes samtools#794. (This has been added as 1.9.90, where .90 indicates an in-development Git repository version leading up to the next release.)
The common need is for HTSlib-using programs to be able to report the version of HTSlib that they are running against, as it's this that determines the behaviour observed and in particular what library bugs may have been fixed. Hence an The slightly-less common need is for programs to be able to enquire about HTSlib's capabilities at compile time, and emit an understandable When I added So it would be useful to wrap all this up in a preprocessor version macro in a public header (even though that's the antithesis of the autoconf mindset 😄). It's not as simple as just moving something to a public header, as you need to figure out how it gets updated. Unlike See PR #951 for a proposal for a |
Uh oh!
There was an error while loading. Please reload this page.
Htslib exports an
hts_version
function, those code is:where HTS_VERSION is in version.h, eg currently mine is
#define HTS_VERSION "1.9-63-g5d8bf3f"
.We need to ability to be able to detect this at configure time, preferably without needing to compile and execute a test program so we permit cross-compiling. As this isn't even a static variable, it's hard to glean this from symbol table grepping.
Cleaner would simply be moving HTS_VERSION to a public header file instead. Perhaps with HTS_VERSION_MAJOR and HTS_VERSION_MINOR numerical equivalents too. See ZLIB_VER macros in zlib.h for an example.
Even the string form alone is parseable from bourne shell. Eg for a.b.c style versions
The text was updated successfully, but these errors were encountered: