<div dir="ltr">VTK_USE_RPATH should be sufficient...<br><br><div><br><div class="gmail_quote">On Fri, Sep 5, 2008 at 5:51 PM, Darren Weber <span dir="ltr">&lt;<a href="mailto:darren.weber.lists@gmail.com">darren.weber.lists@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="Ih2E3d">On Wed, Sep 3, 2008 at 3:28 PM, Mike Jackson<br>
&lt;<a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a>&gt; wrote:<br>
&gt; Cross posting to vtkusers list as that may be more appropriate:<br>
&gt;<br>
&gt;<br>
&gt; Can you rebuild VTK with these two settings:<br>
&gt;<br>
&gt; CMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON \<br>
<br>
</div>Where is this? &nbsp;I don&#39;t see it in ccmake. &nbsp;How do you set it?<br>
<br>
&gt; VTK_USE_RPATH=ON<br>
<br>
This I can see in ccmake<br>
<div><div></div><div class="Wj3C7c"><br>
&gt;<br>
&gt; Run ccmake on your vtk build directory and set those two cmake variables.<br>
&gt; Configure and build. After the build completes, then run &quot;make install&quot;.<br>
&gt;<br>
&gt; The default installation location is in /usr/local. I would change it to<br>
&gt; /usr/local/vtk-5.2.<br>
&gt;<br>
&gt; Next, Get rid of extra Python builds on your system. The only python build<br>
&gt; should be in /System/Library/Frameworks.<br>
&gt;<br>
&gt; Now try to build your project. If everything goes correctly you should NOT<br>
&gt; need to mess with DYLD_LIBRARY_PATH. The reason why you are having to set<br>
&gt; that variable is because, as you found out, the vtk libraries do NOT have an<br>
&gt; &quot;install_path&quot; (same as rpath on linux) set in them. Without that set to<br>
&gt; anything besides the library name the linker will not be able to encode the<br>
&gt; correct path in anything else that depends on the vtk libraries. Which is<br>
&gt; some of your problems.<br>
&gt;<br>
&gt; Let us know if you can get this far.<br>
&gt;<br>
&gt; Mike<br>
&gt; On Sep 3, 2008, at 2:19 PM, Darren Weber wrote:<br>
&gt;<br>
&gt;&gt; I think we may be on the &quot;right&quot; track with addition(s) to the DYLD path,<br>
&gt;&gt; ie:<br>
&gt;&gt;<br>
&gt;&gt; [ dweber@elegans ~/src/kitware/VTK_build ]$ echo $DYLD_LIBRARY_PATH<br>
&gt;&gt;<br>
&gt;&gt; [ dweber@elegans ~/src/kitware/VTK_build ]$ export<br>
&gt;&gt; DYLD_LIBRARY_PATH=/usr/local/lib/vtk-5.2<br>
&gt;&gt; [ dweber@elegans ~/src/kitware/VTK_build ]$ echo $DYLD_LIBRARY_PATH<br>
&gt;&gt; /usr/local/lib/vtk-5.2<br>
&gt;&gt; [ dweber@elegans ~/src/kitware/VTK_build ]$ python<br>
&gt;&gt; Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53)<br>
&gt;&gt; [GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin<br>
&gt;&gt; Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; import vtk<br>
&gt;&gt;<br>
&gt;&gt; Traceback (most recent call last):<br>
&gt;&gt; &nbsp;File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;<br>
&gt;&gt; &nbsp;File &quot;/usr/local/lib/python2.5/site-packages/vtk/__init__.py&quot;, line<br>
&gt;&gt; 43, in &lt;module&gt;<br>
&gt;&gt; &nbsp; from io import *<br>
&gt;&gt; &nbsp;File &quot;/usr/local/lib/python2.5/site-packages/vtk/io.py&quot;, line 7, in<br>
&gt;&gt; &lt;module&gt;<br>
&gt;&gt; &nbsp; from libvtkIOPython import *<br>
&gt;&gt; ImportError:<br>
&gt;&gt; dlopen(/usr/local/lib/python2.5/site-packages/vtk/libvtkIOPython.so,<br>
&gt;&gt; 10): Library not loaded: libpq.5.dylib<br>
&gt;&gt; &nbsp;Referenced from:<br>
&gt;&gt; /usr/local/lib/python2.5/site-packages/vtk/libvtkIOPython.so<br>
&gt;&gt; &nbsp;Reason: image not found<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; This is another failure, but this time it is related to the PostgreSQL<br>
&gt;&gt; library that resides in another location (under /Library path). &nbsp;So, I<br>
&gt;&gt; conclude from this test that dlopen is now finding the vtk dylib<br>
&gt;&gt; files.<br>
&gt;&gt;<br>
&gt;&gt; Now, we can get the following &quot;diagnostics&quot; on the .so from the prior<br>
&gt;&gt; import problem:<br>
&gt;&gt;<br>
&gt;&gt; [ dweber@elegans ~/src/kitware/VTK_build ]$ otool -L<br>
&gt;&gt; /usr/local/lib/python2.5/site-packages/vtk/libvtkCommonPython.so<br>
&gt;&gt; /usr/local/lib/python2.5/site-packages/vtk/libvtkCommonPython.so:<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;libvtkCommonPythonD.5.2.dylib (compatibility version 0.0.0, current<br>
&gt;&gt; version 0.0.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;/Library/Frameworks/Python.framework/Versions/2.5/Python<br>
&gt;&gt; (compatibility version 2.5.0, current version 2.5.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;libvtkCommon.5.2.dylib (compatibility version 0.0.0, current<br>
&gt;&gt; version 0.0.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;libvtksys.5.2.dylib (compatibility version 0.0.0, current version<br>
&gt;&gt; 0.0.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current<br>
&gt;&gt; version 111.1.1)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current<br>
&gt;&gt; version 7.4.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current<br>
&gt;&gt; version 1.0.0)<br>
&gt;&gt; [ dweber@elegans ~/src/kitware/VTK_build ]$<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Notice how some of the system libaries have full paths (ie,<br>
&gt;&gt; /usr/lib/....), but the vtk dylib files have no paths. &nbsp;Hence, when we<br>
&gt;&gt; specify the DYLD_LIBRARY_PATH, the python import process is now<br>
&gt;&gt; finding these extra libraries because dlopen is now searching at least<br>
&gt;&gt; the /usr/local/lib/vtk... path (recursively? maybe not, because it<br>
&gt;&gt; doesn&#39;t work if we use /usr/local/lib without the specific vtk path).<br>
&gt;&gt;<br>
&gt;&gt; Similarly, now we can see the full library dependency for the<br>
&gt;&gt; IOPython.so file using:<br>
&gt;&gt;<br>
&gt;&gt; [ dweber@elegans ~/src/kitware/VTK_build ]$ otool -L<br>
&gt;&gt; /usr/local/lib/python2.5/site-packages/vtk/libvtkIOPython.so<br>
&gt;&gt; /usr/local/lib/python2.5/site-packages/vtk/libvtkIOPython.so:<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;libvtkIOPythonD.5.2.dylib (compatibility version 0.0.0, current<br>
&gt;&gt; version 0.0.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;libvtkIO.5.2.dylib (compatibility version 0.0.0, current version<br>
&gt;&gt; 0.0.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;/usr/local/lib/libpqxx-2.6.9.dylib (compatibility version 0.0.0,<br>
&gt;&gt; current version 0.0.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;libpq.5.dylib (compatibility version 5.0.0, current version 5.1.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;/usr/local/mysql/lib/libmysqlclient.15.dylib (compatibility version<br>
&gt;&gt; 16.0.0, current version 16.0.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version<br>
&gt;&gt; 1.2.3)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;libvtkFilteringPythonD.5.2.dylib (compatibility version 0.0.0,<br>
&gt;&gt; current version 0.0.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;libvtkCommonPythonD.5.2.dylib (compatibility version 0.0.0, current<br>
&gt;&gt; version 0.0.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;/Library/Frameworks/Python.framework/Versions/2.5/Python<br>
&gt;&gt; (compatibility version 2.5.0, current version 2.5.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;libvtkFiltering.5.2.dylib (compatibility version 0.0.0, current<br>
&gt;&gt; version 0.0.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;libvtkDICOMParser.5.2.dylib (compatibility version 0.0.0, current<br>
&gt;&gt; version 0.0.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;libvtkNetCDF.5.2.dylib (compatibility version 0.0.0, current<br>
&gt;&gt; version 0.0.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;libvtkmetaio.5.2.dylib (compatibility version 0.0.0, current<br>
&gt;&gt; version 0.0.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;libvtksqlite.5.2.dylib (compatibility version 0.0.0, current<br>
&gt;&gt; version 0.0.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;libvtkpng.5.2.dylib (compatibility version 0.0.0, current version<br>
&gt;&gt; 0.0.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;libvtktiff.5.2.dylib (compatibility version 0.0.0, current version<br>
&gt;&gt; 0.0.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;libvtkzlib.5.2.dylib (compatibility version 0.0.0, current version<br>
&gt;&gt; 0.0.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;libvtkjpeg.5.2.dylib (compatibility version 0.0.0, current version<br>
&gt;&gt; 0.0.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;libvtkexpat.5.2.dylib (compatibility version 0.0.0, current version<br>
&gt;&gt; 0.0.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;libvtkCommon.5.2.dylib (compatibility version 0.0.0, current<br>
&gt;&gt; version 0.0.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;libvtksys.5.2.dylib (compatibility version 0.0.0, current version<br>
&gt;&gt; 0.0.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current<br>
&gt;&gt; version 111.1.1)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current<br>
&gt;&gt; version 7.4.0)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current<br>
&gt;&gt; version 1.0.0)<br>
&gt;&gt; [ dweber@elegans ~/src/kitware/VTK_build ]$<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; It&#39;s curious that it has a full path to /usr/local/lib/libpqxx (which<br>
&gt;&gt; I had to build and install on this system), but it has no full path to<br>
&gt;&gt; the associated libpq. &nbsp;I don&#39;t fully understand this link dependency,<br>
&gt;&gt; as I thought libpqxx would be the primary link target and, in turn, it<br>
&gt;&gt; would link to libpq. (This postgreSQL stuff is another topic on the<br>
&gt;&gt; list somewhere.)<br>
&gt;&gt;<br>
&gt;&gt; It&#39;s also curious that &#39;locate&#39; can find the libpq, but dlopen does<br>
&gt;&gt; not. &nbsp;So, something about the locate environment of default settings<br>
&gt;&gt; is different from the dlopen environment, eg:<br>
&gt;&gt;<br>
&gt;&gt; {{{<br>
&gt;&gt; [ dweber@elegans ~/src/kitware/VTK_build ]$ locate libpq.5.dylib<br>
&gt;&gt; /Library/PostgreSQL/8.3/lib/libpq.5.dylib<br>
&gt;&gt; /Library/PostgreSQL/8.3/pgAdmin3.app/Contents/Frameworks/libpq.5.dylib<br>
&gt;&gt; [ dweber@elegans ~/src/kitware/VTK_build ]$<br>
&gt;&gt; }}}<br>
&gt;&gt;<br>
&gt;&gt; So, now we modify the DYLD path to find libpq and WHA-LA, the import is<br>
&gt;&gt; working!<br>
&gt;&gt;<br>
&gt;&gt; {{{<br>
&gt;&gt; [ dweber@elegans ~/src/kitware/VTK_build ]$ export<br>
&gt;&gt; DYLD_LIBRARY_PATH=/usr/local/lib/vtk-5.2:/Library/PostgreSQL/8.3/lib<br>
&gt;&gt; [ dweber@elegans ~/src/kitware/VTK_build ]$ echo $DYLD_LIBRARY_PATH<br>
&gt;&gt; /usr/local/lib/vtk-5.2:/Library/PostgreSQL/8.3/lib<br>
&gt;&gt; [ dweber@elegans ~/src/kitware/VTK_build ]$ python<br>
&gt;&gt; Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53)<br>
&gt;&gt; [GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin<br>
&gt;&gt; Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; import vtk<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt; }}}<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; I&#39;ll have to double check the default settings on DYLD path for the<br>
&gt;&gt; system. &nbsp;This is A fix on this particular system, so the problem<br>
&gt;&gt; remains for any general OSX distribution to fix this in an elegant<br>
&gt;&gt; manner. &nbsp;What would you recommend for a system-wide fix to these path<br>
&gt;&gt; settings and how would you implement this within cmake? &nbsp;(Again, I<br>
&gt;&gt; need to RTFM, it&#39;s overdue. &nbsp;I will persist with OSX.)<br>
&gt;&gt;<br>
&gt;&gt; Thanks heaps for getting me back on track with OSX! &nbsp;Power to the people<br>
&gt;&gt; ;-)<br>
&gt;&gt;<br>
&gt;&gt; Darren<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; [PS, I suppose I could remove the /Library/Frameworks/Python.framework<br>
&gt;&gt; installs to fall back on the /System/.... python installation, but it<br>
&gt;&gt; probably makes little difference apart from disk space. &nbsp;I know it&#39;s<br>
&gt;&gt; not wise to touch the /System area, so that&#39;s off limits. &nbsp;I guess the<br>
&gt;&gt; only advantage to the /Library installs from <a href="http://python.org" target="_blank">python.org</a> is to keep up<br>
&gt;&gt; with patches and new releases. &nbsp;Actually I can&#39;t decide on whether to<br>
&gt;&gt; use the binary packages direct from <a href="http://python.org" target="_blank">python.org</a> or the macports /opt<br>
&gt;&gt; installation, the latter seems to provide an option for ipython and<br>
&gt;&gt; that would be a real bonus. &nbsp;The macports install may be as close as I<br>
&gt;&gt; need to get to a source build for python. &nbsp;I&#39;ve opted to use macports<br>
&gt;&gt; rather than fink, but that may be a mistake too ;-) &nbsp;I do like the<br>
&gt;&gt; Debian package system, which is the basis for fink. &nbsp;I just don&#39;t know<br>
&gt;&gt; whether fink is keeping up with things the way that Ubuntu does; it<br>
&gt;&gt; takes the best of Debian on popular platforms. &nbsp;I&#39;ve opted for<br>
&gt;&gt; macports only because I know they will be specific to the OSX way of<br>
&gt;&gt; doing things - but why did they choose /opt/ instead of the default<br>
&gt;&gt; /usr or /usr/local path? &nbsp;Gheez.]<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Wed, Sep 3, 2008 at 10:16 AM, Prabhu Ramachandran<br>
&gt;&gt; &lt;<a href="mailto:prabhu@aero.iitb.ac.in">prabhu@aero.iitb.ac.in</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Darren Weber wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I&#39;ve discovered a minor problem with the VTK python installation (from<br>
&gt;&gt;&gt;&gt; build) on OSX. &nbsp;I&#39;m basically having library path issues and I don&#39;t<br>
&gt;&gt;&gt;&gt; know<br>
&gt;&gt;&gt;&gt; how to bend VTK build-install to fit OSX python or how to bend OSX<br>
&gt;&gt;&gt;&gt; python to<br>
&gt;&gt;&gt;&gt; use the default VTK install paths.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; [...]<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; However, despite my attempt to get the module installed in the &quot;right&quot;<br>
&gt;&gt;&gt;&gt; place, I get this traceback during the import:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; dweber@weber-mbp ~/src/kitware/VTK_build ]$ which python<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; [...]<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; ImportError:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; dlopen(/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/vtk/libvtkCommonPython.so,<br>
&gt;&gt;&gt;&gt; 10): Library not loaded: libvtkCommonPythonD.5.2.dylib<br>
&gt;&gt;&gt;&gt; Referenced from:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/vtk/libvtkCommonPython.so<br>
&gt;&gt;&gt;&gt; Reason: image not found<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; This is where the libvtkCommon* libs are at:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; /usr/local/lib/python2.5/site-packages/vtk/libvtkCommonPython.so<br>
&gt;&gt;&gt;&gt; /usr/local/lib/vtk-5.2/libvtkCommonPythonD.5.2.0.dylib<br>
&gt;&gt;&gt;&gt; /usr/local/lib/vtk-5.2/libvtkCommonPythonD.5.2.dylib<br>
&gt;&gt;&gt;&gt; /usr/local/lib/vtk-5.2/libvtkCommonPythonD.dylib<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Try this:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; export DYLD_LIBRARY_PATH=/usr/local/lib/vtk-5.2<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Then rerun Python and see if import vtk works at all.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; cheers,<br>
&gt;&gt;&gt; prabhu<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt; &nbsp;_________________________________________________<br>
&gt; | Mike Jackson - Principal Software Engineer &nbsp; &nbsp; &nbsp;|<br>
&gt; | BlueQuartz Software &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br>
&gt; | <a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br>
&gt; | <a href="http://www.bluequartz.net" target="_blank">www.bluequartz.net</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br>
&gt; ---------------------------------------------------<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
_______________________________________________<br>
</div></div><div class="Ih2E3d">vtk-developers mailing list<br>
<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a><br>
</div><a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
</blockquote></div><br></div></div>