From ripley at stats.ox.ac.uk  Sat Dec 22 21:35:54 2007
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Sat, 22 Dec 2007 20:35:54 +0000 (GMT)
Subject: [Rd] SHLIB steps on a Makefile
In-Reply-To: <476D60D0.2040706@cimr.cam.ac.uk>
References: <dba1e14b0712201349t552a9409mb96b1007b3b6a483@mail.gmail.com>
	<Pine.LNX.4.64.0712202206210.11123@gannet.stats.ox.ac.uk>
	<dba1e14b0712201428n3c55c57fx71de164f3ea50f7@mail.gmail.com>
	<476D60D0.2040706@cimr.cam.ac.uk>
Message-ID: <Pine.LNX.4.64.0712222030420.19707@gannet.stats.ox.ac.uk>

On Sat, 22 Dec 2007, Hin-Tak Leung wrote:

> Hmm, I don't think you need a whole Makefile - while it is a
> bit complicated to set locations, etc, essentially if your C code
> needs an extra DLL (well, you'll have to bundle it with your package,
> etc because the otherwise link-loader won't find it), it is mostly
> just in Makevars.win
>
> PGK_LDGLAGS=-lotherlib
>
> 'compiling against a DLL in a another package' is alright, but resolving
> the DLL at runtime won't be trivial (unless you set explicit dependency
> of your package against this other one) ; so you might be better off
> compiling against a static build of the other with yours.

There is an interface to ensure that happens: details in 'Writing R 
Extensions'.  The 'live' example is lme4 'LinkingTo' on Matrix and stats.


> Iago Mosqueira wrote:
> <snipped>
>> Many thanks for the information. I am trying to make a package C code
>> compile against a DLL already present in another package, so I need to
>> include its location in the call to gcc.  I'll see what the most
>> portable system could be and will test widely.
>>
>> Regards,
>>
>>
>> Iago Mosqueira
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
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



[Rd] SHLIB steps on a Makefile
Prof Brian Ripley