Search
Question: 'version' is missing error when running makeTxDbPackageFromUCSC
0
gravatar for Hervé Pagès
3.9 years ago by
Hervé Pagès ♦♦ 12k
United States
Hervé Pagès ♦♦ 12k wrote:
Hi Michael, Not easy for us to support the Intel compiler since our build machines don't use it. The error you get comes from the svn.time() function defined in IRanges. svn.time() is used in the GenomicFeatures package to generate the timestamp of a TranscriptDb object: > example(makeTranscriptDb) > txdb TranscriptDb object: | Db type: TranscriptDb | Supporting package: GenomicFeatures | transcript_nrow: 3 | exon_nrow: 4 | cds_nrow: 4 | Db created by: GenomicFeatures package from Bioconductor | Creation time: 2013-09-03 11:09:39 -0700 (Tue, 03 Sep 2013) | GenomicFeatures version at creation time: 1.13.34 | RSQLite version at creation time: 0.11.4 | DBSCHEMAVERSION: 1.0 The "Creation time" field above was set internally by a call to svn.time(): > svn.time() [1] "2013-09-03 11:10:32 -0700 (Tue, 03 Sep 2013)" The C code for svn.time() is: static int get_svn_time(time_t t, char *out, size_t out_size) { #if defined(__INTEL_COMPILER) return -1; #else /* defined(__INTEL_COMPILER) */ ... #endif /* defined(__INTEL_COMPILER) */ } Last year I added this conditional compilation after someone reported the Intel compiler was not able to compile get_svn_time(). With this at least people using the Intel compiler can now install the IRanges package, but, unfortunately, they still cannot use any of the functions in GenomicFeatures that are based on makeTranscriptDb(). I would gladly accept a patch that makes get_svn_time() work with the Intel compiler. Otherwise I could just modify makeTranscriptDb() so it falls back on using date() if the call to svn.time() fails. Cheers, H. On 08/28/2013 05:43 AM, Michael Steeves wrote: > On 8/27/13 6:31 PM, Dan Tenenbaum wrote: >> This means you have to supply a 'version' argument. See >> ?makeTxDbPackageFromUCSC > > Dan: > > This does fix the issue on OS X, however I'm still getting an error > running the example from the help page on RHEL: > > > txdb <- makeTxDbPackageFromUCSC(version="0.01", > + maintainer="Some One <so at="" someplace.org="">", > + author="Some One <so at="" someplace.com="">", > + genome="sacCer2", > + tablename="ensGene") > Download the ensGene table ... OK > Extract the 'transcripts' data frame ... OK > Extract the 'splicings' data frame ... OK > Download and preprocess the 'chrominfo' data frame ... OK > Prepare the 'metadata' data frame ... OK > Make the TranscriptDb object ... Error in .Call2("svn_time", PACKAGE = > "IRanges") : > IRanges internal error in svn_time(): get_svn_time() failed > > One of my colleagues did some investigation, and it looks like in the > IRanges source code (str_utils.c) is where the problem is coming from: > > /* > * 'out_size' should be at least 45 (for year < 10000, 44 chars will be > * printed to it + '\0'). > */ > static int get_svn_time(time_t t, char *out, size_t out_size) > { > #if defined(__INTEL_COMPILER) > return -1; > #else /* defined(__INTEL_COMPILER) */ > struct tm result; > int utc_offset, n; > > static const char > *wday2str[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}, > *mon2str[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", > "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}, > *svn_format = "%d-%02d-%02d %02d:%02d:%02d %+03d00 (%s, %02d %s %d)"; > > //localtime_r() not available on Windows+MinGW > //localtime_r(&t, &result); > result = *localtime(&t); > #if defined(__APPLE__) || defined(__FreeBSD__) > //'struct tm' has no member named 'tm_gmtoff' on Windows+MinGW > utc_offset = result.tm_gmtoff / 3600; > #else /* defined(__APPLE__) || defined(__FreeBSD__) */ > tzset(); > //timezone is not portable (is a function, not a long, on OS X Tiger) > utc_offset = - (timezone / 3600); > if (result.tm_isdst > 0) > utc_offset++; > #endif /* defined(__APPLE__) || defined(__FreeBSD__) */ > n = snprintf(out, out_size, svn_format, > result.tm_year + 1900, > result.tm_mon + 1, > result.tm_mday, > result.tm_hour, > result.tm_min, > result.tm_sec, > utc_offset, > wday2str[result.tm_wday], > result.tm_mday, > mon2str[result.tm_mon], > result.tm_year + 1900); > return n >= out_size ? -1 : 0; > #endif /* defined(__INTEL_COMPILER) */ > } > > We are using the Intel compilers to build on Linux -- is this a bug, or > is using the Intel compilers not supported? > > > -Mike > -- Hervé Pagès Program in Computational Biology Division of Public Health Sciences Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N, M1-B514 P.O. Box 19024 Seattle, WA 98109-1024 E-mail: hpages at fhcrc.org Phone: (206) 667-5791 Fax: (206) 667-1319
ADD COMMENTlink modified 20 months ago by dave10 • written 3.9 years ago by Hervé Pagès ♦♦ 12k
1
gravatar for dave
2.0 years ago by
dave10
United States
dave10 wrote:

Hi,

Just came across this issue on our cluster which is using an intel compiled version of R. Since the problem is timezone related, perhaps a suitable patch would be to just return UTC times when the intel compiler is in use. These won't be incorrect, just a little less friendly.

Something like the following in str-utils.c:

static int get_svn_time(time_t t, char *out, size_t out_size)
{
        struct tm result;
        int utc_offset, n;

        static const char
          *wday2str[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"},
          *mon2str[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
                        "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"},
          *svn_format = "%d-%02d-%02d %02d:%02d:%02d %+03d00 (%s, %02d %s %d)";
#if defined(__INTEL_COMPILER)
        result = *gmtime(&t);
        utc_offset = 0;
#else /* defined(__INTEL_COMPILER) */
        //localtime_r() not available on Windows+MinGW
        //localtime_r(&t, &result);
        result = *localtime(&t);
#if defined(__APPLE__) || defined(__FreeBSD__)
        //'struct tm' has no member named 'tm_gmtoff' on Windows+MinGW
        utc_offset = result.tm_gmtoff / 3600;
#else /* defined(__APPLE__) || defined(__FreeBSD__) */
        tzset();
        //timezone is not portable (is a function, not a long, on OS X Tiger)
        utc_offset = - (timezone / 3600);
        if (result.tm_isdst > 0)
                utc_offset++;
#endif /* defined(__INTEL_COMPILER) */

...

 

... which will result in the UTC time being reported even though I'm in CST when built with an intel compiler:

> svn.time()
[1] "2015-07-14 14:42:19 +0000 (Tue, 14 Jul 2015)"

 

Cheers,

Dave Trudgian

 

ADD COMMENTlink modified 2.0 years ago • written 2.0 years ago by dave10

Hi Dave -- just to say that you're being heard; Hervé is on vacation and he's really the expert here. Maybe the C function should always return UTC, and let R worry about time zone?

ADD REPLYlink written 2.0 years ago by Martin Morgan ♦♦ 20k

Hi Dave,

Sorry for the delay. I just made a change to S4Vectors that might address this. The change is in versions 0.6.4 (release) and 0.7.14 (devel) which should become available via biocLite() in the next 24 hours or less. I don't have access to the Intel Compiler though so I was not able to test this. Would be great if you could give it a try and let me know. Thanks in advance!

H.

ADD REPLYlink written 23 months ago by Hervé Pagès ♦♦ 12k

Sorry for not having replied before now - I've made a note to try this on Monday on our systems with the Intel compiler. Thanks!

ADD REPLYlink written 21 months ago by dave10
0
gravatar for dave
20 months ago by
dave10
United States
dave10 wrote:

Sorry for delay. This is looking good to me now. Just installed with an intel compiled R via biocLite() into personal library and then:

 

> library(S4Vectors)

......

> svn.time()
[1] "2015-10-29 10:30:45 -0500 (Thu, 29 Oct 2015)"

 

Cheers,

DT

ADD COMMENTlink written 20 months ago by dave10
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 370 users visited in the last hour