[Insight-developers] Re: the swig interfaces

Bill Hoffman bill.hoffman at kitware.com
Wed Nov 22 15:33:14 EST 2006


Gaëtan Lehmann wrote:
>
> Hi Bill,
>
> Sorry for the delay
>
> Le Mon, 20 Nov 2006 23:30:22 +0100, Bill Hoffman 
> <bill.hoffman at kitware.com> a écrit:
>
>> Gaëtan Lehmann wrote:
>>>
>>>
>>> --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
>> So, why does it seem like every file #includes every other file?
>> And every typedef is repeated in each .i file.   This is going to
>> add to the compile times, possibly break some compilers as the files
>> will get so huge.   We need a way to only use the stuff we need in
>> a particular translation unit.
>
> Not all the files are included, only the ones in the Base module, and 
> the one previously listed in the current module.
> But you're right, it shouldn't be done that way. I think that's 
> possible to include the headers and define the typedefs only of the 
> type really used in a class - that's something to add to the TODO list
>
>>
>> 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 still get the feeling you are moving forward.   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.

-Bill



More information about the Insight-developers mailing list