[Insight-users] Re: WrapITK binaries

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Mon Aug 14 15:21:32 EDT 2006


Hi Michael,

You're right, java use absolute paths (and tcl do the same BTW). Only  
python is currently able to be installed anywhere without problem - that's  
what I have tested. I'm not sure what is the best way to handle that  
problem. In python, we are using the magic __file__ variable to find the  
path where WrapITK is installed. Perhaps there is the same kind of thing  
for tcl, but I would be surprised to have the same in java.
Perhaps can we use standard environment variable to found the libs if they  
are not installed in the default places ? In Java for example, instead of  
loading the libs in a particular path, we could delegate the job of  
finding the path of the library to some standard methods, by using  
Runtime.loadLibrary() instead of Runtime.load(). That way, loadLibrary()  
will find the lib if they are in the LD_LIBRARY_PATH on linux, in the PATH  
on windows, in the DYLD_LIBRARY_PATH on mac os x, ...
The user only have to take care to set correctly the PATH. Would it be ok  
for you ?

Gaetan


Le Mon, 14 Aug 2006 17:28:16 +0200, Michael Bell <michael.bell at acm.org> a  
écrit:

> How does CPack handle directory load paths?
>
> For java wrapping, the dll SwigRuntimeJava is loaded from an absolute
> path, the path to the build directory or install path. See
> WrapITK/Java/itkbase.java.in.
>
> If I want to distribute this to other machines without compiling from
> scratch, this means that I can't put SwigRuntimeJava in the classpath
> and expect it to work. I can't even preload it because it always gets
> loaded with InsightToolkit.jar.
>
> Does itkbase need to be changed for this to work, or does CPack take
> care of the problem? (BTW, this causes problems on unix and windows)
>
> thanks,
> michael
>
>
> On 8/10/06, Gaetan Lehmann <gaetan.lehmann at jouy.inra.fr> wrote:
>>
>> Hi,
>>
>> I have added a basic CPack configuration to WrapITK.
>> It work just fine with linux, but I would not be surprised to have some
>> problems on other systems (like windows).
>> Can you tests on your system(s) ?
>>
>> The only thing to do is to set INSTALL_WRAP_ITK_COMPATIBILITY to OFF  
>> with
>> cmake, and to build the target "package". On my system:
>>
>> [glehmann at marvin build]$ make package
>> Run CPack packaging tool...
>> CPack: Install projects
>> CPack: - Run preinstall target for: WrapITK
>> CPack: - Install project: WrapITK
>> CPack: Compress package
>> CPack: Finalize package
>> CPack: Package
>> /home/glehmann/src/contrib-itk/WrapITK-unstable/build/WrapITK-0.2.1-Linux.sh
>> generated.
>>
>> So easy :-)
>>
>> Gaetan
>>
>>
>>
>> On Wed, 09 Aug 2006 23:00:00 +0200, Charl P. Botha <cpbotha at gmail.com>
>> wrote:
>>
>> > On 8/9/06, Gaëtan Lehmann <gaetan.lehmann at jouy.inra.fr> wrote:
>> >> We have already talked about that some time ago with Charl.
>> >> Charl, I think you have already deployed WrapITK on several host.  
>> Have
>> >> you
>> >> used a special method to do that ?
>> >
>> > For this application I use PyInstaller, but WrapITK was too complex
>> > for it.  In the end I just made a script that collects all the
>> > relevant ITK/WrapITK DLLs and Python files and puts them in the right
>> > places, on Windows and Linux.  I ship this whole tree with my
>> > application.  The script is now integrated in my Frankensteinian
>> > build-system and it seems to work.
>> >
>> > You're welcome to have the bits that do the WrapITK 'packaging', of
>> > course.  In principle, one should be able to take the generated tree
>> > and plonk it down on a user's system.  After having set the
>> > environment with a brilliant tool such as <plug>
>> > cpbotha.net/Software/envedit </plug> you're good to go.
>> >
>> > See you,
>> > Charl
>>
>>
>>
>> --
>> 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
>>
>
>



-- 
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-users mailing list