From adrian at waddell.ch  Tue Aug 31 15:39:47 2010
From: adrian at waddell.ch (Adrian Waddell)
Date: Tue, 31 Aug 2010 09:39:47 -0400
Subject: [Rd] Including C Code for Tcl and Tk in an R package
In-Reply-To: <alpine.LFD.2.00.1008300756080.15400@gannet.stats.ox.ac.uk>
References: <4C7B492E.2060200@waddell.ch>
	<alpine.LFD.2.00.1008300756080.15400@gannet.stats.ox.ac.uk>
Message-ID: <4C7D0623.7050502@waddell.ch>

On 08/30/2010 03:01 AM, Prof Brian Ripley wrote:
> On Mon, 30 Aug 2010, Adrian Waddell wrote:
> 
>> Dear R Community,
>>
>> I adapted the C-Code found at (http://wiki.tcl.tk/25685) implementing
>> fast image resizing for Tk images for my R package.
>>
>> The C Code differs for tcl/tk version 8.4 and 8.5. I have the working
>> code for both versions.
>>
>> How do I integrate this C-Code into my package so that R CMD INSTALL
>> takes care of compiling the function correct for each OS and tcl
>> version? (such that I can submit the package to CRAN).
>>
>> Once the two files would be compiled I could load the correct function
> 
> You can't do that: very few systems will have both Tcl 8.4 and 8.5
> libraries installed.  So you need to use the package's configure script
> to detect the Tcl/Tk version and also what libraries to compile against.
> 
> I'm not sure I would try to support Tcl 8.4: 8.5 has been out for a long
> time now and you could simply make it a package SystemRequirement.  We
> are only support 8.4 in R because we have existing code to do so that
> has not yet been removed.
> 

Thank you very much for your input. Does anybody know by any chance a
package which would provide an example of such a configure script?



[Rd] Including C Code for Tcl and Tk in an R package
Adrian Waddell