LCOV - code coverage report
Current view: top level - export/scratch1/home/monet/testing/b50e8e2d6f02-1-1-1/build/tools/mserver - monet_version.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 24 26 92.3 %
Date: 2021-10-13 02:24:04 Functions: 2 2 100.0 %

          Line data    Source code
       1             : /* -*-C-*- */
       2             : 
       3             : /*
       4             :  * This Source Code Form is subject to the terms of the Mozilla Public
       5             :  * License, v. 2.0.  If a copy of the MPL was not distributed with this
       6             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       7             :  *
       8             :  * Copyright 1997 - July 2008 CWI, August 2008 - 2021 MonetDB B.V.
       9             :  */
      10             : 
      11             : #include "monetdb_config.h"
      12             : #include "mal.h"
      13             : #include "monet_version.h"
      14             : #include "mutils.h"
      15             : #ifdef HAVE_LIBPCRE
      16             : #include <pcre.h>
      17             : #endif
      18             : #ifdef HAVE_LIBXML
      19             : #include <libxml/xmlversion.h>
      20             : #endif
      21             : 
      22             : #define STRING(a)  # a
      23             : #define XSTRING(s) STRING(s)
      24             : 
      25             : #if defined(HAVE_LIBPCRE)
      26             : static void
      27           1 : print_libversion(const char *lib, const char *rtvers, const char *cmvers)
      28             : {
      29           1 :         printf("  %s: %s", lib, rtvers);
      30           1 :         if (strcmp(rtvers, cmvers) != 0)
      31           0 :                 printf(" (compiled with %s)", cmvers);
      32           1 :         printf("\n");
      33           1 : }
      34             : #endif
      35             : 
      36             : void
      37           1 : monet_version(void)
      38             : {
      39             :         dbl sz_mem_gb;
      40             :         int cores;
      41             : 
      42           1 :         MT_init();  /* for MT_pagesize */
      43           1 :         sz_mem_gb = (dbl)(MT_npages() * MT_pagesize()) / (1024.0 * 1024.0 * 1024.0);
      44           1 :         cores = MT_check_nr_cores();
      45             : 
      46           1 :         printf("MonetDB 5 server %s", GDKversion());
      47             : #ifdef MONETDB_RELEASE
      48             :         printf(" (%s)", MONETDB_RELEASE);
      49             : #else
      50           1 :         const char *rev = mercurial_revision();
      51           1 :         if (strcmp(rev, "Unknown") != 0)
      52           0 :                 printf(" (hg id: %s)", rev);
      53             : #endif
      54           1 :         printf(" (%zu-bit%s)\n",
      55             :                         (size_t) (sizeof(ptr) * 8),
      56             : #ifdef HAVE_HGE
      57             :                         ", 128-bit integers"
      58             : #else
      59             :                         ""
      60             : #endif
      61             :         );
      62             : #ifndef MONETDB_RELEASE
      63           1 :         printf("This is an unreleased version\n");
      64             : #endif
      65           1 :         printf("Copyright (c) 1993 - July 2008 CWI\n"
      66             :                "Copyright (c) August 2008 - 2021 MonetDB B.V., all rights reserved\n");
      67           1 :         printf("Visit https://www.monetdb.org/ for further information\n");
      68           1 :         printf("Found %.1fGiB available memory, %d available cpu core%s\n",
      69             :                         sz_mem_gb, cores, cores != 1 ? "s" : "");
      70             :         /* don't want to GDKinit just for this
      71             :                         "using %d thread%s\n",
      72             :                         GDKnr_threads, GDKnr_threads != 1 ? "s" : ""); */
      73           1 :         printf("Libraries:\n");
      74             : #ifdef HAVE_LIBPCRE
      75             :         /* PCRE_PRERELEASE may be defined as an empty value.  In order
      76             :          * to get the proper amount of white space between various
      77             :          * parts of the version string on different compilers (none
      78             :          * between minor and prerelease, a single one between that
      79             :          * combination and the date), we need to resort to some
      80             :          * run-time trickery since we can't do it with the
      81             :          * preprocessor */
      82           1 :         print_libversion("libpcre",
      83             :                          pcre_version(),
      84             :                          XSTRING(Z PCRE_PRERELEASE)[1] == 0
      85             :                          ? XSTRING(PCRE_MAJOR.PCRE_MINOR PCRE_DATE)
      86             :                          : XSTRING(PCRE_MAJOR.PCRE_MINOR)
      87             :                            XSTRING(PCRE_PRERELEASE PCRE_DATE));
      88             : #endif
      89             : #ifdef HAVE_LIBXML
      90             :         /* no run-time version available, so only compile time */
      91           1 :         printf("  libxml2: %s\n", LIBXML_DOTTED_VERSION);
      92             : #endif
      93           1 :         printf("Compiled by: %s (%s)\n", "monet@lab01.da.cwi.nl", HOST);
      94           1 :         printf("Compilation: %s\n", "/usr/lib64/ccache/cc --coverage");
      95           1 :         printf("Linking    : %s\n", "/usr/bin/ld");
      96           1 : }

Generated by: LCOV version 1.14