IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 17, 2009, 12:08:50 PM (17 years ago)
Author:
beaumont
Message:

merged with head

Location:
branches/cnb_branches/cnb_branch_20090301
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090301

  • branches/cnb_branches/cnb_branch_20090301/psLib/src/sys/psConfigure.c

    r18953 r23352  
    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
     49#ifndef PSLIB_VERSION
     50#error "PSLIB_VERSION is not set"
     51#endif
     52#ifndef PSLIB_BRANCH
     53#error "PSLIB_BRANCH is not set"
     54#endif
     55#ifndef PSLIB_SOURCE
     56#error "PSLIB_SOURCE is not set"
     57#endif
     58
     59#define xstr(s) str(s)
     60#define str(s) #s
    4461
    4562psString psLibVersion(void)
    4663{
    47     psString version = NULL;            // Version, to return
    48     psStringAppend(&version, "%s-%s",PACKAGE_NAME,PACKAGE_VERSION);
    49     return version;
     64    char *value = NULL;
     65    psStringAppend(&value, "%s@%s", xstr(PSLIB_BRANCH), xstr(PSLIB_VERSION));
     66    return value;
     67}
     68
     69psString psLibSource(void)
     70{
     71    return psStringCopy(xstr(PSLIB_SOURCE));
     72}
     73
     74psString psLibDependencies(void)
     75{
     76    psString deps = NULL;               // Dependencies, to return
     77    float cfitsioVersion;               // CFITSIO version number
     78    psStringAppend(&deps, "cfitsio-%.3f gsl-%s %s",
     79                   fits_get_version(&cfitsioVersion), gsl_version, fftwf_version);
     80
     81#ifdef HAVE_PSDB
     82    psStringAppend(&deps, " mysql-%s", mysql_get_client_info());
     83#endif
     84
     85    return deps;
    5086}
    5187
    5288psString psLibVersionLong(void)
    5389{
    54     psString version = psLibVersion();    // Version, to return
    55     psString tag = psStringStripCVS(cvsTag, "Name"); // CVS tag
     90    psString version = psLibVersion();  // Version, to return
     91    psString source = psLibSource();    // Source
     92    psString deps = psLibDependencies();// Dependencies
    5693
    57 #ifdef HAVE_PSDB
    58     psStringAppend(&version, " (cvs tag %s), %s, %s with psDB", tag, __DATE__, __TIME__);
     94    psStringPrepend(&version, "psLib ");
     95    psStringAppend(&version, " from %s, built %s, %s with %s",
     96                   source, __DATE__, __TIME__, deps);
     97    psFree(source);
     98    psFree(deps);
     99
     100#ifdef __OPTIMIZE__
     101    psStringAppend(&version, " optimised");
    59102#else
    60     psStringAppend(&version, " (cvs tag %s), %s, %s without psDB", tag, __DATE__, __TIME__);
     103    psStringAppend(&version, " unoptimised");
    61104#endif
    62     psFree(tag);
     105
     106#ifdef PS_NO_TRACE
     107    psStringAppend(&version, " without trace");
     108#else
     109    psStringAppend(&version, " with trace");
     110#endif
     111
    63112    return version;
    64 }
     113};
    65114
    66115// Check the memory; intended for use on exit, but might be used elsewhere
Note: See TracChangeset for help on using the changeset viewer.