[Insight-users] ITK compilation error

Luis Ibanez luis.ibanez@kitware.com
Fri, 15 Mar 2002 15:47:15 -0500


Hi Eduardo,

ITK has a framework for computing Finite Elements
with the aim of performing deformable registration.

This framework can use SmartPointers as an option.
Please turn this option "OFF".  You can do that when
by CMake at the top level of  the Insight directory and
looking for the option:

   FEM_USE_SMART_POINTERS

Just put an OFF in front of it.  

You can do this by using the Curses interface to cmake,
or you can do it by editing the CMakeCache.txt file.
Then run cmake as you did for the installation.
The makefiles should be fixed after that.

BTW all the Makefiles are generated by CMake,
patching Makefiles is always a shortcut but it is better to
fix the source of the configuration problem at the CMake
level. Otherwise you may have to fix *a lot* of makefiles   :-)


Please let us know if you encounter any further problems.


Thanks

Luis



PS. What was the first problem that you encounter and
solved by modifying

/home/eduardo/Insight/Utilities/png/Makefile ??



===========================================

Eduardo Suárez wrote:

>Hello all
>
>I'm a newbie to ITK and i am trying to compile it. I could jump over the
>first error by patching /home/eduardo/Insight/Utilities/png/Makefile,
>but i don't know how to fix the second. What am i doing wrong?
>
>Thanks,
>-Eduardo
>
>Second error:
>
>c++ -g -O2 -ftemplate-depth-50 -DFEM_EXPORTS -fPIC
>-I/home/eduardo/Insight/Code/Numerics/FEM -I/home/eduardo/Insight
>-I/home/eduardo/Insight/Code/Numerics
>-I/home/eduardo/Insight/Code/Common
>-I/home/eduardo/Insight/Code/Numerics/vxl
>-I/home/eduardo/Insight/Code/Numerics/vxl
>-I/home/eduardo/Insight/Code/Numerics/vxl/vcl
>-I/home/eduardo/Insight/Code/Numerics/vxl/vcl
>-I/home/eduardo/Insight/Utilities/png
>-I/home/eduardo/Insight/Utilities/zlib   -D_PTHREADS
>-DFEM_USE_SMART_POINTERS -c
>/home/eduardo/Insight/Code/Numerics/FEM/itkFEMNodeXY.cxx -o
>itkFEMNodeXY.o
>In file included from
>/home/eduardo/Insight/Code/Numerics/FEM/itkFEMNodeXY.cxx:23:
>/home/eduardo/Insight/Code/Numerics/FEM/itkFEMNodeXY.h: In member 
>   function `virtual itk::SmartPointer<itk::fem::FEMLightObject> 
>   itk::fem::NodeXY::Clone() const':
>/home/eduardo/Insight/Code/Numerics/FEM/itkFEMNodeXY.h:39: conversion
>   from `itk::SmartPointer<itk::fem::NodeXY>' to non-scalar type 
>   `itk::SmartPointer<itk::fem::FEMLightObject>' requested
>/home/eduardo/Insight/Code/Numerics/FEM/itkFEMNodeXY.cxx: In 
>   function `itk::SmartPointer<itk::fem::FEMLightObject> 
>   itk::fem::<unnamed>::NewNodeXY()':
>/home/eduardo/Insight/Code/Numerics/FEM/itkFEMNodeXY.cxx:134: conversion
>   from `itk::SmartPointer<itk::fem::NodeXY>' to non-scalar type 
>   `itk::SmartPointer<itk::fem::FEMLightObject>' requested
>make[7]: *** [itkFEMNodeXY.o] Error 1
>make[6]: *** [default_target] Error 2
>make[5]: *** [default_target_FEM] Error 2
>make[4]: *** [default_target] Error 2
>make[3]: *** [default_target_Numerics] Error 2
>make[2]: *** [default_target] Error 2
>make[1]: *** [default_target_Code] Error 2
>make: *** [default_target] Error 2
>
>**********************************************************
>First error, just in case:
>
>c++  -rdynamic -shared -g -O2 -ftemplate-depth-50 -o  libitkpng.so 
>pngget.o pngrio.o pngwrite.o png.o pngmem.o pngrtran.o pngtrans.o
>pngwtran.o pngerror.o pngpread.o pngrutil.o pngvcrd.o pngwutil.o
>pnggccrd.o pngread.o pngset.o pngwio.o 
>-L/home/eduardo/Insight/Code/Common
>-L/home/eduardo/Insight/Code/Numerics/vxl -litkzlib -lpthread -ldl
>-Wl,-rpath,/home/eduardo/Insight/Code/Common:/home/eduardo/Insight/Code/Numerics/vxl 
>/usr/bin/ld: cannot find -litkzlib
>collect2: ld returned 1 exit status
>make[5]: *** [libitkpng.so] Error 1
>make[4]: *** [default_target] Error 2
>make[3]: *** [default_target_png] Error 2
>make[2]: *** [default_target] Error 2
>make[1]: *** [default_target_Utilities] Error 2
>make: *** [default_target] Error 2
>
>Patch to /home/eduardo/Insight/Utilities/png/Makefile:
>
>107c107
><         $(itkpng_SRC_OBJS) -L/home/eduardo/Insight/Code/Common
>-L/home/eduardo/Insight/Code/Numerics/vxl
>-L/home/eduardo/Insight/Utilities/zlib -litkzlib -lpthread -ldl
>-Wl,-rpath,/home/eduardo/Insight/Code/Common:/home/eduardo/Insight/Code/Numerics/vxl 
>---
>
>>        $(itkpng_SRC_OBJS) -L/home/eduardo/Insight/Code/Common -L/home/eduardo/Insight/Code/Numerics/vxl -litkzlib -lpthread -ldl -Wl,-rpath,/home/eduardo/Insight/Code/Common:/home/eduardo/Insight/Code/Numerics/vxl 
>>
>
>**************************************************
>_______________________________________________
>Insight-users mailing list
>Insight-users@public.kitware.com
>http://public.kitware.com/mailman/listinfo/insight-users
>