[Insight-developers] itkObjectFactoryTest2 and CMake 2.9

Bradley Lowekamp blowekamp at mail.nih.gov
Wed Jan 13 13:29:54 EST 2010


This does sound like some complicated interaction of several options and loading methods.

Would it be possible to try to load libraries with both methods for the OSX (subject to correct versioning of the OS), if the one fails then try the other? This may produce the most robust behavior?

Also what is with the confusion of the file extension for dynamic libraries on OSX.  The comments in DynamicLoader::LibExtension and itk::ObjectFactoryBase::NameIsSharedLibrary don't seem to quite agree:

NameIsSharedLibrary(const char* name)
{
  std::string extension = itksys::DynamicLoader::LibExtension();

#ifdef __APPLE__
  // possible bug: CMake generated build file on the Mac makes
  // libraries with a .dylib extension.  kwsys guesses the extension
  // should be ".so"
  extension = ".dylib";
#endif

const char* DynamicLoader::LibExtension()
{
  // NSCreateObjectFileImageFromFile fail when dealing with dylib image
  // it returns NSObjectFileImageInappropriateFile
  //return ".dylib";
  return ".so";
}

Brad L

On Jan 13, 2010, at 12:00 PM, Bill Hoffman wrote:

> Bill Lorensen wrote:
>> But, the old way has been working for a long time. Slicer3 uses
>> loadable itk IO factories. That facility is key to support the Slicer3
>> execution model.
>> 
> 
> I think the SHARED was intentional in ITK, as the concept of modules has 
> changed in non-backwards compatible ways on the Mac since CMake stared 
> to support it.   The MODULE on the Mac creates a loadable module that 
> uses the Mac specific API for modules on the Mac.  However, newer Mac 
> OS's recommend switching to the unix standard dlopen interface.  CMake 
> for backwards compatibility reasons still creates the Mac modules when 
> MODULE is used.   However, if you want to use the dlopen interface on 
> the Mac, then you use SHARED....  I think it was decided that ITK would 
> switch to dlopen on Mac  at some point.
> 
> 
> So, this MODULE/SHARED is a whole new/old can of worms on the Mac...  :)
> 
> Most likely the change should just be reverted, as ITK "switched" to the 
> dlopen style of doing things on the Mac at some point in the past 
> (breaking backwards compatibility at that point... :)  ).
> 
> -Bill
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.html
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers

========================================================
Bradley Lowekamp  
Lockheed Martin Contractor for
Office of High Performance Computing and Communications
National Library of Medicine 
blowekamp at mail.nih.gov


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20100113/99a924f1/attachment.htm>


More information about the Insight-developers mailing list