neha chaudhry
2004-Sep-22 21:59 UTC
[R] Facing problems with C code compilation - Please help.
Hello, I started using R a month ago - so I am a novice in this area. I am stuck with a problem and need some help urgently. I am using windows version of R 1.9.1. I am trying to compile C code in it. I have my C code - "hello.c" is lying in C:\Program Files\R\rw1091 This code is - #include <R.h> void hello(int *n) { int i; for(i=0;i< *n; i++) { Rprintf("Hello World ! \n"); } } ======Code hello1.R is also lying in the same directory. This code is - hello2 <- function(n) { .C("hello", as.integer)) } ======>From the command prompt, I go into the directory C:\Program Files\R\rw1091\binand I do C:\Program Files\R\rw1091\bin>R CMD SHLIB hello.c 'make' is not recognized as an internal or external command, operable program or batch file. Perl is installed on my machine. I was wondering why am I getting this error. Could someone please provide me with some pointers on this? Your help will be greatly appreciated. Thanks, Neha
Liaw, Andy
2004-Sep-23 00:12 UTC
[R] Facing problems with C code compilation - Please help.
Read and follow the instructions in c:\Program Files\R\rw1091\README.packages _very_, _very_ carefully. Stray from it even a bit and you get what you deserve. Andy> From: neha chaudhry > > Hello, > > I started using R a month ago - so I am a novice in this > area. I am stuck with a problem and need some help urgently. > I am using windows version of R 1.9.1. I am trying to compile > C code in it. I have my C code - "hello.c" is lying in > C:\Program Files\R\rw1091 > > This code is - > > #include <R.h> > void hello(int *n) > { > int i; > for(i=0;i< *n; i++) > { > Rprintf("Hello World ! \n"); > } > } > > ======> Code hello1.R is also lying in the same directory. > This code is - > hello2 <- function(n) > { > .C("hello", as.integer)) > } > ======> > >From the command prompt, I go into the directory C:\Program > Files\R\rw1091\bin > and I do > C:\Program Files\R\rw1091\bin>R CMD SHLIB hello.c > 'make' is not recognized as an internal or external command, > operable program or batch file. > > Perl is installed on my machine. I was wondering why am I > getting this error. Could someone please provide me with some > pointers on this? Your help will be greatly appreciated. > > Thanks, > Neha > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > >
neha chaudhry
2004-Sep-23 04:39 UTC
[R] Facing problems with C code compilation - Please help.
Hi Guys, Thanks a ton for all the help. My code is finally compiling and running. -Neha ----- Original Message ----- From: "Liaw, Andy" <andy_liaw at merck.com> Date: Wednesday, September 22, 2004 5:12 pm Subject: RE: [R] Facing problems with C code compilation - Please help.> Read and follow the instructions in c:\Program > Files\R\rw1091\README.packages _very_, _very_ carefully. Stray from it even > a bit and you get what you deserve. > > Andy > > > From: neha chaudhry > > > > Hello, > > > > I started using R a month ago - so I am a novice in this > > area. I am stuck with a problem and need some help urgently. > > I am using windows version of R 1.9.1. I am trying to compile > > C code in it. I have my C code - "hello.c" is lying in > > C:\Program Files\R\rw1091 > > > > This code is - > > > > #include <R.h> > > void hello(int *n) > > { > > int i; > > for(i=0;i< *n; i++) > > { > > Rprintf("Hello World ! \n"); > > } > > } > > > > ======> > Code hello1.R is also lying in the same directory. > > This code is - > > hello2 <- function(n) > > { > > .C("hello", as.integer)) > > } > > ======> > > > >From the command prompt, I go into the directory C:\Program > > Files\R\rw1091\bin > > and I do > > C:\Program Files\R\rw1091\bin>R CMD SHLIB hello.c > > 'make' is not recognized as an internal or external command, > > operable program or batch file. > > > > Perl is installed on my machine. I was wondering why am I > > getting this error. Could someone please provide me with some > > pointers on this? Your help will be greatly appreciated. > > > > Thanks, > > Neha > > > > ______________________________________________ > > R-help at stat.math.ethz.ch mailing list > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide! > > http://www.R-project.org/posting-guide.html > > > > > > > --------------------------------------------------------------------------- > --- > Notice: This e-mail message, together with any attachments, contains > information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New > Jersey, USA 08889), and/or its affiliates (which may be known outside the > United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as > Banyu) that may be confidential, proprietary copyrighted and/or legally > privileged. It is intended solely for the use of the individual or entity > named on this message. If you are not the intended recipient, and have > received this message in error, please notify us immediately by reply e- > mail and then delete it from your system. > --------------------------------------------------------------------------- > --- >