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

Mathieu Malaterre mathieu.malaterre at gmail.com
Sun Apr 19 13:53:02 EDT 2009


You are setting ITK_SYSTEM_TIFF to ON. Set it to OFF or use ITK CVS,
I've put in a hack.

$ cvs ci -m"COMP: Fix compilation of ITKIO when user set SYSTEM_TIFF
to ON (and use a system gdcm 2.x)" CMakeLists.txt
/cvsroot/Insight/Insight/CMakeLists.txt,v  <--  CMakeLists.txt
new revision: 1.330; previous revision: 1.329


Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/Insight/Insight/CMakeLists.txt,v
retrieving revision 1.329
diff -u -r1.329 CMakeLists.txt
--- CMakeLists.txt	5 Apr 2009 10:56:38 -0000	1.329
+++ CMakeLists.txt	19 Apr 2009 17:50:42 -0000
@@ -728,7 +728,23 @@
     IF( "${GDCM_MAJOR_VERSION}" LESS 2.0 )
       SET(ITK_GDCM_LIBRARIES gdcm)
     ELSE( "${GDCM_MAJOR_VERSION}" LESS 2.0 )
-      SET(ITK_GDCM_LIBRARIES gdcmMSFF)
+      IF(ITK_USE_SYSTEM_TIFF)
+        # Long story short. ITKIO is NOT linked to itkjpeg8
explicitely. itkjpeg8 dep is being
+        # pulled from linking to itktiff. However in case of
ITK_SYSTEM_TIFF the FindTIFF module
+        # do not explicitely link to the system jpeg. One can check
however that on most GNU/Linux system
+        #  $ ldd /usr/lib/libtiff.so
+        #    linux-vdso.so.1 =>  (0x00007fff67fff000)
+        #    libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x00007f635f9f2000)
+        # As a side note, ITK_SYSTEM_TIFF is somewhat robust as
itkjpeg8 dep can also be pulled from
+        # linking to the default gdcm libraries since they use the
itkjpeg libraries.
+        # I do not know the correct fix:
+        # 1. Have FindTIFF link to jpeg8 (which would be the right
thing to do for static system libtiff)
+        # 2. Have ITKIO explicitely link to itkjpeg8
+        # For the time being let's explicitely pull the dep to
itkjpeg8 ourselves.
+        SET(ITK_GDCM_LIBRARIES gdcmMSFF itkjpeg8)
+      ELSE(ITK_USE_SYSTEM_TIFF)
+        SET(ITK_GDCM_LIBRARIES gdcmMSFF)
+      ENDIF(ITK_USE_SYSTEM_TIFF)
     ENDIF( "${GDCM_MAJOR_VERSION}" LESS 2.0 )
   ELSE(GDCM_FOUND)
     MESSAGE(FATAL_ERROR "Must set GDCM_DIR for ITK_USE_SYSTEM_GDCM.")


