[Insight-developers] ITK: KWSYS : Problem with DynamicLoader extension in Mac { .so .dylib }

Luis Ibanez luis.ibanez at kitware.com
Sat Sep 29 14:59:18 EDT 2007



Sean, Mathieu,



Some background:


    We are having trouble finding a standard way of
    managing loadable ITK IO factories in the Mac.

    The problem is related to the multiple ways in
    which the Mac manages .so and .dylib libraries.

    Currently ITK is using the DynamicLoader of
    kwsys (Insight/Utilities/kwsys).

    In principle we thought that .dylib libraries were
    only good to link with, but not good to load as
    shared libraries. Therefore, the current CVS version
    of the loader searches only for .so libraries in
    the Mac.

    However we have mixed observations where it seems
    that renaming a .dylib file as .so will make it
    work fine as a loadable library.

    The behavior of the Mac also changes depending on
    version of the OS.

    We have created a bug entry for this issue
    http://public.kitware.com/Bug/view.php?id=5795

    You will find in that bug report some of the elements
    of this discussion.


Could you help us throw some light into this problem ?



   Thanks


      Luis


------------------------
Mathieu Malaterre wrote:

 > On 9/28/07, Bill Hoffman <bill.hoffman at kitware.com> wrote:
 >
 >> Steve Pieper wrote:
 >>
 >>> Hi Guys -
 >>>
 >>> My thought would be not to check the file extension, but to check the
 >>> file type using whatever API is used by the otool commnand.  It seems
 >>> to know what's going on...
 >>
 >>
 >> I am not sure how this helps?   The problem is that we don't know the
 >> name of the file to load.   The file either .dylib or .so or .foobar
 >> built with either -bundle or -shared seems to load and find symbols
 >> either way with the code in DynamicLoader right now.   There are older
 >> Mac's where .dylibs will not load, but they must be pretty old...
 >
 >
 >
 > Bill,
 >
 >   The NS* stuff will not load dylib, see my comments in the
 > DynamicLoader class. dlopen API was introduce in Mac 10.4 (Tiger). I
 > still have a 10.3 Mac (G4) and it is not 'that' old :)
 >
 >   We should get the Rogues-Research guys (Sean/Mathieu) in the loop
 > for suggestion...
 >
 >



More information about the Insight-developers mailing list