[ITK] [ITK-dev] Kents Work on Explicit instantiation of ITK

Bradley Lowekamp blowekamp at mail.nih.gov
Tue Mar 17 10:44:39 EDT 2015


Hans,

Thanks for sharing this work.

I was able to utilize your script and methodology for SimpleITK to explicitly instantiate about 16 classes with their commonly used arguments as by SimpleITK [1]. I created a separate library in SimpleITK which contains these explicitly instantiated classes [2].

These instantiations reduced the size of the .o files for SimpleITK by ~30% (500MB), and enabled linking once again on Windows 64. Some systems seem to also gain significant performance in build time (over 2X), but there are many reasons for it including running into memory or IO limitations on the individual system.

However I was not able to get it working with the explicitly instantiated library as shared. The mixtures of export specification of the initial ITK declaration and the explicit instantiation linking specification didn't appear to work. I think they need to be consistent? I followed the methodology that was done for the MetaDataObjects[3]. If I build ITK and SimpleITK as shared but with the Explicit library as static it appears to work.

Any help on explicitly instantiation with shared libraries would be appreciated!

Thanks,
Brad

[1] https://github.com/SimpleITK/SimpleITK/blob/a6e62785a9e8ebc41dfb3e15f72e1985a620bf22/Code/Explicit/include/sitkExplicitITK.h
[2] https://github.com/SimpleITK/SimpleITK/blob/a6e62785a9e8ebc41dfb3e15f72e1985a620bf22/Code/Explicit/src/CMakeLists.txt
[3] https://github.com/InsightSoftwareConsortium/ITK/blob/d195bfb21e8af086c67208c2b96d5fd5992c66ca/Modules/Core/Common/include/itkMetaDataObject.h#L191-L224

On Jan 28, 2015, at 12:16 PM, Johnson, Hans J <hans-johnson at uiowa.edu> wrote:

> Yes!  I’d love someone to investigate further:
> 
> 
> https://github.com/hjmjohnson/ITK/tree/TryExplicitInstantiationTesting
> 
> https://github.com/hjmjohnson/ITK/commit/0576c75c8a760f1cafcde3125210134a39502304
> 
> 
> Hans

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20150317/c9fd1bc7/attachment.html>
-------------- next part --------------
_______________________________________________
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.php

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://public.kitware.com/mailman/listinfo/insight-developers


More information about the Community mailing list