[Rcpp-devel] Using CMakeLists.txt

Richard Downe richard-downe at uiowa.edu
Tue Mar 5 23:06:51 CET 2013


I must admit, it's been awhile since I cobbled together my solution; I 
know it's worked seamlessly on 2 or 3 linux variants, but hasn't been 
tested beyond that.

I do recall getting frustrated with making cmake interact with Makevars;

On http://cran.r-project.org/doc/manuals/R-exts.html, a configure script 
seems to be described as an equally respectable alternative to Makevars 
-- it sounds as though Makevars is a facility created to make writing 
extension build processes easier, but for those who have requirements 
that can't be met by Makevars, a configure script is a completely 
acceptable route.  (A plain Makefile I can understand cautioning 
against, because make as a tool is too limited to cover a true range of 
portability concerns).

I do know that CMake is more than capable of covering the bases handled 
by Makevars, and would assume that as long as the correct include and 
linker flags were solicited in CMakeLists.txt things would work correctly.
-rd


On 03/05/2013 03:56 PM, Dirk Eddelbuettel wrote:
> On 5 March 2013 at 15:44, Richard Downe wrote:
> | What I've been doing the past couple years, which has worked extremely
> | well, is to use a configure script (I've used perl because it allows me
> | to do a bunch of other build-time processing that's specific to my
> | package, but bash would work fine as well).
> |
> | All you need (for perl) is:
> |
> | #!/usr/bin/perl
> | chdir "src/";
> | system("cmake .");
> | chdir "..";
> | exit(0);
> |
> | The end result is that R CMD INSTALL [your package] finds an up to date
> | makefile in src, but otherwise runs conventionally, and your package
> | gets built and installed properly.
>
> Etienne was (very correctly) alluding to the fact the _creating your own
> src/Makefile is strongly discouraged_ as e.g. repeatedly stated by Simon and
> others on r-devel or here.  R's ability produce 32 and 64 bit binaries on the
> OSs that support it depends criticially on its ability to write its own
> Makefile, based on its stubs and the user's Makevars.
>
> Did you by chance mean Makevars here?  Otherwise the trick is fine but for
> CRAN I would expect to be met with, ahem, criticism.
>
> Dirk
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130305/b1c210a0/attachment.html>


More information about the Rcpp-devel mailing list