igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Igraph with JNI


From: Jose Quesada
Subject: Re: [igraph] Igraph with JNI
Date: Tue, 28 Jul 2009 23:31:58 +0200
User-agent: Thunderbird 2.0.0.22 (Windows/20090605)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Tamas, Gabor, Gang, (all),

First: I'd be interested in getting igraph linked to java. I know little
about this. But a few weeks ago I saw Daniel Adler's talk at user2009:

http://www.agrocampus-ouest.fr/math/useR-2009/abstracts/pdf/Adler+Philipp.pdf
see also: http://dyncall.org/documentation.shtml
In general, if I understand this, his solution would make it a lot
easier to work out the type conversion.
The presentation mentions dynamic languages, but I don't see why JNI
would not be possible.


Best,
- -Jose

Tamas Nepusz wrote:
> Hi Gang,
> 
>> I am thinking about trying to bridge igraph with JAVA via JNI on
>> windows. The way how JNI works is to link Java via JNI to native C
>> functions. The C source is complied to a shared library DLL file.
>>
>> Does anyone have worked on this before?
> Yes, I tried it once, but only as a proof-of-concept, so I pretty much
> abandoned the project after I convinced myself that igraph could be used
> from Java using JNI had someone took the effort to develop a proper
> interface. So yes, it's pretty much doable, but not straightforward at
> all. The reason is twofold: first, using JNI means that you have to
> write a lot of "glue code" between igraph and Java (pretty much all
> igraph data types must have a Java counterpart and you have to write the
> conversion code in C); second, there are some calling conventions in
> igraph that cannot be easily reproduced in Java (i.e., functions using
> additional arguments to _return_ results). I started adapting the
> interface generator we use to build the R interface to be able to
> generate C glue code for the Java interface, but it's very far from
> being finished.
> 
>> where the The directory after the -I switch is the one containing the
>> igraph.h file, while the one following -L should contain the library
>> file itself, usually a file called libigraph.so, libigraph.a or
>> igraph.dll
>> "Quote"
>>
>> Where actually I can find this igraph.dll in the igraph R package.
> I don't know for sure (that's Gábor's part), but I guess nowhere. The
> thing is that there are two ways to include igraph in your project:
> static linking (in which case you don't need the igraph DLL as
> everything that's in the DLL is built directly into your application) or
> dynamic linking (where you need the DLL as your app contains only
> references to igraph calls). I think the R interface is built
> statically, so you won't find a DLL there. JNI only supports dynamic
> linking, so you need the DLL. To build the DLL, you have to build the
> library from the C source code either in Visual Studio or in MSYS.
> 
>> So my question is if I compile a c file using igraph librarys, and it
>> can be compiled successfully, will it be able to run standalone?
> If you link it statically, it will work. If you link it dynamically, it
> will require the DLL. See the corresponding Wikipedia entries as a
> starting point:
> 
> http://en.wikipedia.org/wiki/Static_linking
> http://en.wikipedia.org/wiki/Dynamic_linking#Dynamic_linking
> 

- --
Jose Quesada, PhD.

Max Planck Institute,
Center for Adaptive Behavior and Cognition -ABC-,
Lentzeallee 94, office 224, 14195 Berlin

http://www.josequesada.name/
http://twitter.com/Quesada

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJKb25NAAoJEGMobUVGH+HKzWQQAK1DMSBeJ4ely8GxyxB++Zkk
V0SfnB6RWpXSzzSUgK+1E0gm89gQ3q+6aD3G2wMjB4ce0sK1DI2zNUs51mE/GKyr
7SKq1ijC/MSWcGos/20x9wgUA3z59MnUowQbhKIjvcLgXodE5fzHnRxYGrn1T9k/
x1hV3ihnVM0zeiO1z7VA8DPjNvqNwCgNsKDo9/puUBHf7Zt4lyN5FUc5C9w/24Zb
5OjNAmFvtJA4aFd+Aq0IoKYTPbYVaEO5tAFNqUKJDl2smKLVf3EVIZUBZe2gBbzD
oHf3ES1tx1tzxZ4nQhWWDvBmbZlUbW7ntMYOyE5yKAdNngplx58bbHdHxTDvOsF9
cJAYYjU95EzRDzpLNdtuqLxEaIMS95BXFoCz6D3CIl7hd8xxZzv2ojBpA5Jra91J
MS4bRm0Q27AZ6o+8slrbFDb6Q6tZU2r3lsfqV4xcbOIULmza/khqrWzhvBWvGQqe
juvZSQAftA9aU7JHGCbcZ6QQEm4cj4YsiFv2Cs8XXMozhyZsaKAmQN2+JWYOqLhL
zHD7sCdyLAFvnjoIkxeqUN7OgVleJokFzqD+3nnLQe6Dmx/MrIO+oJGqZUw6pK56
7ErB3MvS9fTGb/fILiSP/COdo+jAIoI1tzyhM5qXApW3AbrMo3wuYBjng9CWr3n0
Eo41bS7jEqKSjbeDTzSK
=/mZV
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]