From roebuck at odin.mdacc.tmc.edu  Wed Mar 23 18:29:37 2005
From: roebuck at odin.mdacc.tmc.edu (Paul Roebuck)
Date: Wed Mar 23 18:29:48 2005
Subject: [Rd] forcing R CMD COMPILE
In-Reply-To: <Pine.LNX.4.58L0.0503231341420.32487@est.ufpr.br>
References: <Pine.LNX.4.58L0.0503230041170.31558@est.ufpr.br><Pine.LNX.4.61.
	0503230744450.29643@gannet.stats>
	<Pine.LNX.4.58L0.0503231341420.32487@est.ufpr.br>
Message-ID: <Pine.OSF.4.58.0503231123130.406038@odin.mdacc.tmc.edu>

On Wed, 23 Mar 2005, Pedro Ribeiro de Andrade Neto wrote:

> On Wed, 23 Mar 2005, Prof Brian Ripley wrote:
>
> > On Wed, 23 Mar 2005, Pedro Ribeiro de Andrade Neto wrote:
> >
> > > I am developing a package with a lot of C++ code, and I have a question
> > > about R CMD COMPILE. As I can see, when the package's Makefile calls
> > >
> > > R CMD COMPILE foo.cpp
> >
> > Why does your package have a Makefile?  And why is it calling COMPILE and
> > not SHLIB?
>
> My package has a Makefile because I need to compile 16 .cpp files. After
> it, I call R CMD SHLIB.
>
> > > R verifies if foo.o exists, and if it is up to date (last modified after
> > > foo.cpp's last), trying to avoid recompile foo.cpp.
> >
> > Not quite: COMPILE is a make facility, and it calls make with its own
> > Makefiles.  This does not seem appropriate to your usage.
> >
> > > But __all__ my files have other dependencies (at least a .h). The
> > > Makefile verifies it, and calls COMPILE only when it is sure that foo.o
> > > is not up to dated. The problem occours, for example, if I modify only
> > > foo.h, and then compile again. R will say that foo.o is up to date, but
> > > it is not true.
> > >
> > > Is there any way to force R CMD COMPILE?? Well, I can remove the .o file
> > > before COMPILE, but I think R could do something about it...
> >
> > Better not to use R CMD COMPILE.  R itself does not (AFAICS): it is there
> > for S-PLUS compatibility.  It seems only ROracle on CRAN does.
> >
> > Note that R CMD INSTALL is usually called on fresh sources (an unpacked
> > tarball) so dependencies are not usually an issue.
> >
>
> OK. So I have to compile them with g++ implicitly (instead of using R CMD
> COMPILE), and then call R CMD SHLIB.

If you have your own makefile, why not just add a 'depend'
target?

----------------------------------------------------------
SIGSIG -- signature too long (core dumped)


[Rd] forcing R CMD COMPILE
Paul Roebuck