Hi All, I have been struggling to figure out how to compile c codes for R use. I am using Win XP + Cygwin + R binaries. After I followed all the instructions in " Building R for Windows" from Murdoch's website, I tried to Run something like : R CMD SHLIB C:\R\test.c , but still didn't get any output. My first question is, does this mean I already did something wrong ? Anyway, I assumed that I need to run this command in Cygwin, so I started to reinstall R in Cygwin by compiling the source (I assume it is not possible to call the precompiled binaries from Cygwin). But I ran into the following problem when I ran "make all recommended" in src/gnuwin32/ $ make all recommended make: ./Rpwd.exe: Command not found make[1]: ./Rpwd.exe: Command not found make --no-print-directory -C front-ends Rpwd make -C ../../include -f Makefile.win version make Rpwd.exe gcc -O3 -Wall -pedantic -I../../include -c rpwd.c -o rpwd.o rpwd.c:22:20: direct.h: No such file or directory rpwd.c: In function `main': rpwd.c:42: warning: implicit declaration of function `chdir' rpwd.c:45: warning: implicit declaration of function `getcwd' make[3]: *** [rpwd.o] Error 1 make[2]: *** [Rpwd] Error 2 make[1]: *** [front-ends/Rpwd.exe] Error 2 make: *** [all] Error 2 Can I get some help with my quesitons , and some suggestions concerning the best way to solve the whole problem ? THanks a lot for your help.. tong
Tong Wang <wangtong at usc.edu> writes:> Hi All,[...]> After I followed all the instructions in " Building R for Windows"[...]> Anyway, I assumed that I need to run this command in CygwinNo, do this from a DOS shell. The usual problems are either missing components from the installation steps outlined in Building R for Windows, or an incorrect PATH variable so that windows or cygwin versions of programs are used rather than MinGW / Rtools. Also, this question belongs on the R-devel list, where those doing development work are more likely to see and respond to your questions. Hope that helps, Martin Morgan> > $ make all recommended > make: ./Rpwd.exe: Command not found > make[1]: ./Rpwd.exe: Command not found > make --no-print-directory -C front-ends Rpwd > make -C ../../include -f Makefile.win version > make Rpwd.exe > gcc -O3 -Wall -pedantic -I../../include -c rpwd.c -o rpwd.o > rpwd.c:22:20: direct.h: No such file or directory > rpwd.c: In function `main': > rpwd.c:42: warning: implicit declaration of function `chdir' > rpwd.c:45: warning: implicit declaration of function `getcwd' > make[3]: *** [rpwd.o] Error 1 > make[2]: *** [Rpwd] Error 2 > make[1]: *** [front-ends/Rpwd.exe] Error 2 > make: *** [all] Error 2 > > > Can I get some help with my quesitons , and some suggestions concerning the best way to solve the whole problem ? > > THanks a lot for your help.. > > tong > > ______________________________________________ > 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 > and provide commented, minimal, self-contained, reproducible code.-- Martin Morgan Bioconductor / Computational Biology http://bioconductor.org
On Mon, 2 Apr 2007, Tong Wang wrote:> Hi All,> I have been struggling to figure out how to compile c codes for R > use. I am using Win XP + Cygwin + R binaries. After I followed all the > instructions in " Building R for Windows" from Murdoch's website, I > tried to Run something like : R CMD SHLIB C:\R\test.c , but still didn't > get any output.Why are you supplying a path rather than a file name? If you do, you probably need to use forward slashes but it may well not do what you expect. Did you really get no output at all? Please use the correct list (R-devel: see the posting guide) and supply verbatim copies of what you did.> My first question is, does this mean I already did something wrong ? > > Anyway, I assumed that I need to run this command in Cygwin, so I > started to reinstall R in Cygwin by compiling the source (I assume it is > not possible to call the precompiled binaries from Cygwin). But I ran > into the following problem when I ran "make all recommended" in > src/gnuwin32/Cygwin is NOT a supported platform for R, and you appear to be attempting following the Windows (not Cygwin) build instructions without installing the correct compiler suite (which finds 'direct.h').> $ make all recommended > make: ./Rpwd.exe: Command not found > make[1]: ./Rpwd.exe: Command not found > make --no-print-directory -C front-ends Rpwd > make -C ../../include -f Makefile.win version > make Rpwd.exe > gcc -O3 -Wall -pedantic -I../../include -c rpwd.c -o rpwd.o > rpwd.c:22:20: direct.h: No such file or directory > rpwd.c: In function `main': > rpwd.c:42: warning: implicit declaration of function `chdir' > rpwd.c:45: warning: implicit declaration of function `getcwd' > make[3]: *** [rpwd.o] Error 1 > make[2]: *** [Rpwd] Error 2 > make[1]: *** [front-ends/Rpwd.exe] Error 2 > make: *** [all] Error 2 > > > Can I get some help with my quesitons , and some suggestions concerning > the best way to solve the whole problem ?You will need to do your homework a lot more carefully, as it seems you don't have enough knowledge to recognize the errors you are making. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595