Commit ec52c170 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Write the allocator library in the snapshots to match what is done for other...

Write the allocator library in the snapshots to match what is done for other libraries we link against.
parent 77e916ad
......@@ -696,6 +696,8 @@ if test "x$with_tcmalloc" != "xno"; then
if test "$have_tcmalloc" = "yes"; then
TCMALLOC_LIBS="$tclibs"
AC_DEFINE([HAVE_TCMALLOC],1,[The tc-malloc library appears to be present.])
have_special_allocator="yes"
# Prevent compilers that replace the calls with built-ins (GNU 99) from doing so.
......@@ -737,6 +739,8 @@ if test "x$with_jemalloc" != "xno"; then
if test "$have_jemalloc" = "yes"; then
JEMALLOC_LIBS="$jelibs"
AC_DEFINE([HAVE_JEMALLOC],1,[The je-malloc library appears to be present.])
have_special_allocator="yes"
# Prevent compilers that replace the regular calls with built-ins (GNU 99) from doing so.
......@@ -778,6 +782,8 @@ if test "x$with_tbbmalloc" != "xno"; then
if test "$have_tbbmalloc" = "yes"; then
TBBMALLOC_LIBS="$tbblibs"
AC_DEFINE([HAVE_TBBMALLOC],1,[The TBB-malloc library appears to be present.])
have_special_allocator="yes"
# Prevent compilers that replace the calls with built-ins (GNU 99) from doing so.
......
......@@ -340,6 +340,7 @@ void io_write_code_description(hid_t h_file) {
io_write_attribute_s(h_grpcode, "CFLAGS", compilation_cflags());
io_write_attribute_s(h_grpcode, "HDF5 library version", hdf5_version());
io_write_attribute_s(h_grpcode, "Thread barriers", thread_barrier_version());
io_write_attribute_s(h_grpcode, "Allocators", allocator_version());
#ifdef HAVE_FFTW
io_write_attribute_s(h_grpcode, "FFTW library version", fftw3_version());
#endif
......
......@@ -368,6 +368,26 @@ const char *thread_barrier_version(void) {
return version;
}
/**
* @brief return the allocator library used in SWIFT.
*
* @result description of the allocation library
*/
const char *allocator_version(void) {
static char version[256] = {0};
#if defined(HAVE_TBBMALLOC)
sprintf(version, "TBB malloc");
#elif defined(HAVE_TCMALLOC)
sprintf(version, "tc-malloc");
#elif defined(HAVE_JEMALLOC)
sprintf(version, "je-malloc");
#else
sprintf(version, "Compiler version (probably glibc)");
#endif
return version;
}
/**
* @brief Prints a greeting message to the standard output containing code
* version and revision number
......
......@@ -36,6 +36,7 @@ const char* hdf5_version(void);
const char* fftw3_version(void);
const char* libgsl_version(void);
const char* thread_barrier_version(void);
const char* allocator_version(void);
void greetings(void);
#endif /* SWIFT_VERSION_H */
Markdown is supported
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