[Insight-users] How to reduce the compilation time

Saurabh Garg srbh.garg at gmail.com
Sun Mar 10 19:50:22 EDT 2013


Hi Ariel,

I had similar problem. There are couple of things you can do. Try to remove
the ITK header files which you are not using anymore. As you mention, you
are already compiling the modified files only. Try to split the code
further over more files/modules, if you can. For Instance, I see, you are
using different optimizers. Are you using all of them or testing the
performance with different optimizer. In later case, I would protect the
code with #ifdef and #endif, so that you can exclude the code/header files
which you don't need for the current run.


HTH,
Saurabh

On Sun, Mar 10, 2013 at 2:31 PM, Ariel Hernán Curiale <curiale at gmail.com>wrote:

> Hi,
> .
> I'm looking for some tips about how can I reduce the compilation time. I
> created some libraries Metric1.a, Metric2.a, Metric3.a, BlockMatching.a and
> MyRegistration.a to compile just the modified code and not all of it.
>
> In my code, I use this main class:
>
> #include <itkSymmetricForcesDemonsRegistrationFilter.h>
> #include <itkMultiResolutionPDEDeformableRegistration.h>
> #include <itkBSplineInterpolateImageFunction.h>
> #include <itkMultiResolutionImageRegistrationMethod.h>
> #include <itkMultiResolutionPyramidImageFilter.h>
> #include <itkBSplineTransform.h>
> #include <itkRegularStepGradientDescentOptimizer.h>
> #include <itkLBFGSBOptimizer.h>
> #include <itkConjugateGradientOptimizer.h>
> #include <itkLinearInterpolateImageFunction.h>
> #include <itkInterpolateImageFunction.h>
> #include <itkResampleImageFilter.h>
> #include <itkRecursiveMultiResolutionPyramidImageFilter.h>
> #include <itkCovariantVector.h>
> #include <itkMeanSquaresImageToImageMetric.h>
> #include <itkBinaryDilateImageFilter.h>
> #include <itkResampleImageFilter.h>
> #include <itkExtractImageFilter.h>
> #include <itkWarpImageFilter.h>
> #include <itkMultiResolutionPDEDeformableRegistration.h>
> #include <itkRescaleIntensityImageFilter.h>
> #include <itkBinaryThresholdImageFilter.h>
> #include <itkImageRandomConstIteratorWithIndex.h>
>
> Also, I work with different types of pixels in 2D, 3D and 4D:
> unsigned char
> char
> unsigned short
> short
> unsigned int
> int
> unsigned long
> long
> float
> double
>
>
> The main problem is that the code takes too much time to compile (I use
> itk-4.3,  vtk-5.10 and gcc 4.2). If anyone could give me some tips about
> how can I reduce the compiling time it would be really useful.
>
> In the CMakeList.txt I link the libraries and the main code with
> ${ITK_LIBRARIES} (I couldn't find the ITKRegistrationCommon library to use
> just this library).
>
> Regards,
> __________________________________
> | Ariel Hernán Curiale Ph.D Student
> | ETSI Telecomunicación
> | Universidad de Valladolid
> | Campus Miguel Delibes
> | 47011 Valladolid, Spain
> | Phone: 983-423000 ext. 5590
> | Web: www.curiale.com.ar
> |_________________________________
>
>
> _____________________________________
> 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://www.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://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130310/d46e02b7/attachment.htm>


More information about the Insight-users mailing list