Commit 9db71466 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Added HDF5 library version to greeting message

parent e1608a22
......@@ -26,6 +26,10 @@
#include <mpi.h>
#endif
#ifdef HAVE_HDF5
#include <hdf5.h>
#endif
/* Some standard headers. */
#include <stdio.h>
#include <string.h>
......@@ -150,6 +154,21 @@ const char *mpi_version(void) {
return version;
}
const char *hdf5_version(void) {
static char version[256] = {0};
#ifdef HAVE_HDF5
unsigned int majnum, minnum, relnum;
H5get_libversion( &majnum, &minnum, &relnum ) ;
sprintf(version, "%i.%i.%i", majnum, minnum, relnum);
#else
sprintf(lib_version, "Unknow version");
#endif
return version;
}
/**
* @brief Prints a greeting message to the standard output containing code
* version and revision number
......@@ -166,10 +185,13 @@ void greetings(void) {
printf(" Version : %s\n", package_version());
printf(" Revision: %s, Branch: %s\n", git_revision(), git_branch());
printf(" Webpage : www.swiftsim.com\n");
printf(" Webpage : www.swiftsim.com\n\n");
printf(" Compiler: %s, Version: %s\n", compiler_name(), compiler_version());
#ifdef WITH_MPI
printf(" MPI library: %s\n", mpi_version());
#endif
#ifdef HAVE_HDF5
printf(" HDF5 library version: %s\n", hdf5_version());
#endif
printf("\n");
}
......@@ -36,6 +36,7 @@ const char* git_branch(void);
const char* compiler_name(void);
const char* compiler_version(void);
const char* mpi_version(void);
const char *hdf5_version(void);
void greetings(void);
#endif /* SWIFT_VERSION_H */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment