[Insight-users] Duplicate symbols from OpenJPEG with system GDCM and ITK 4.4

Matt McCormick matt.mccormick at kitware.com
Thu Jul 25 14:38:35 EDT 2013


Hi Simon,

This appears to be a bug in the GDCM library target exports.  My
GDCMConfig.cmake from a build on master:

....
get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
if(EXISTS ${SELF_DIR}/GDCMTargets.cmake)
  # This is an install tree
  include(${SELF_DIR}/GDCMTargets.cmake)
  get_filename_component(GDCM_INCLUDE_ROOT
"${SELF_DIR}/../../include/gdcm-2.3" ABSOLUTE)
  set(GDCM_INCLUDE_DIRS ${GDCM_INCLUDE_ROOT})
  get_filename_component(GDCM_LIB_ROOT "${SELF_DIR}/../../lib" ABSOLUTE)
  set(GDCM_LIBRARY_DIRS ${GDCM_LIB_ROOT})
else()
  if(EXISTS ${SELF_DIR}/GDCMExports.cmake)
    # This is a build tree
    set( GDCM_INCLUDE_DIRS
/tmp/GDCM/Source/Common;/tmp/GDCM-Build/Source/Common;/tmp/GDCM/Source/DataStructureAndEncodingDefinition;/tmp/GDCM/Source/MediaStorageAndFileFormat;/tmp/GDCM/Source/MessageExchangeDefinition;/tmp/GDCM/Source/DataDictionary;/tmp/GDCM/Source/InformationObjectDefinition)
    set(GDCM_LIBRARY_DIRS /tmp/GDCM-Build/bin/.)

    include(${SELF_DIR}/GDCMExports.cmake)

  else()
    message(FATAL_ERROR "ooops")
  endif()
endif()
....

But, GDCMExports.cmake is empty.  The installed GDCMTargets.cmake
looks OK, so you may need to either fix the build tree or use an
installed version.

HTH,
Matt