On Fri, Apr 3, 2009 at 12:17 PM, poireau <joelthelion at laposte.net> wrote:
>
> I've tried doing a clean build from a freshly uncompressed tarball, but to no avail.
>
> Here is as requested the output of make VERBOSE=1:
>
> Linking CXX executable ../../bin/itkTestDriver
> cd /home/jschaerer/workspace/InsightToolkit-3.12.0/Code/IO && /usr/bin/cmake -E cmake_link_script CMakeFiles/itkTestDriver.dir/link.txt --verbose=1
> /usr/bin/c++      -Wno-deprecated  -ftemplate-depth-50 -Wall -Wno-deprecated  -fPIC     CMakeFiles/itkTestDriver.dir/itkTestDriver.o  -o ../../bin/itkTestDriver -rdynamic -L. -L/home/jschaerer/workspace/gdcm-2-0_build/bin -L/usr/lib/vtk-5.3 ../../bin/libITKIO.so.3.12.0 ../../bin/libITKNrrdIO.so.3.12.0 -lgdcmMSFF -lgdcmDICT -lgdcmIOD -lgdcmDSED -lgdcmCommon -lgdcmzlib -lgdcmexpat -lgdcmjpeg8 -lgdcmjpeg12 -lgdcmjpeg16 -lgdcmopenjpeg -lgdcmuuid -lpng -ltiff ../../bin/libITKSpatialObject.so.3.12.0 ../../bin/libITKCommon.so.3.12.0 ../../bin/libitkvnl_inst.so.3.12.0 ../../bin/libitkvnl_algo.so.3.12.0 ../../bin/libitkv3p_netlib.so.3.12.0 ../../bin/libitkvnl.so.3.12.0 ../../bin/libitkvcl.so.3.12.0 -lm -lpthread ../../bin/libITKMetaIO.so.3.12.0 ../../bin/libitksys.so.3.12.0 -ldl ../../bin/libITKDICOMParser.so.3.12.0 ../../bin/libITKEXPAT.so.3.12.0 ../../bin/libITKniftiio.so.3.12.0 ../../bin/libITKznz.so.3.12.0 -lz -lm -Wl,-rpath,.:/home/jschaerer/workspace/gdcm-2-0_build/bin:/usr/lib/
>  vtk-5.3:/home/jschaerer/workspace/InsightToolkit-3.12.0/bin
> ../../bin/libITKIO.so.3.12.0: undefined reference to `itk_jpeg8_jpeg_simple_progression'
> ../../bin/libITKIO.so.3.12.0: undefined reference to `itk_jpeg8_jpeg_start_compress'
> ../../bin/libITKIO.so.3.12.0: undefined reference to `itk_jpeg8_jpeg_CreateDecompress'
> ../../bin/libITKIO.so.3.12.0: undefined reference to `itk_jpeg8_jpeg_std_error'
> ../../bin/libITKIO.so.3.12.0: undefined reference to `itk_jpeg8_jpeg_abort'
> ../../bin/libITKIO.so.3.12.0: undefined reference to `itk_jpeg8_jpeg_set_quality'
> ../../bin/libITKIO.so.3.12.0: undefined reference to `itk_jpeg8_jpeg_calc_output_dimensions'
> ../../bin/libITKIO.so.3.12.0: undefined reference to `itk_jpeg8_jpeg_stdio_dest'
> ../../bin/libITKIO.so.3.12.0: undefined reference to `itk_jpeg8_jpeg_stdio_src'
> ../../bin/libITKIO.so.3.12.0: undefined reference to `itk_jpeg8_jpeg_read_header'
> ../../bin/libITKIO.so.3.12.0: undefined reference to `itk_jpeg8_jpeg_finish_compress'
> ../../bin/libITKIO.so.3.12.0: undefined reference to `itk_jpeg8_jpeg_start_decompress'
> ../../bin/libITKIO.so.3.12.0: undefined reference to `itk_jpeg8_jpeg_CreateCompress'
> ../../bin/libITKIO.so.3.12.0: undefined reference to `itk_jpeg8_jpeg_write_scanlines'
> ../../bin/libITKIO.so.3.12.0: undefined reference to `itk_jpeg8_jpeg_finish_decompress'
> ../../bin/libITKIO.so.3.12.0: undefined reference to `itk_jpeg8_jpeg_destroy_decompress'
> ../../bin/libITKIO.so.3.12.0: undefined reference to `itk_jpeg8_jpeg_destroy_compress'
> ../../bin/libITKIO.so.3.12.0: undefined reference to `itk_jpeg8_jpeg_read_scanlines'
> ../../bin/libITKIO.so.3.12.0: undefined reference to `itk_jpeg8_jpeg_set_defaults'
> collect2: ld returned 1 exit status
> make[2]: *** [bin/itkTestDriver] Error 1
> make[2]: Leaving directory `/home/jschaerer/workspace/InsightToolkit-3.12.0'
> make[1]: *** [Code/IO/CMakeFiles/itkTestDriver.dir/all] Error 2
> make[1]: Leaving directory `/home/jschaerer/workspace/InsightToolkit-3.12.0'
> make: *** [all] Error 2
> jschaerer at cepe:~/workspace/InsightToolkit-3.12.0>
>
>
> thanks a lot for your help!
> --
> View this message in context: http://n2.nabble.com/Problem-building-ITK-3.12-with-GDCM-2.x-tp2575449p2579850.html
> Sent from the ITK Insight Users mailing list archive at Nabble.com.
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> 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
>



-- 
Mathieu


More information about the Insight-users mailing list