Java Mailing List Archive

http://www.r-help.com/

Home » Home (12/2007) » R Help for Statistical Computing »

Re: [R] Help with interfacing C & R

Roland Rau

2007-02-08

Replies:

Dear Oleg,

to avoid any misunderstandings: My intention was not to offend you.
I just thought that the original poster's idea was to compile simply some
C-code and interface it from R.

I am sorry if my previous email sounded impolite.

Best,
Roland


On 2/8/07, Oleg Sklyar <osklyar@(protected):
>
> Roland,
>
> Sure, this code also compiles on my Linux box straight away, it also
> compiles on my Windows box -- because everything is _already_ set up
> there. The question was not whether the code was wrong -- such a "huge"
> chunk of code could hardly be wrong and it was apparent it was written
> just to try if one can _at all_ compile something for R. The question
> was that something was missing to compile it and Tim did not specify
> anything about his system except that it was Windows!
>
> One might not need Cygwin if the code is like Tim's, i.e. has no
> configuration whatsoever, that is right, but one in any case needs at
> least MinGW (for gcc, visible in your output) and ActivePerl (for R CMD)
> and RTools and R includes (visible in your output). You do have them
> installed, does Tim also have them installed? If one adds a simple
> config file (it will rather not work with a full UNIX-like configure)
> then one might want to have Cygwin or MSYS as well.
>
> Tim, when you get all those, add paths to <smth>\bin and <smth>\lib (as
> there might be dlls and Windows searches for dlls in the PATH) to your
> PATH. This includes R! One requirement: MinGW must be added in front of
> Cygwin (for MinGW make) and RTools in front of both MinGW and Cygwin
> (for all RTools to be used instead of those).
>
> And the pdf file pointed to in my previous post was exactly written for
> someone to start doing these things! It was written for Linux, but the
> only difference on Windows is that you need those tools I mentioned above!
>
> Oleg
>
> --
> Dr Oleg Sklyar | EBI-EMBL, Cambridge CB10 1SD, UK | +44-1223-494466
>
>
> Roland Rau wrote:
> > Hi,
> >
> > On 2/8/07, *Oleg Sklyar* <osklyar@(protected)>>
> > wrote:
> >
> >   On Windows you need:
> >     - download and install Cygwin (cygwin.com <http://cygwin.com>)
> >   with default options,
> >      supposedly you install into c:\cygwin. Add path to
> >      c:\cygwin\bin;c:\cygwin\lib to your system PATH
> >
> >
> > No. You don't need Cygwin. I don't have it and I can compile Tim's code
> > without any problem.
> > Please see bottom of my message for which I used Tim's code without any
> > modification.
> >
> > My assumption is rather that the path is not set correctly so he can
> > call R from the command line.
> > Maybe you could check, Tim, if you can start Rterm.exe or Rgui.exe from
> > the command line.
> > If not, this should be the first thing to fix.
> >
> >
> >
> >
> >   For help files:
> >     - get MS hhc, comes as part of htmlhelp.exe from here:
> >
> http://www.microsoft.com/downloads/details.aspx?FamilyID=00535334-c8a6-452f-9aa0-d597d16580cc&DisplayLang=en
> >   <
> http://www.microsoft.com/downloads/details.aspx?FamilyID=00535334-c8a6-452f-9aa0-d597d16580cc&DisplayLang=en
> >
> >      this is Microsoft HTML Help Compiler, add path to it to your
> PATH
> >     - you might want to consider MikTex, dowload, install, add to path
> if
> >      you have a package and a help system a should be built
> >
> > Yes, as you write for the help files. But I think it is not necessary if
> > someone wants to make his/her first steps to interface to C from R.
> >
> >
> > Best,
> > Roland
> >
> > P.S.
> > Here is the transcript of my shell session in emacs using Tim's code:
> >
> > Microsoft Windows XP [Version 5.1.2600]
> > (C) Copyright 1985-2001 Microsoft Corp.
> >
> > c:\deletefolder\Rsandbox>R CMD SHLIB hello.c
> > R CMD SHLIB hello.c
> > making hello.d from hello.c
> > gcc  -IC:/rolandprogs/R- 2.3.1/include -Wall -O2  -c hello.c -o
> hello.o
> > gcc -shared -s -o hello.dll hello.def hello.o
> > -LC:/rolandprogs/R-2.3.1/bin  -lR
> >
> > c:\deletefolder\Rsandbox>Rterm --no-save
> > Rterm --no-save
> >
> > R : Copyright 2006, The R Foundation for Statistical Computing
> > Version 2.3.1 (2006-06-01)
> > ISBN 3-900051-07-0
> >
> > R is free software and comes with ABSOLUTELY NO WARRANTY.
> > You are welcome to redistribute it under certain conditions.
> > Type 'license()' or 'licence()' for distribution details.
> >
> > R is a collaborative project with many contributors.
> > Type 'contributors()' for more information and
> > 'citation()' on how to cite R or R packages in publications.
> >
> > Type 'demo()' for some demos, 'help()' for on-line help, or
> > 'help.start()' for an HTML browser interface to help.
> > Type 'q()' to quit R.
> >
> > > source("hello2.r")
> > source("hello2.r")
> > > dyn.load("hello")
> > dyn.load("hello")
> > > hello2(3)
> > hello2(3)
> > Hello, world!
> > Hello, world!
> > Hello, world!
> > [[1]]
> > [1] 3
> >
> > >
>

 [[alternative HTML version deleted]]

______________________________________________
R-help@(protected)
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.
©2008 r-help.com - Jax Systems, LLC, U.S.A.