[Insight-users] Problem building ITK 3.12 with GDCM 2.x

Mathieu Malaterre mathieu.malaterre at gmail.com
Thu Apr 23 11:23:11 EDT 2009


On Mon, Apr 20, 2009 at 9:41 AM, Johan MOREAU <johan.moreau at ircad.fr> wrote:
> Hello Mathieu,
>
> sorry but with the trunk (1.330 +), the same problem appears.
>
> My CMake opt :
> -DBUILD_EXAMPLES:BOOL=OFF
> -DBUILD_SHARED_LIBS:BOOL=ON
> -DBUILD_TESTING:BOOL=OFF
> -DBUILD_DOXYGEN:BOOL=OFF
> -DITK_USE_SYSTEM_JPEG:BOOL=ON
> -DITK_USE_SYSTEM_PNG:BOOL=ON
> -DITK_USE_SYSTEM_TIFF:BOOL=ON
> -DITK_USE_SYSTEM_VXL:BOOL=ON
> -DITK_USE_SYSTEM_ZLIB:BOOL=ON
> --with-insight=$COMEXT/lib/
> -DITK_USE_SYSTEM_GDCM:BOOL=ON
> -DITK_USE_REVIEW:BOOL=$IS_ITK_REVIEW
> -DITK_USE_SYSTEM_LIBXML2:BOOL=ON
> -DGDCM_DIR:PATH=$COMEXT_BUILD/gdcm/"$os"_$BUILD_MODE
> -DLIBXML2_INCLUDE_DIR:PATH=$COMEXT_INC/libxml2
> -DLIBXML2_LIBRARIES:PATH=$COMEXT_LIB/libxml2$SO
> -DLIBXML2_XMLLINT_EXECUTABLE:PATH=$COMEXT_BIN/xmllint
> -DPNG_LIBRARY:PATH=$COMEXT_LIB/libpng$SO -DPNG_INCLUDE_DIR:PATH=$COMEXT_INC
> -DTIFF_INCLUDE_DIR=$COMEXT_INC
> -DTIFF_LIBRARY:PATH=$COMEXT_LIB/libtiff$SO
> -DVXL_DIR:PATH=$COMEXT/share/vxl/cmake
> -DZLIB_INCLUDE_DIR:PATH=$COMEXT_INC -DZLIB_LIBRARY:PATH=$COMEXT_LIB/libz$SO
>
> ($os, $SO, $COMEXT_LIB, $COMEXT_INC, $COMEXT_BUILD, $COMEXT_BIN,
> $BUILD_MODE are defined)
>
> If ITK_USE_SYSTEM_TIFF is setting to OFF, no change...
>
> These options work without trouble on win32, darwin, linux32, but crash
> on linux64 (x86_64)
>
> And just to see, I disable ITK_USE_SYSTEM_GDCM. Same problem occurs :
> ../../bin/libitkgdcm.so.3.13.0: undefined reference to
> `itk_jpeg16_jpeg_read_header'
> ../../bin/libitkgdcm.so.3.13.0: undefined reference to
> `itk_jpeg16_jpeg_CreateCompress'
> ../../bin/libitkgdcm.so.3.13.0: undefined reference to
> `itk_jpeg12_jpeg_start_decompress'
> ../../bin/libitkgdcm.so.3.13.0: undefined reference to
> `itk_jpeg12_jpeg_simple_lossless'
> ../../bin/libITKIO.so.3.13.0: undefined reference to
> `itk_jpeg8_jpeg_finish_compress'
> ../../bin/libitkgdcm.so.3.13.0: undefined reference to
> `itk_jpeg16_jpeg_read_scanlines'
> ../../bin/libitkgdcm.so.3.13.0: undefined reference to
> `itk_jpeg12_jpeg_read_header'
> ../../bin/libitkgdcm.so.3.13.0: undefined reference to
> `itk_jpeg16_jpeg_finish_compress'
> ../../bin/libitkgdcm.so.3.13.0: undefined reference to
> `itk_jpeg12_jpeg_write_scanlines'
> ../../bin/libITKIO.so.3.13.0: undefined reference to
> `itk_jpeg8_jpeg_set_quality'

Add a safety check.

$ cvs di Code/IO/itkJPEGImageIO* Utilities/itkjpeg
Index: Code/IO/itkJPEGImageIO.cxx
===================================================================
RCS file: /cvsroot/Insight/Insight/Code/IO/itkJPEGImageIO.cxx,v
retrieving revision 1.26
diff -u -r1.26 itkJPEGImageIO.cxx
--- Code/IO/itkJPEGImageIO.cxx  24 Oct 2008 16:21:55 -0000      1.26
+++ Code/IO/itkJPEGImageIO.cxx  23 Apr 2009 15:20:44 -0000
@@ -33,6 +33,10 @@
   #include <setjmp.h>
 }

+#ifndef itk_secret_symbol_mangled_jpeg8
+#error Sorry something went wrong with your configuration, you are
using a system jpeglib.h instead of the special mangled one
+#endif
+

 // create an error handler for jpeg that
 // can longjmp out of the jpeg library
Index: Utilities/itkjpeg/mangle_jpeg8bits.h
===================================================================
RCS file: /cvsroot/Insight/Insight/Utilities/itkjpeg/mangle_jpeg8bits.h,v
retrieving revision 1.1
diff -u -r1.1 mangle_jpeg8bits.h
--- Utilities/itkjpeg/mangle_jpeg8bits.h        29 Oct 2004 14:36:45
-0000      1.1
+++ Utilities/itkjpeg/mangle_jpeg8bits.h        23 Apr 2009 15:20:44 -0000
@@ -12,6 +12,7 @@

 nm libitkitk_jpeg8.a | grep " [R|T] " | colrm 1 11 | sort
 */
+#define itk_secret_symbol_mangled_jpeg8


 #define jcopy_block_row itk_jpeg8_jcopy_block_row


$ cvs ci -m"BUG: Some user were passing include flag using the
CMAKE_CXX_FLAGS, which would conflict with the behavior of
include_directories(before bla)" Code/IO/itkJPEGImageIO*
Utilities/itkjpeg
Running style check
Running style check
Processing itkJPEGImageIO.cxx



/cvsroot/Insight/Insight/Code/IO/itkJPEGImageIO.cxx,v  <--
Code/IO/itkJPEGImageIO.cxx
new revision: 1.27; previous revision: 1.26
/cvsroot/Insight/Insight/Utilities/itkjpeg/mangle_jpeg8bits.h,v  <--
Utilities/itkjpeg/mangle_jpeg8bits.h
new revision: 1.2; previous revision: 1.1



-- 
Mathieu


More information about the Insight-users mailing list