Page MenuHomePhabricator

VTK garbage collection fix for OSX 10.9 and XCode 5.1.1
Closed, ResolvedPublic

Description

MITK superbuild will fail when building VTK. The following error occurs:
error: garbage collection is no longer supported

this is due to VTKs configuration supporting garbage collection which is dropped in XCode 5.1

to overcome this issue remove "-fobjc-gc" flag at "VTK_REQUIRED_OBJCXX_FLAGS" in VTK CMake configuration.

Event Timeline

Could you specify the versions of MITK, OS X and XCode? Seems to be a VTK bug, so I'm not sure about put the flag in MITK. @Andi: can you confirm this?

Just noticed the version numbers in the description, sorry ...

np, here a list of all version numbers:

MITK release 2014-03
OSX 10.9.2
XCode 5.1.1
CMake 2.8-12

I am not using the latest Xcode but Jonas and he had the same problem. It looks like this is already fixed in VTK, probably for the next VTK release:

https://gitorious.org/kitware/vtk/commit/74f4888a29bfd0bce44ea43060f08fa19097237f

@Igi, Jonas: Do we already have a patch for that?

I pushed a branch containing some CMakeExternals/VTK.cmake adaptions. Please review.

User cordes has pushed new remote branch:

bug-17716-VTKGarbageCollectionFix

(In reply to Git Admin from comment #6)

User cordes has pushed new remote branch:

bug-17716-VTKGarbageCollectionFix
  1. I think the option should be removed from VTK_REQUIRED_OBJCXX_FLAGS, instead of clearing the variable.
  2. CMake command names should be put in lowercase
  3. There should be no additional status output if nothing is changed
  4. The check for VTK > 6.1 should be enabled so it is clear the code can be removed at some point

In general I'm not too happy about this fix in general since it adds complexity on the MITK side for a bug on a platform that is not yet supported by VTK ...

(In reply to Marco Nolden from comment #7)

(In reply to Git Admin from comment #6)

User cordes has pushed new remote branch:

bug-17716-VTKGarbageCollectionFix
  1. I think the option should be removed from VTK_REQUIRED_OBJCXX_FLAGS,

instead of clearing the variable.

  1. CMake command names should be put in lowercase
  2. There should be no additional status output if nothing is changed
  3. The check for VTK > 6.1 should be enabled so it is clear the code can be

removed at some point

In general I'm not too happy about this fix in general since it adds
complexity on the MITK side for a bug on a platform that is not yet
supported by VTK ...

I have swapped out the changes in a patch, so there are minimal adaptions in the main file. In addition I could access the version number of VTK.

Is it okay to show a cmake warning (to remove the code again!) if a new VTK version was released?

What is the status of this? Shall we integrate the fix from Jonas or rather wait until this is fixed within VTK?

User fetzer has pushed new remote branch:

bug-17716-vtk-with-garbage-collection-fix

[85b4d4]: Merge branch 'bug-17716-vtk-with-garbage-collection-fix'

Merged commits:

2014-09-25 15:06:57 Andreas Fetzer [aef27b]
Update VTK tar ball. It is still based on VTK 6.1.0 but has an additional VTK
commit included (hash: 74f4888). This commit fixes an unrecognized compiler option
for newer mac compilers.