[Insight-developers] Re: the swig interfaces

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Wed Nov 22 17:41:05 EST 2006


Le Wed, 22 Nov 2006 21:33:14 +0100, Bill Hoffman  
<bill.hoffman at kitware.com> a écrit:

> Also, from your response it does not sound like you are interested in
> running a smaller test case with a simpler class hierarchy?   I am
> interested in helping, but I really want to make sure this works before
> moving  forward.  By work, I mean java, tcl, python, windows, mac,
> linux.
>  Without moving forward, and running any new test, we must decide what  
> to do about the generated binaries.
> I'm currently creating the "big" modules on python, composed of several  
> swig modules. It require to generate some code, and I'm really not sure  
> that's the right way to go: the code to generate is language specific,  
> and will make harder adding support for new languages: it would force us  
> to find how to do that with the new language, and that's not sure that  
> it can work with all the languages.
> By using the swig way, we are sure it will work with any language  
> supported by swig, without more work.
> It generates lots of files, but there is the same number of .py files,  
> or .java files, and the high number of those files doesn't seem to be a  
> problem or a performance issue.
> But a .java or a .py file is the equivalent of a .cxx file in c++.   In  
> Java, the .java files are compiled into a .jar file.
> It would be like having a .jar file per .java file in Java.   Or a  
> shared library per .cxx file in C++.  It may not be a problem
> on the OS/system you are running on, but there are more....  Windows  
> notoriously does not like too many files in one directory,
> and does not promote the idea of one class per dll.   When we are done  
> there will be several thousand dlls' if we have one
> per wrapped class.   I have never seen a system that does that.   I am  
> concerned it will cause trouble.

I think you're right, but I'd like to be sure of that - it's not easy  
though

>  I still get the feeling you are moving forward.

I'm testing tcl and java on a few classes

> Big dll's or little ones is not the issue.   The issue is can we wrap
> java, tcl, and python on windows Mac, and linux using a swig .i file  
> generator.  We still have not answered that
> question.

Big dll are the question: is it possible to create them with swig for all  
the languages ?
I'm quite sure there will be no problems with the small ones, and will  
verify it soon for the 3 languages on a few classes - I verified it for  
tcl this evening on my mac. Java will be a little more difficult: to test  
it, I will have to write the %rename directives by hand for the New()  
methods. For tcl, the .i files are exactly the same.

It would be great if you can do the same on windows.

Gaetan

-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr


More information about the Insight-developers mailing list