IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 3, 2009, 1:00:45 PM (17 years ago)
Author:
Paul Price
Message:

Put together system to identify the version that was built. psLibVersion() now returns BRANCH@VERSION: e.g., trunk@22747M. A new function, psLibSource() returns SOURCE: e.g., 60eb6cdc-a59c-4636-a4e0-dba66a9721fd. psLibVersionLong() now returns a much longer string with the versions of the dependent libraries and other notes: e.g., psLib trunk@22747M from 60eb6cdc-a59c-4636-a4e0-dba66a9721fd, built Mar 3 2009, 12:46:47 with cfitsio (3.100), gsl (1.6), fftw (fftw-3.0.1), mysql (4.1.10a) unoptimised with trace. I have set up psConfigure.c (which defines these functions) to be built every time 'make' is called. This might be annoying, but it's necessary so that it receives up-to-date values via svnversion.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sys/psConfigure.c

    r18953 r23115  
    1212 *  @author Ross Harman, MHPCC
    1313 *  @author Robert DeSonia, MHPCC
     14 *  @author Paul Price, IfA
    1415 *
    15  *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
    16  *  @date $Date: 2008-08-08 18:05:08 $
    17  *
    18  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     16 *  Copyright 2004-2009 Institute for Astronomy, University of Hawaii
    1917 */
    2018
     
    2624#include <stdlib.h>
    2725#include <string.h>
     26
     27#include <fitsio.h>
     28#include <longnam.h>
     29#include <fftw3.h>
     30#include <gsl/gsl_version.h>
     31#ifdef HAVE_PSDB
     32#include <mysql.h>
     33#endif
    2834
    2935#include "psAbort.h"
     
    4147static FILE *memCheckFile = NULL;       // File to which to write results of mem check
    4248
    43 static const char *cvsTag = "$Name: not supported by cvs2svn $"; // CVS tag name
    4449
    4550psString psLibVersion(void)
    4651{
    47     psString version = NULL;            // Version, to return
    48     psStringAppend(&version, "%s-%s",PACKAGE_NAME,PACKAGE_VERSION);
    49     return version;
     52#ifndef PSLIB_VERSION
     53#error "PSLIB_VERSION is not set"
     54#endif
     55#ifndef PSLIB_BRANCH
     56#error "PSLIB_BRANCH is not set"
     57#endif
     58    return psStringCopy(PSLIB_BRANCH "@" PSLIB_VERSION);
     59}
     60
     61psString psLibSource(void)
     62{
     63#ifndef PSLIB_SOURCE
     64#error "PSLIB_SOURCE is not set"
     65#endif
     66    return psStringCopy(PSLIB_SOURCE);
    5067}
    5168
    5269psString psLibVersionLong(void)
    5370{
    54     psString version = psLibVersion();    // Version, to return
    55     psString tag = psStringStripCVS(cvsTag, "Name"); // CVS tag
     71    psString version = psLibVersion();  // Version, to return
     72    psString source = psLibSource();    // Source
     73
     74    float cfitsioVersion;               // CFITSIO version number
     75
     76    psStringPrepend(&version, "psLib ");
     77    psStringAppend(&version, " from %s, built %s, %s with cfitsio (%.3f), gsl (%s), fftw (%s)",
     78                   source, __DATE__, __TIME__, fits_get_version(&cfitsioVersion), gsl_version,
     79                   fftwf_version);
     80    psFree(source);
    5681
    5782#ifdef HAVE_PSDB
    58     psStringAppend(&version, " (cvs tag %s), %s, %s with psDB", tag, __DATE__, __TIME__);
     83    psStringAppend(&version, ", mysql (%s)", mysql_get_client_info());
     84#endif
     85
     86#ifdef __OPTIMIZE__
     87    psStringAppend(&version, " optimised");
    5988#else
    60     psStringAppend(&version, " (cvs tag %s), %s, %s without psDB", tag, __DATE__, __TIME__);
     89    psStringAppend(&version, " unoptimised");
    6190#endif
    62     psFree(tag);
     91
     92#ifdef PS_NO_TRACE
     93    psStringAppend(&version, " without trace");
     94#else
     95    psStringAppend(&version, " with trace");
     96#endif
     97
    6398    return version;
    64 }
     99};
    65100
    66101// Check the memory; intended for use on exit, but might be used elsewhere
Note: See TracChangeset for help on using the changeset viewer.