[Elastix] Building elastix as static library - Errors

M.Staring at lumc.nl M.Staring at lumc.nl
Fri Nov 13 09:09:56 CET 2015


What happens if you change those lines to
const unsigned int fixdim = vnl_math_min( this->GetElastix()->FixedDimension, 2u );
const unsigned int movdim = vnl_math_min( this->GetElastix()->MovingDimension, 2u );
?

Best, Marius

From: elastix-bounces at bigr.nl [mailto:elastix-bounces at bigr.nl] On Behalf Of joao santinha
Sent: donderdag 12 november 2015 17:15
To: elastix at bigr.nl
Subject: [Elastix] Building elastix as static library - Errors

Hi,

I am building elastix as a static linked library and during the make I ran into some errors.

The first one:
[ 28%] Building CXX object Common/OpenCL/CMakeFiles/elxOpenCL.dir/GPUBSplineDecompositionImageFilterKernel.cxx.o
In file included from /elastix/src/build/Common/OpenCL/GPUBSplineDecompositionImageFilterKernel.cxx:1:
In file included from /elastix/src/Common/OpenCL/Filters/itkGPUBSplineDecompositionImageFilter.h:99:
In file included from /elastix/src/Common/OpenCL/Filters/itkGPUBSplineDecompositionImageFilter.hxx:22:
In file included from /elastix/src/Common/OpenCL/Filters/itkGPUCastImageFilter.h:26:
In file included from /elastix/src/Common/OpenCL/ITKimprovements/itkGPUUnaryFunctorImageFilter.h:146:
/elastix/src/Common/OpenCL/ITKimprovements/itkGPUUnaryFunctorImageFilter.hxx:91:22: error:
      use of undeclared identifier 'OpenCLGetLocalBlockSize'
    localSize[ i ] = OpenCLGetLocalBlockSize( InputImageDimension );
                     ^
1 error generated.
make[2]: *** [Common/OpenCL/CMakeFiles/elxOpenCL.dir/GPUBSplineDecompositionImageFilterKernel.cxx.o] Error 1
make[1]: *** [Common/OpenCL/CMakeFiles/elxOpenCL.dir/all] Error 2
======/ END OF ERROR /=======
I manage to solve this error by adding #include “itkOpenCLUtil.h” to #include “itkGPUUnaryFunctorImageFilter.hxx".
The second error was:
Scanning dependencies of target AdaptiveStochasticGradientDescent
[ 65%] Building CXX object Components/Optimizers/AdaptiveStochasticGradientDescent/CMakeFiles/AdaptiveStochasticGradientDescent.dir/elxAdaptiveStochasticGradientDescent.cxx.o
In file included from /elastix/src/Components/Optimizers/AdaptiveStochasticGradientDescent/elxAdaptiveStochasticGradientDescent.cxx:19:
In file included from /elastix/src/Components/Optimizers/AdaptiveStochasticGradientDescent/elxAdaptiveStochasticGradientDescent.h:430:
/elastix/src/Components/Optimizers/AdaptiveStochasticGradientDescent/elxAdaptiveStochasticGradientDescent.hxx:173:33: error:
      call to 'vnl_math_min' is ambiguous
    const unsigned int fixdim = vnl_math_min( this->GetElastix()->FixedD...
                                ^~~~~~~~~~~~
/elastix/src/Components/Optimizers/AdaptiveStochasticGradientDescent/elxAdaptiveStochasticGradientDescent.h:340:3: note:
      in instantiation of member function
      'elastix::AdaptiveStochasticGradientDescent<elastix::ElastixTemplate<itk::Image<float,
      2>, itk::Image<float, 2> > >::BeforeEachResolution' requested here
  AdaptiveStochasticGradientDescent();
  ^
/elastix/src/Components/Optimizers/AdaptiveStochasticGradientDescent/elxAdaptiveStochasticGradientDescent.h:205:16: note:
      in instantiation of member function
      'elastix::AdaptiveStochasticGradientDescent<elastix::ElastixTemplate<itk::Image<float,
      2>, itk::Image<float, 2> > >::AdaptiveStochasticGradientDescent' requested
      here
  itkNewMacro( Self );
               ^
/itk/Modules/Core/Common/include/itkMacro.h:190:21: note:
      expanded from macro 'itkNewMacro'
  itkSimpleNewMacro(x)                                         \
                    ^
/itk/Modules/Core/Common/include/itkMacro.h:200:22: note:
      expanded from macro 'itkSimpleNewMacro'
      smartPtr = new x;                                        \
                     ^
/elastix/src/Core/Install/elxInstallFunctions.h:69:60: note:
      in instantiation of member function
      'elastix::AdaptiveStochasticGradientDescent<elastix::ElastixTemplate<itk::Image<float,
      2>, itk::Image<float, 2> > >::New' requested here
    return dynamic_cast< ObjectType * >( AnyItkObjectType::New().GetPointer() );
                                                           ^
/elastix/src/Core/Install/elxInstallFunctions.h:80:44: note:
      in instantiation of member function
      'elastix::InstallFunctions<elastix::AdaptiveStochasticGradientDescent<elastix::ElastixTemplate<itk::Image<float,
      2>, itk::Image<float, 2> > > >::Creator' requested here
    return cdb->SetCreator( name, i, Self::Creator );
                                           ^
/elastix/src/Components/Optimizers/AdaptiveStochasticGradientDescent/elxAdaptiveStochasticGradientDescent.cxx:21:1: note:
      in instantiation of member function
      'elastix::InstallFunctions<elastix::AdaptiveStochasticGradientDescent<elastix::ElastixTemplate<itk::Image<float,
      2>, itk::Image<float, 2> > > >::InstallComponent' requested here
elxInstallMacro( AdaptiveStochasticGradientDescent );
^
/elastix/src/Core/Install/elxMacro.h:102:101: note:
      expanded from macro 'elxInstallMacro'
  ...= ::elx::InstallFunctions< ::elx::_classname< ElastixType > >::InstallCo...
                                                                    ^
/elastix/src/Components/Optimizers/AdaptiveStochasticGradientDescent/elxAdaptiveStochasticGradientDescent.cxx:21:1: note:
      in instantiation of member function
      'AdaptiveStochasticGradientDescent_install<1>::DO' requested here
elxInstallMacro( AdaptiveStochasticGradientDescent );
^
/elastix/src/Core/Install/elxMacro.h:119:64: note:
      expanded from macro 'elxInstallMacro'
    int _InstallDummy##_classname = _classname##_install< 1 >::DO( _cdb  ); \
                                                               ^
/itk/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h:567:27: note:
      candidate function
inline int                vnl_math_min(int x, int y...
                          ^
/itk/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h:568:27: note:
      candidate function
inline unsigned int       vnl_math_min(unsigned int x, unsigned int y...
                          ^
/itk/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h:569:27: note:
      candidate function
inline long               vnl_math_min(long x, long y...
                          ^
/itk/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h:570:27: note:
      candidate function

inline unsigned long      vnl_math_min(unsigned long x, unsigned long y...
and so on…
======/ END OF ERROR /=======
In order to compile elastix as a library I had to uncheck the option USE_AdaptiveStochasticGradientDescent but I need to use the AdaptiveStochasticGradientDescent.
Does anyone know what might be causing this error?
Best regards,
Joao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bigr.nl/pipermail/elastix/attachments/20151113/bfaf8777/attachment-0001.html>


More information about the Elastix mailing list