[ITK Community] Integrating ITK into our own SDK

Michael Jackson mike.jackson at bluequartz.net
Fri Mar 14 17:08:01 EDT 2014


It isn't about static versus dynamic. It is about Debug versus Release. For Visual Studio, if you link a Debug build of ITK with a Release build of your project (Or the other way around) Visual Studio will link in 2 different C/C++ runtime libraries into your final project. Those to runtime libraries do NOT behave the same way and can cause really odd and frustrating crashes that are un-debuggable because the project may be allocating memory in one runtime but deallocating it in another runtime that might deallocate it differently. And that is just one example of the issue.

  Static Linking can help with the final distribution of the project as you don't have to worry out copying all the DLL files but for us, since we have a Plugin Structure, if 2 developers each use ITK in their own plugins with their own builds of ITK I can pretty much foresee issues arising where each plugin has its own copy of the ITK library. That could get interesting in a hurry.

Maybe I am just worrying about nothing but since I have been stung by this in the past (more than a few times) I was hoping to avoid it.

I think our "solution" seems to be what everyone else does. Just pull and download, except those behind a firewall.

Does ITK have a "recommended" zip file download link we should use? Some of our developers do not have git on their computers  either so trying to clone the repo is not going to work all the time.

Thanks
Mike Jackson


On Mar 13, 2014, at 3:40 PM, Gib Bogle <g.bogle at auckland.ac.nz> wrote:

> Hi Mike,
> 
> To answer your question about VS users of ITK, I have taken the easy path and just link in the static libraries.
> 
> Gib
> ________________________________________
> From: Community [community-bounces at itk.org] on behalf of Michael Jackson [mike.jackson at bluequartz.net]
> Sent: Friday, 14 March 2014 3:35 a.m.
> To: Matt McCormick
> Cc: community at itk.org
> Subject: Re: [ITK Community] Integrating ITK into our own SDK
> 
> So that didn't work. Here is what I tried. On windows (VS2013 Pro) I configured ITK to have an install prefix of C:/Developer/x64/ITK/Debug, configured, built in Debug and installed. I then went back to CMake and reset the install prefix to C:/Developer/x64/ITK/Release, configured, built in Release and installed.
> 
> Now I exported the ITK_DIR environment variable as C:/Developer/x64/ITK and tried to configure our own project and it fails to find ITK because CMake can not find the *.cmake files that ITK would normally install but since the ITK_DIR really points to a directory above there it _really_ should point it does not work.
> 
> So, back to my original question. how do developers on Windows, specifically Visual Studio, develop against ITK? Do they just configure ITK and build in place and then just point their projects to the ITK Build directory? I am hesitant to try to work with Static Libraries as our project uses plugins and there can be cross-talk among the plugins. So if we have multiple Developers writing multiple plugins where each plugin links agains their own ITK I am foreseeing trouble in the future with that setup (Again on Windows)..
> 
> Has anyone else ever made this type of request of ITK in the past?
> 
> Thoughts and Suggestions are Welcome?
> 
> --
> Mike Jackson
> 
> 
> On Mar 12, 2014, at 3:27 PM, Matt McCormick <matt.mccormick at kitware.com> wrote:
> 
>> Hi Mike,
>> 
>> 
>> On Wed, Mar 12, 2014 at 1:54 PM, Michael Jackson <mike.jackson at bluequartz.net> wrote:
>> So what you are suggesting is that when I build ITK I would build ITK In Debug and then install to (for example) C:/ITK/Debug and when building in Release install to C:/ITK/Release?
>> 
>> Yeap.
>> 
>> 
>> Would that mess up the actual use of
>> find_package(ITK) in my own project? Would find_package(ITK) actually be able to distinguish between the Debug and Release builds?
>> 
>> 
>> It would work best with two builds of the project.
>> 
>> HTH,
>> Matt
> 
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/cgi-bin/mailman/listinfo/community




More information about the Community mailing list