Re: [Rd] R package compilation: files in src directory should be ignored if C library is not available

From: Cule, Erika <erika.cule05_at_imperial.ac.uk>
Date: Fri, 17 Aug 2012 12:07:22 +0000

Ah I see! Had not thought of that solution.

(This is the first time I have tried to use autoconf and configure)

Many thanks.

Erika

On 17 Aug 2012, at 13:04, Dirk Eddelbuettel wrote:

>
> On 17 August 2012 at 11:44, Cule, Erika wrote:
> | If so, I still don't understand what happens when I compile the package if GSL is not installed on the computer, as there will still be C code in the src directory.
>
> That is precisely the use case for autoconf et al.
>
> You test if something (here GSL) is available (and there are macros and
> examples for in many places) and then define a header file variable such as
> I_HAVE_FOUND_GSL as 1 or 0, say. In your C code, you then use something like
>
> #if I_HAVE_FOUND_GSL == 1
>
> some code
>
> #endif
>
> Now your code compiles in both cases.
>
> Alternatively, you just depend on the GSL. Many packages on CRAN do, and the
> Windows build infrastructure provides it.
>
> Dirk
>
> --
> Dirk Eddelbuettel | edd@debian.org | http://dirk.eddelbuettel.com



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri 17 Aug 2012 - 12:12:13 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 17 Aug 2012 - 20:30:40 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive