[vtkusers] VTK & Python on MacOS X: Local vs. system installation]
Tom Bridgman
bridgman at wyeth.gsfc.nasa.gov
Wed Sep 24 11:27:53 EDT 2003
Yves,
Setting DYLD_LIBRARY_PATH seems to work!!
Here is a DRAFT of my 'distilled' recipe for installing VTK under MacOS
X. I can wipe VTK and try this on my home system, hopefully this
evening. Need to look closer at if copying the .dylib files is
necessary.
Please comment where necessary.
Thanks,
Tom
((((( DRAFT )))))
=================================
Prerequisites:
¥ MacOX X 10.2.6
¥ MacPython v2.3
¥ Installed Tkinter via PackageManager
¥ gcc 3.1 (Apple Developer Tools, December 2002)
¥ Need recent AquaTclTk 8.4+ in /Library/Frameworks/
¥ CMake v1.8.1
% gnutar xvzf vtkNightlySrc.tgz
% gnutar xvzf vtkNightlyData.tar.gz
% cd VTK
% cmake -i
# use Advanced settings to get to these:
BUILD_TESTING=OFF
CMAKE_SKIP_RPATH=ON
BUILD_EXAMPLES=ON # doens't *need* to be on, but if you're learning VTK,
why not?
BUILD_SHARED_LIBS=ON
CMAKE_INSTALL_PREFIX=/usr/local/ # not normally created under MacOS X:
sudo mkdir /usr/local/
VTK_DATA_ROOT=(path where VTKData.readme can be found)
VTK_USE_CARBON=ON
VTK_USE_COCOA=OFF
VTK_USE_HYBRID=ON
VTK_USE_PARALLEL=OFF # 'ON' doesn't seem to build, even on a
multi-processor machine
VTK_USE_X=OFF
VTK_WRAP_JAVA=OFF
# need both of these if you want Python wrappers
VTK_WRAP_PYTHON=ON
VTK_WRAP_TCL=ON
# updates CMakeLists.txt file, then continues to prompt
# CMake should find Tcl/Tk headers & set for framework builds so you
should just be able
# to accept the default values at this point.
% make
# make takes a *really* long time...
# ~140 minutes on a Dual 450MHz G4
# ~ 60 minutes on 933MHz G4
What is the significance of this class of message generated during make:
"ld: warning dynamic shared library:
/System/Library/Frameworks/AppKit.framework/AppKit not made a weak
library in output with MACOSX_DEPLOYMENT_TARGET environment variable set
to: 10.1"
If completes w/o errors, you should be able to run python demos like
% ./bin/vtkpython Examples/Medical/Python/Medical3.py # This takes a
while to load since it is a complex dataset.
If this doesn't work because it can't find the data file:
% setenv VTK_DATA_ROOT (path where VTKData.readme can be found)
and try again.
# You can stop at this point and just use the build generated in this
local directory. However, if you
# want others using the machine to have access to it, you need to
install this system-wide.
To install system-wide:
% sudo make install
% cd Wrapping/Python
% sudo python setup.py install # make sure you're using Python v2.3
Only *.so files are in
/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/vtk_python
so
% cp VTK/bin/*.dylib
/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/vtk_python
Add /usr/local/lib/vtk to PYTHONPATH, LD_LIBRARY_PATH,
DYLD_LIBRARY_PATH
% cd
% pythonw Development/VTK/Examples/Medical/Python/Medical3.py
THIS SEEMS TO WORK!!
--
Dr. William T."Tom" Bridgman Scientific Visualization Studio
Global Science & Technology, Inc. NASA/Goddard Space Flight Center
Email: bridgman at wyeth.gsfc.nasa.gov Code 935
Phone: 301-286-1346 Greenbelt, MD 20771
FAX: TBD http://svs.gsfc.nasa.gov/
More information about the vtkusers
mailing list