Skip to content

Problem creating a package with high-resolution timer

3 messages · Jens Oehlschlägel, Olaf Mersmann

#
Dear experts,

I am trying to INSTALL to R-2.12.1 a package with a high-resolution time (timer_gettime and friends).
I learned that I need to compile with the real time option "gcc -lrc" and on my 64bit ubuntu 10.04 this 
works if compling a C program standalone. I compiled R and my package with this option, but still I get at the end of the package INSTALL

Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object '/usr/local/lib64/R/library/mypackage/libs/mypackage.so':
  /usr/local/lib64/R/library/mypackage/libs/mypackage.so: undefined symbol: timer_settime
ERROR: loading failed

Any idea?


Jens Oehlschl?gel
#
Dear Jens,

2011/2/3 "Jens Oehlschl?gel" <jens.oehlschlaegel at truecluster.com>:
This should be "gcc -lrt" iirc. Is this a typo? Does it also fail if
you link against librt?

Cheers,
Olaf Mersmann
#
Thanks Olaf,
Thanks Daniel,

Problem solved. The typo was only in the mail. But I funneld the -lrt flag via the R CMD INSTALL mechanics to the compiler instead of to the linker. 
Setting PKG_LIBS=-lrt in Makevars did it. 

Cheers
Jens



-----Urspr?ngliche Nachricht-----
Von: "Olaf Mersmann" <olafm at datensplitter.net>
Gesendet: Feb 3, 2011 1:34:31 PM
An: r-sig-hpc at r-project.org
Betreff: Re: [R-sig-hpc] Problem creating a package with high-resolution timer