Changeset 3717 for trunk/src


Ignore:
Timestamp:
Jun 27, 2013 1:26:46 PM (7 years ago)
Author:
gah
Message:

fixes for R build, can now make clean, make

Location:
trunk/src/core
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/Makefile.in

    r3471 r3717  
    1313INSTALL         = @INSTALL@
    1414MKDIR_P         = @MKDIR_P@
    15 
     15SVN_VERSION     := $(shell svnversion $(srcdir))
     16RAPPTURE_VERSION = @PACKAGE_VERSION@
    1617CXX             = @CXX@
    1718# This hack is because the tcl.m4 file generates the line
     
    3233DX_LIB_SPEC     = @DX_LIB_SPEC@
    3334DX_INC_SPEC     = @DX_INC_SPEC@
    34 
    35 CC_SWITCHES     = $(CFLAGS) $(CFLAGS_DEBUG) $(INCLUDES) $(DEFINES)
    36 CXX_SWITCHES    = $(CFLAGS) $(CFLAGS_DEBUG) $(INCLUDES) $(DEFINES)
     35DEFINES         = -DSVN_VERSION=\"$(SVN_VERSION)\" \
     36                  -DRAPPTURE_VERSION=\"$(RAPPTURE_VERSION)\"
     37
     38CC_SWITCHES     = $(CFLAGS) $(CFLAGS_DEBUG) $(INCLUDES) $(DEFINES)
     39CXX_SWITCHES    = $(CFLAGS) $(CFLAGS_DEBUG) $(INCLUDES) $(DEFINES)
    3740
    3841INCLUDES        = \
  • trunk/src/core/RpLibrary.cc

    r3681 r3717  
    1212 */
    1313
     14#include "config.h"
    1415#include "scew/scew.h"
    1516#include "scew_extras.h"
     
    22222223RpLibrary::result(int exitStatus)
    22232224{
    2224     std::stringstream outputFile;
    22252225    std::fstream file;
    22262226    std::string xmlText = "";
    2227     std::string timestamp = "";
    2228     std::string username = "";
    2229     std::string hostname = "";
     2227    time_t t;
     2228    struct tm* timeinfo;
     2229    std::stringstream outputFile;
     2230    std::string timestamp;
     2231    std::string username;
     2232    std::string hostname;
    22302233    char *user = NULL;
    22312234
    2232     if (this->root) {
    2233         time_t t;
    2234         struct tm* timeinfo = NULL;
    2235 
    2236 #ifdef _POSIX_SOURCE
    2237         // if the posix function gettimeofday is available,
    2238         // we can get more precision on the time and more
    2239         // unique filenames.
    2240         struct timeval tv;
    2241         gettimeofday(&tv,NULL);
    2242         outputFile << "run" << tv.tv_sec << tv.tv_usec << ".xml";
     2235    if (this->root == NULL) {
     2236        return;                         /* No tree available */
     2237    }
     2238
     2239    t = time(NULL);                     /* This is presumably the time the
     2240                                         * simulation finished. */
     2241#ifdef HAVE_GETTIMEOFDAY
     2242    /* If the posix function gettimeofday is available, use it to produce
     2243     * unique filenames. */
     2244    struct timeval tv;
     2245    gettimeofday(&tv,NULL);
     2246    outputFile << "run" << tv.tv_sec << tv.tv_usec << ".xml";
    22432247#else
    2244         outputFile << "run" << (int)time(&t) << ".xml";
     2248    outputFile << "run" << (int)t << ".xml";
    22452249#endif
    2246         file.open(outputFile.str().c_str(),std::ios::out);
    2247 
    2248         put("tool.version.rappture.revision","$LastChangedRevision$");
    2249         put("tool.version.rappture.modified","$LastChangedDate$");
    2250         if ( "" == get("tool.version.rappture.language") ) {
    2251             put("tool.version.rappture.language","c++");
    2252         }
    2253         t = time(NULL);
    2254         // generate a timestamp for the run file
    2255         timeinfo = localtime(&t);
    2256         timestamp = std::string(ctime(&t));
    2257         // erase the 24th character because it is a newline
    2258         timestamp.erase(24);
    2259         // concatenate the timezone
    2260         timestamp.append(" ");
     2250    file.open(outputFile.str().c_str(),std::ios::out);
     2251   
     2252   
     2253    put("tool.version.rappture.version", RAPPTURE_VERSION);
     2254    put("tool.version.rappture.revision", SVN_VERSION);
     2255    put("tool.version.rappture.modified",
     2256        "$LastChangedDate$");
     2257    if ( "" == get("tool.version.rappture.language") ) {
     2258        put("tool.version.rappture.language","c++");
     2259    }
     2260    // generate a timestamp for the run file
     2261    timeinfo = localtime(&t);
     2262    timestamp = std::string(ctime(&t));
     2263    // erase the 24th character because it is a newline
     2264    timestamp.erase(24);
     2265    // concatenate the timezone
     2266    timestamp.append(" ");
    22612267#ifdef _WIN32
    2262         timestamp.append(_tzname[_daylight]);
    2263         // username is left blank for windows because i dont know
    2264         // how to retrieve username on win32 environment.
    2265         username = "";
    2266         hostname = "";
     2268    timestamp.append(_tzname[_daylight]);
     2269    username = "";
     2270    hostname = "";
     2271    user = getenv("USERNAME");
     2272    if (user != NULL) {
     2273        username = std::string(user);
     2274    } else {
     2275        user = getenv("LOGNAME");
     2276        if (user != NULL) {
     2277            username = std::string(user);
     2278        }
     2279    }
    22672280#else
    2268         timestamp.append(timeinfo->tm_zone);
    2269         user = getenv("USER");
    2270         if (user != NULL) {
    2271             username = std::string(user);
    2272         } else {
    2273             user = getenv("LOGNAME");
    2274             if (user != NULL) {
    2275                 username = std::string(user);
    2276             }
    2277         }
     2281    timestamp.append(timeinfo->tm_zone);
     2282    user = getenv("USER");
     2283    if (user != NULL) {
     2284        username = std::string(user);
     2285    } else {
     2286        user = getenv("LOGNAME");
     2287        if (user != NULL) {
     2288            username = std::string(user);
     2289        }
     2290    }
    22782291#endif
    22792292
    2280         // add the timestamp to the run file
    2281         put("output.time", timestamp);
    2282         put("output.status",exitStatus);
    2283         put("output.user",username);
    2284         put("output.host",hostname);
    2285 
    2286         if ( file.is_open() ) {
    2287             xmlText = xml();
    2288             if (!xmlText.empty()) {
    2289                 file << xmlText;
    2290             }
    2291             // check to make sure there were no
    2292             // errors while writing the run.xml file.
    2293             if (   (!file.good())
    2294                 || ((long)xmlText.length() != ((long)file.tellp()-(long)1))
     2293    // add the timestamp to the run file
     2294    put("output.time", timestamp);
     2295    put("output.status",exitStatus);
     2296    put("output.user",username);
     2297    put("output.host",hostname);
     2298   
     2299    if ( file.is_open() ) {
     2300        xmlText = xml();
     2301        if (!xmlText.empty()) {
     2302            file << xmlText;
     2303        }
     2304        // check to make sure there were no
     2305        // errors while writing the run.xml file.
     2306        if (   (!file.good())
     2307               || ((long)xmlText.length() != ((long)file.tellp()-(long)1))
    22952308               ) {
    2296                  status.error("Error while writing run file");
    2297                  status.addContext("RpLibrary::result()");
    2298             }
    2299             file.close();
    2300         }
    2301         else {
    2302             status.error("Error while opening run file");
    2303             status.addContext("RpLibrary::result()");
    2304         }
    2305         std::cout << "=RAPPTURE-RUN=>" << outputFile.str() << std::endl;
    2306     }
     2309            status.error("Error while writing run file");
     2310            status.addContext("RpLibrary::result()");
     2311        }
     2312        file.close();
     2313    } else {
     2314        status.error("Error while opening run file");
     2315        status.addContext("RpLibrary::result()");
     2316    }
     2317    std::cout << "=RAPPTURE-RUN=>" << outputFile.str() << std::endl;
    23072318}
    23082319
  • trunk/src/core/config.h.in

    r3373 r3717  
    7070#undef HAVE_CTYPE_H
    7171
     72/* Define to 1 if you have the <env.h> header file. */
     73#undef HAVE_ENV_H
     74
    7275/* Define to 1 if you have the <errno.h> header file. */
    7376#undef HAVE_ERRNO_H
    7477
     78/* Render servers can use ffmpeg */
     79#undef HAVE_FFMPEG
     80
    7581/* Define to 1 if you have the <ffmpeg/avcodec.h> header file. */
    7682#undef HAVE_FFMPEG_AVCODEC_H
     
    9197#undef HAVE_FSTREAM
    9298
     99/* Define to 1 if you have the `gettimeofday' function. */
     100#undef HAVE_GETTIMEOFDAY
     101
    93102/* Define to 1 if you have the `img_convert' function. */
    94103#undef HAVE_IMG_CONVERT
     
    121130#undef HAVE_LIBAVUTIL_AVUTIL_H
    122131
    123 /* Define to 1 if you have the `m' library (-lm). */
    124 #undef HAVE_LIBM
    125 
    126132/* Define to 1 if you have the `ncurses' library (-lncurses). */
    127133#undef HAVE_LIBNCURSES
     
    154160#undef HAVE_NCURSES_H
    155161
     162/* Define to 1 if you have the <node.h> header file. */
     163#undef HAVE_NODE_H
     164
    156165/* Define to 1 if you have the <Python.h> header file. */
    157166#undef HAVE_PYTHON_H
    158167
     168/* Define to 1 if you have the <ruby.h> header file. */
     169#undef HAVE_RUBY_H
     170
     171/* Define to 1 if you have the <ruby/node.h> header file. */
     172#undef HAVE_RUBY_NODE_H
     173
    159174/* Define to 1 if you have the <sstream> header file. */
    160175#undef HAVE_SSTREAM
     
    208223#undef HAVE_VECTOR
    209224
     225/* Define to 1 if you have the <version.h> header file. */
     226#undef HAVE_VERSION_H
     227
    210228/* Define to the address where bug reports for this package should be sent. */
    211229#undef PACKAGE_BUGREPORT
     
    225243/* Define to the version of this package. */
    226244#undef PACKAGE_VERSION
     245
     246/* Define this macro to use ruby/node.h */
     247#undef REALLY_HAVE_RUBY_NODE_H
    227248
    228249/* The size of `int', as computed by sizeof. */
Note: See TracChangeset for help on using the changeset viewer.