On Thu, Jul 25, 2013 at 4:10 PM, Simon Rit
<simon.rit at creatis.insa-lyon.fr> wrote:
> An additional piece of information. This worked for VV but when I tried to
> compile another software that does not have the command
>   FIND_PACKAGE(GDCM REQUIRED)
>   include(${GDCM_USE_FILE})
> I got the error
> ld: library not found for -lgdcmDICT
>
> This is because Modules/ThirdParty/GDCM/itk-module-init.cmake does not
> include ${GDCM_USE_FILE}, as shown in
> ${GDCM_SOURCE_DIR}/Examples/CMakeLists.txt.
> Simon
>
>
> On Wed, Jul 24, 2013 at 10:08 PM, Simon Rit <simon.rit at creatis.insa-lyon.fr>
> wrote:
>>
>> Thanks, after merging your two branches, everything compiles fine.
>> Simon
>>
>>
>> On Wed, Jul 24, 2013 at 8:55 PM, Xiaoxiao Liu <xiaoxiao.liu at kitware.com>
>> wrote:
>>>
>>> and this one to exclude ITKReview from building when ITK_USE_REVIEW is
>>> turned OFF:
>>> http://review.source.kitware.com/#/c/12084/
>>>
>>>
>>> On Wed, Jul 24, 2013 at 1:58 PM, Xiaoxiao Liu <xiaoxiao.liu at kitware.com>
>>> wrote:
>>>>
>>>> Will this help?
>>>> http://review.source.kitware.com/#/c/12083/
>>>>
>>>>
>>>>
>>>> On Wed, Jul 24, 2013 at 12:47 PM, Simon Rit
>>>> <simon.rit at creatis.insa-lyon.fr> wrote:
>>>>>
>>>>> Thanks! But itt's not sufficient. The cmake command gives
>>>>> -- Enabled ITKOpenJPEG, needed by [ITKGDCM].
>>>>>
>>>>> I have been a bit further. If I manually remove the dependency to
>>>>> OpenJPEG:
>>>>> diff --git a/Modules/ThirdParty/GDCM/itk-module.cmake
>>>>> b/Modules/ThirdParty/GDCM/itk-module.cmake
>>>>> index 37ba9e4..c67a8f5 100644
>>>>> --- a/Modules/ThirdParty/GDCM/itk-module.cmake
>>>>> +++ b/Modules/ThirdParty/GDCM/itk-module.cmake
>>>>> @@ -6,7 +6,6 @@ itk_module(ITKGDCM
>>>>>    DEPENDS
>>>>>      ITKZLIB
>>>>>      ITKExpat
>>>>> -    ITKOpenJPEG
>>>>>    DESCRIPTION
>>>>>      "${DOCUMENTATION}"
>>>>>  )
>>>>>
>>>>> I get :
>>>>>
>>>>> /Users/srit/src/itk4/itk/Modules/Nonunit/Review/src/itkJPEG2000ImageIO.cxx:29:12:
>>>>> fatal error:
>>>>>       'openjpeg.h' file not found
>>>>>   #include "openjpeg.h"
>>>>>
>>>>> I'm quite surprised because ITK_USE_REVIEW and BUILD_TESTING are OFF...
>>>>> Anyway, I ignored this (make -k) and I can then compile my software. So the
>>>>> dependency to ITKOpenJPEG would have to be removed in ITKGDCM if
>>>>> ITK_USE_SYSTEM_GDCM is ON.
>>>>>
>>>>> As a side note, I tried to remove the compilation of the module ITKGDCM
>>>>> but that failed. I also tried to use gdcm as described in its documentation
>>>>> but that failed too:
>>>>>
>>>>> diff --git a/Modules/ThirdParty/GDCM/itk-module-init.cmake
>>>>> b/Modules/ThirdParty/GDCM/itk-module-init.cmak
>>>>> index c04c639..90cea5f 100644
>>>>> --- a/Modules/ThirdParty/GDCM/itk-module-init.cmake
>>>>> +++ b/Modules/ThirdParty/GDCM/itk-module-init.cmake
>>>>> @@ -3,4 +3,5 @@ mark_as_advanced(ITK_USE_SYSTEM_GDCM)
>>>>>
>>>>>  if(ITK_USE_SYSTEM_GDCM)
>>>>>    find_package(GDCM REQUIRED)
>>>>> +  include(${GDCM_USE_FILE})
>>>>>  endif()
>>>>>
>>>>> I hope this (mess) helps...
>>>>> Simon
>>>>>
>>>>>
>>>>> On Wed, Jul 24, 2013 at 5:43 PM, Matt McCormick
>>>>> <matt.mccormick at kitware.com> wrote:
>>>>>>
>>>>>> Hi Simon,
>>>>>>
>>>>>> Please try this patch:
>>>>>>
>>>>>>   http://review.source.kitware.com/#/c/12078/
>>>>>>
>>>>>> Thanks,
>>>>>> Matt
>>>>>>
>>>>>> On Wed, Jul 24, 2013 at 9:40 AM, Simon Rit
>>>>>> <simon.rit at creatis.insa-lyon.fr> wrote:
>>>>>> > Hi,
>>>>>> > I am trying to build an application
>>>>>> > (http://vv.creatis.insa-lyon.fr/) under
>>>>>> > MacOS with system GDCM (latest version from git) and ITK 4.4. At
>>>>>> > link time,
>>>>>> > I get duplicate symbol errors because itk and gdcm both compile
>>>>>> > openjpeg,
>>>>>> > for example :
>>>>>> >
>>>>>> > duplicate symbol _j2k_convert_progression_order in:
>>>>>> >     /Users/srit/src/itk4/mac64/lib/libitkopenjpeg-4.4.a(j2k.c.o)
>>>>>> >
>>>>>> > /Users/srit/src/gdcm/mac64-install/lib/libgdcmopenjpeg.a(j2k.c.o)
>>>>>> >
>>>>>> > I did not find an easy way to fix this. Is there a way to disable
>>>>>> > the build
>>>>>> > of OpenJPEG when gdcm system is used? No matter what I do, the
>>>>>> > module
>>>>>> > ITKOpenJPEG is built when ITK IOs are built...
>>>>>> > Thanks in advance,
>>>>>> > Simon
>>>>>> >
>>>>>> > _____________________________________
>>>>>> > 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
>>>>>> >
>>>>>
>>>>>
>>>>>
>>>>> _____________________________________
>>>>> 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
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>>
>>>> ---------------------------------------------
>>>> Xiaoxiao Liu, Ph.D.
>>>> R & D Engineer
>>>> Kitware Inc.
>>>> Clifton Park, NY
>>>> Phone: (518) 881-4924  or  (518) 371-3971 x124
>>>>
>>>
>>>
>>>
>>> --
>>>
>>>
>>> ---------------------------------------------
>>> Xiaoxiao Liu, Ph.D.
>>> R & D Engineer
>>> Kitware Inc.
>>> Clifton Park, NY
>>> Phone: (518) 881-4924  or  (518) 371-3971 x124
>>>
>>>
>>> _____________________________________
>>> 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
>>>
>>
>
>
> _____________________________________
> 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
>


More information about the Insight-users mailing list