[Rd] Customized Makefiles (C++ and R)

Dirk Eddelbuettel edd at debian.org
Mon Aug 7 03:34:20 CEST 2006


On 6 August 2006 at 18:50, Selwyn-Lloyd McPherson wrote:
| Hi everyone,
| 
| I am writing a package for R and implementing a collection of C++  
| scripts with it. Unfortunately, I did not write the C++ files, so I  
| am dependent on using the supplied makefile that came with it. This  

Not necessarily. You as R package author are responsible of getting your
sources into a form understood by 'R CMD ... ' and friends.

| works fine for compiling the program outside of R, but in trying to  
| create the package, the .o files are created but at the end I run  
| into this error:
| 
| cp: *.so: No such file or directory
| ERROR: compilation failed for package 'chpoly'
| 
| 
| I think this is because the .so file is never created, but I might be  
| wrong. Is there something I have to add to the makefile to ensure  
| that everything works out okay?

Quite possibly, but it is hard to say from what you posted.

My general advice is to fetch a few of the 700+ CRAN packages and study those
with a similar layout -- in your case with C++.  There are numerous ones that
wrap to external C++ libraries and file collections.  You should fine one
that fits.

Hope this helps, Dirk

-- 
Hell, there are no rules here - we're trying to accomplish something. 
                                                  -- Thomas A. Edison



More information about the R-devel mailing list