From pleydell at supagro.inra.fr  Tue Sep 15 20:04:51 2009
From: pleydell at supagro.inra.fr (pleydell at supagro.inra.fr)
Date: Tue, 15 Sep 2009 20:04:51 +0200
Subject: [Rd] Building R package with .c sub-routine files
Message-ID: <20090915200451.pcj3j24q168s048k@web.supagro.inra.fr>

Lets say I have two source files  file1.c and file2.c

The latter just contains sub-routines to be used by the first. i.e. in file1.c I
have the line

#include "file2.c"


Let's say "R CMD SHLIB file1.c" runs perfectly and I want to include the code in
a package, "R CMD build" also runs fine but R CMD check" gives

* checking whether package 'myPackage' can be installed ... ERROR
Installation failed.
See '/pathto/myPackage.Rcheck/00install.out' for details.

basically the compiler is trying to compile file2.c independantly of file1.c
which is not what I want and prevents a proper build

What's the easiest way to enforce the correct file dependencies when building  R
packages?

cheers
David



[Rd] Building R package with .c sub-routine files
pleydell at supagro.inra.fr