Skip to content
Snippets Groups Projects
Commit 27dd260b authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Correctly detect the GSL and print its version in the greetings.

parent 4d236c14
No related branches found
No related tags found
1 merge request!509Cosmological time integration
......@@ -404,6 +404,10 @@ AC_HEADER_STDC
# Check for the libraries we will need.
AC_CHECK_LIB(m,sqrt,,AC_MSG_ERROR(something is wrong with the math library!))
# Check for GSL
AC_CHECK_LIB([gslcblas],[cblas_dgemm])
AC_CHECK_LIB([gsl],[gsl_blas_dgemm])
# Check for pthreads.
AX_PTHREAD([LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC" LDFLAGS="$LDFLAGS $PTHREAD_LIBS $LIBS"],
......
......@@ -395,6 +395,9 @@ void io_write_code_description(hid_t h_file) {
#ifdef HAVE_FFTW
io_write_attribute_s(h_grpcode, "FFTW library version", fftw3_version());
#endif
#ifdef HAVE_LIBGSL
io_write_attribute_s(h_grpcode, "GSL library version", libgsl_version());
#endif
#ifdef WITH_MPI
io_write_attribute_s(h_grpcode, "MPI library", mpi_version());
#ifdef HAVE_METIS
......
......@@ -37,6 +37,10 @@
#include <fftw3.h>
#endif
#ifdef HAVE_LIBGSL
#include <gsl/gsl_version.h>
#endif
/* Some standard headers. */
#include <stdio.h>
#include <stdlib.h>
......@@ -332,6 +336,22 @@ const char *fftw3_version(void) {
return version;
}
/**
* @brief return the GSL version used when SWIFT was built.
*
* @result description of the GSL version.
*/
const char *libgsl_version(void) {
static char version[256] = {0};
#if defined(HAVE_LIBGSL)
sprintf(version, "%s", gsl_version);
#else
sprintf(version, "Unknown version");
#endif
return version;
}
/**
* @brief return the thread barrier used in SWIFT.
*
......@@ -376,6 +396,9 @@ void greetings(void) {
#ifdef HAVE_FFTW
printf(" FFTW library version: %s\n", fftw3_version());
#endif
#ifdef HAVE_LIBGSL
printf(" GSL library version: %s\n", libgsl_version());
#endif
#ifdef WITH_MPI
printf(" MPI library: %s\n", mpi_version());
#ifdef HAVE_METIS
......
......@@ -34,6 +34,7 @@ const char* mpi_version(void);
const char* metis_version(void);
const char* hdf5_version(void);
const char* fftw3_version(void);
const char* libgsl_version(void);
const char* thread_barrier_version(void);
void greetings(void);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment