<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello,<div><br></div><div>I was getting the following error:</div><div><br></div><div><div>&gt;$ wish</div><div>% package require vtk</div><div>dlopen(~/local/lib/vtk-5.4/libvtkRenderingTCL.dylib, 10): Library not loaded: libvtkRendering.5.4.dylib</div><div>&nbsp;&nbsp;Referenced from: ~/local/lib/vtk-5.4/libvtkRenderingTCL.dylib</div><div>&nbsp;&nbsp;Reason: no suitable image found. &nbsp;Did find:</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>libvtkRendering.5.4.dylib: GC capability mismatch</div><div>attempt to provide package vtkRenderingTCL 5.4 failed: no version of package vtkRenderingTCL provided</div><div>attempt to provide package vtkrendering 5.4 failed: no version of package vtkrendering provided</div><div>attempt to provide package vtk 5.4 failed: no version of package vtk provided</div><div><br></div><div>The solution was to define the following CMake variable:</div><div><br></div><div>-D VTK_REQUIRED_OBJECTCXX_FLAGS:STRING=-fobjc-gc</div><div><br></div><div>I tried many different combinations of deployment targets, architecture, and cocoa vs carbon. In the end I have gotten it working for "i386;x86_64", the default 10.6 deployment target, cocoa, and tcl enabled.</div><div><br></div><div>I am not a OBJC expert but it appears that with the Apple Snow Leopard (10.6) this flag may be needed for objc libraries for Garbage Collection compatibility. ( I wish google was smart enough to do a better job with two character searches "GC" ) I discovered the compatibility issue with the Tcl/Tk library, the question remains what other libraries will this also be a problem with?</div><div><br></div><div><br></div><div>=Solution? =</div><div><br></div><div>The&nbsp;-fobjc-gc should be added to the default OBJC arguments for the appropriate OS versions..</div><div><br></div><div>From:&nbsp;<a href="http://developer.apple.com/mac/library/releasenotes/DeveloperTools/RN-Xcode/">http://developer.apple.com/mac/library/releasenotes/DeveloperTools/RN-Xcode/</a></div><div><font class="Apple-style-span" face="'Lucida Grande', Geneva, Helvetica, Arial, sans-serif"><br></font></div><div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: 12px; ">The&nbsp;<strong>Objective-C Garbage Collection</strong>&nbsp;setting enables compiling and linking Objective-C code for automatic garbage collection. It has three states: Unsupported disables garbage collection; Required (<code style="font-size: 11px; font-family: Menlo, Monaco, Courier, Consolas, monospace; ">-fobjc-gc-only</code>) will create an executable that runs only on Mac OS X 10.5 and later and will always run garbage collected; and Supported (<code style="font-size: 11px; font-family: Menlo, Monaco, Courier, Consolas, monospace; ">-fobjc-gc</code>) will create an executable that can run either garbage collected or not, depending on how the user chooses to launch it or, in the case of libraries and frameworks, whether the invoking application is using garbage collection.</span></div><div><br></div><div>I am running cmake 2.6. But cmake appears not to even support the flags correctly:</div><div><a href="http://public.kitware.com/Bug/view.php?id=4756">http://public.kitware.com/Bug/view.php?id=4756</a></div><div><br></div><div>So likely the easies solution would be just to handle this inside VTK CMakeLists.txt</div><div><br></div><div>Thanks,</div><div>Brad</div><div><br></div></div><div><br><div>
<span class="Apple-style-span" style="font-size: 12px; "><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">========================================================</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Bradley Lowekamp<span class="Apple-converted-space">&nbsp;</span><span class="Apple-converted-space">&nbsp;</span></font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font class="Apple-style-span" face="Arial"><span class="Apple-style-span" style="font-family: Arial; "><span class="Apple-style-span" style="font-family: Arial; ">Lockheed Martin&nbsp;</span></span></font><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Contractor for</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Office of High Performance Computing and Communications</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">National Library of Medicine<span class="Apple-converted-space">&nbsp;</span></font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica"><a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a></font></p><br class="Apple-interchange-newline"></span>
</div>
<br></div></body></html>