jeffdaily / parasail

Pairwise Sequence Alignment Library
Other
243 stars 34 forks source link

Querying version of installed parasail? #61

Closed HenrikBengtsson closed 5 years ago

HenrikBengtsson commented 6 years ago

Is it possible to query the version of an install parasail library/bins? I'm thinking of something along the line:

$ parasail_aligner --version
2.2.0

This could be hand for users on multi-tenant systems where the user itself hasn't installed the library.

jeffdaily commented 6 years ago

Unfortunately, no, there is no way to query the installed parasail version. Perhaps I can offer some undesirable alternatives.

int main(int argc, char **argv) { int major, minor, patch; parasail_version(&major, &minor, &patch); printf("parasail version %d.%d.%d\n", major, minor, patch); return 0; }

- Use this script if you know where the parasail.h header is installed (all version info is in the header)

!/bin/sh

#

This script extracts the version from parasail.h, which is the master

location for this information.

# if [ "$#" -ge 2 ]; then echo "Too many arguments" exit 1 fi if [ "$#" -ne 1 ]; then echo "Must specify location of parasail.h" exit 1 fi case $1 in parasail.h) ;; *) echo "Specified location should look like 'path/to/parasail.h'"; exit 1 ;; esac if [ ! -f $1 ]; then echo "parasail.h does not exist at specified location" exit 1 fi MAJOR=egrep '^#define +PARASAIL_VERSION_MAJOR +[0-9]+$' $1 MINOR=egrep '^#define +PARASAIL_VERSION_MINOR +[0-9]+$' $1 PATCH=egrep '^#define +PARASAIL_VERSION_PATCH +[0-9]+$' $1 if [ -z "$MAJOR" -o -z "$MINOR" -o -z "$PATCH" ]; then echo "version.sh: error: could not extract version from parasail.h" 1>&2 exit 1 fi MAJOR=echo $MAJOR | awk '{ print $3 }' MINOR=echo $MINOR | awk '{ print $3 }' PATCH=echo $PATCH | awk '{ print $3 }' echo "parasail version $MAJOR.$MINOR.$PATCH"

HenrikBengtsson commented 6 years ago

May I add this to the wish list of features add in the future?

Being able to easily infer/know the version of all software tools used is essential in reproducible research and scientific reporting, but also extremely useful when troubleshooting/reporting bugs.

jeffdaily commented 6 years ago

Which solution would you prefer?

The C library function has been there for a long time. Originally, I had only planned on doing the C library and not doing the parasail_aligner application. But I think most people use the application. I'm out of short letter options (both -v and -V are taken for verbosity), so I think I could add a check for --version. Wish I could go back and add this option from the very beginning. It doesn't do you a lot of good to add it now since we're already 2 major versions in.

Elmohound commented 6 years ago

On approach would be to always include version information in the verbose output. That would avoid having to support an additional commandline argument.

HenrikBengtsson commented 6 years ago

I like @Elmohound's suggestion.

jeffdaily commented 6 years ago

df2e016c49791da8b7847c3e37b640eeff4a133a in develop branch adds the version to verbose output.

jeffdaily commented 5 years ago

This feature was released as part of 2.3. Closing issue now.

HenrikBengtsson commented 5 years ago

thxs