[Insight-developers] Re: the swig interfaces

Bill Hoffman bill.hoffman at kitware.com
Fri Nov 24 22:13:45 EST 2006


Gaëtan Lehmann wrote:
> 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.
We know it is possible, at least it was from Cable Swig. I did not add 
stuff to swig in CableSwig, but I am not sure how
to do the equivalent operations in  .i files that I did in the source 
code, but I would imagine that they exist.  So, maybe it
is a question.  When you get the smaller test case going let me know and 
I will try it on windows.   If you could just
send me the .h/.cxx for the test classes, and the .i files you used with 
a CMakeLists.txt file that builds them, I will give it
a try.

-Bill



More information about the Insight-developers mailing list