[R] automated libR location

Prof Brian Ripley ripley at stats.ox.ac.uk
Sat Jan 28 10:49:51 CET 2012


'library' in R has a different meaning: I've altered the subject to be 
more accurate 'libR'.

This is what R CMD SHLIB is for: it does all this for you in a portable way.

But if you want to DIY, you can use R CMD config to find out the 
appropriate linker incantation.

BTW, I think it is Octave that is out of step here: almost everything 
else uses some sort of 'foo-config' command, or pkg-config (and R 
provides a pkg-config file, so you should be able to do
pkg-config libR --libs
in the standard fashion, for an installed copy of R).

On 28/01/2012 07:44, R. Michael Weylandt wrote:
> ? libPaths
> ? .Library

That's the other sense of 'library'.

> Not sure how easily that gets to your makefile though.
>
> Michael
>
> On Fri, Jan 27, 2012 at 7:35 PM, Matyas Sustik<msustik at gmail.com>  wrote:
>> Hi All,
>>
>> Is there a way to find out the R library location that I could use in
>> a script or
>> Makefile?  For example for octave the mkoctfile compiler has the
>> following feature:
>>
>> Well?>  mkoctfile -p LFLAGS
>> -L/usr/lib/octave-3.2.4
>>
>> This is quite useful to be used in Makefiles.  I am compiling a
>> dynamic object to be
>> used in R and my compile command has "-L/usr/lib/R/lib" in it.  However, if this
>> changes from distribution to distribution then hard coding it, is not optimal.
>>
>> Thanks!
>> -Matyas
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list