[ITK] [ITK-dev] [slicer-devel] Workaround for dynamic_cast on Mac OSX

Matt McCormick matt.mccormick at kitware.com
Mon Nov 14 18:18:05 EST 2016


On Mon, Nov 14, 2016 at 2:18 PM, Lowekamp, Bradley (NIH/NLM/LHC) [C]
<blowekamp at mail.nih.gov> wrote:
> Matt,
>
> I believe that GCC 4.1 also had a very similar problem to what is occurring in with Apple Clang now.

Thanks to the GCC version dashboard builds that you maintain, we
should be able to see if other GCC's have that issue, too :-).


> That looks like a good example for the problem.
>
> The replacement of all dynamic_casts of all itk::Objects is one approach. Here is a few others:
>
> 1) Make an explicit instantiation library with the ITK classes part of the shared libraries' interfaces.
> 2) Just compile the problematic libraries with default visibility.
> 3) Restore the functionality of the old “WrapITK” Explicit language/feature to explicitly instantiate all of ITK.
> 4) Write an entire library which fully encapsulates the ITK templated interface and used it’s own object for the visibility specified API :)

These may be good solutions for some use cases. However, we still need
to support general implicit instantiation. ITK is predominantly used
via implicit instantiation. Explicit instantiation results in building
libraries with types that are unused and have an associated negative
build time, size, and load time. And, it limits the types that can be
used relative to implicit instantiation.


> It’s interesting to note that Slicer CLI interface does not contain ITK templated objects. Does Slicer use ITK objects any where in it’s public API’s?

Note that this issue becomes predominantly problematic when ITK
templated objects are not in the ABI but used internally (as in the
test case).


Thanks,
Matt
_______________________________________________
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