[Insight-users] Shared libraries

Brad King brad.king at kitware.com
Wed, 28 Apr 2004 09:19:19 -0400


Zachary Pincus wrote:
> Hello,
> 
> I just updated to the latest ITK CVS, and it looks like there are a few 
> changes in the template instantiation arena. Specifically, 
> itkExplicitInstantiations looks like it has some common instantiations 
> -- very cool.
> 
> A few questions:
> (1) What platforms/compilers does this seem to work on?
> (2) Is this available from static and shared libraries, or only the 
> shared libs?
> (3) How can I tell if my compiler is properly taking the instantiations 
> from the library and not rebuilding them each time? (That is, how can I 
> tell if it's working?)

This code is an experimental implementation and is not ready for use. 
I've been working on a more complete implementation to solve this 
problem but it is not yet ready.

> And while I'm asking impertinent questions:
> If I do build with shared libraries, do I need to "make install"  before 
> they're accessible? (I assume so...) And, how do I tell that I'm 
> actually linking in the shared libs to my executables? (I assume that 
> one just checks with nm or libtool or whatever the platform-appropriate 
> dependency checker is...)

ITK is designed to work either from the build tree or from the install 
tree.  On UNIX the executables for your application will have runtime 
search paths built into them to find the ITK libraries from the build 
tree.  On Windows, unfortunately, there is no such functionality for 
DLLs.  You will have to copy the ITK DLLs into your project's executable 
output directory.  It is possible to do this using CMake code in your 
project.  Take a look at the CONFIGURE_FILE command, and especially its 
COPY_ONLY option.  Look also at the CMAKE_SHARED_LIBRAY_PREFIX and 
CMAKE_SHARED_LIBRARY_SUFFIX variables.

-Brad