[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Fwd: Re: igraph / R-interface



Here is the exchange I had with upstream. Apparently one should
consider the C interface and the R interface as two /completely/
different product. For instance the R interface replace some deep down
call (rand()) with something else.


---------- Forwarded message ----------
From: Tamas Nepusz <tamas@cs.rhul.ac.uk>
Date: Thu, Sep 17, 2009 at 2:47 PM
Subject: Fwd: Re: igraph / R-interface
To: mathieu.malaterre@gmail.com
Cc: csardi.gabor@gmail.com


Hi Gabor,

I think you meant to cc the forwarded message below to Mathieu as well.
Yes, you're right -- if igraph in R uses the random number generator of
R, then it's not feasible to make it depend on libigraph, it's best to
keep them separate. I wasn't aware of that.

--
Tamas



---------- Forwarded message ----------
From: "Gábor Csárdi" <csardi.gabor@gmail.com>
To: Tamas Nepusz <tamas@cs.rhul.ac.uk>
Date: Thu, 17 Sep 2009 14:31:45 +0200
Subject: Re: igraph / R-interface
Tamas, Mathieu,

On Wed, Sep 16, 2009 at 6:29 PM, Tamas Nepusz <tamas@cs.rhul.ac.uk> wrote:
> Hi Mathieu,
>
>> What is the interfaces/R in igraph from sf.net then ?
> It depends on which file did you download from sf.net.
> There are two files you could have downloaded:
>
> 1. The source code of the C library:
>   http://switch.dl.sourceforge.net/sourceforge/igraph/igraph-0.5.2.tar.gz
>   This might contain some files in interfaces/R, but I guess the
>   majority of them is not included. In particular, if your
>   interfaces/R/src subdir does not contain a file called
>   rinterface.c.in or rinterface.c, then you don't have the source code
>   for the R interface.
>
> 2. There is also the source code of the R interface:
>   http://master.dl.sourceforge.net/sourceforge/igraph/igraph_0.5.2-2.tar.gz
>   For reasons unknown to me, the source code of the C core is included
>   in the downloadable tarball for the R interface -- I guess the reason
>   is that this is the only way to enable R automatically download and
>   install igraph when you type "R CMD INSTALL igraph" from the command
>   line.

The goal is to make it easy to install the igraph R package. That's
why it is self-contained. This way you can install it in ten seconds
on any supported system.

> So if you are working with the tarball I mentioned in point 1), that's
> no good for compiling the R interface. For the R interface, you need the
> tarball mentioned in 2) and you have to tweak it somehow to link to an
> already compiled igraph dynamic library instead of compiling igraph
> again and linking to it statically. I don't know how other R packages
> requiring external libraries get around this problem.

Why tweak it? Why isn't the included library good? Anyway, tweaking it
is not a good solution for several reasons. One is, that igraph uses
different code when compiled as an R package, e.g. it uses R's random
number generator. So the dynamic library is the R package and the
"general" igraph dynamic library are not the same.

Think of these (I mean libigraph and R-igraph) as two products that
provide related functionality, and probably the best is to package
them (if this is the intention) independently, i.e. without
R-cran-igraph (or whatever its name would be) depending on libigraph.

Best,
Gabor

> --
> Tamas
>
>



--
Gabor Csardi <Gabor.Csardi@unil.ch>     UNIL DGM
<<

Email has been scanned for viruses by Altman Technologies' email
management service - www.altman.co.uk/emailsystems

 >>




-- 
Mathieu


Reply to: