Message-ID: <760615E9-D344-4076-8D7D-11959CC02E16@r-project.org>
Date: 2011-07-09T20:07:31Z
From: Simon Urbanek
Subject: R CMD SHLIB produces make: *** No rule to make target "R.o", needed by "R.so"
In-Reply-To: <4E18A32E.8080109@postgrad.manchester.ac.uk>
On Jul 9, 2011, at 2:51 PM, Chien Lin Terry Huang wrote:
> Hi there,
>
> I have been trying to run some C code in R. After following various instructions on the internet still no avail.
> This is what I did:
>
> In the R.c file, I have the following:
>
> ==================================
> #include <R.h>
> #include <math.h>
>
> void last_event_newton( double *time , double *beta0 , double *beta1 , double *rho , double *D , double *K , double *L , double *output )
> {
> ...not very important code
> }
> ==================================
>
> Then in the terminal (Snow Leopard), I typed:
> ~ User$ R CMD SHLIB R.c
>
> This is the result:
> make: *** No rule to make target `R.o', needed by `R.so'. Stop.
>
> After googling, I can't find much documentation on this. If anyone can help me to figure this out that would be great.
>
Make sure you have all necessary tools (Xcode). If that doesn't help, you'll need to be most specific -- exact version of R, where you got it, Xcode version (gcc --version), and full output (error alone is not very helpful..). As Berend said, what you posted works without problems, so it looks like some issue in your setup.
Cheers,
Simon