Hi,

I had a mini-vacation and I spent a while trying to get sage working 
with VTK on a Macbook.  The machine is somewhat slow and experimenting 
takes a long while.  I've managed to get VTK built with Sage but 
required a framework build.  Here are the details.

I've been using sage-3.4 (since thats what I had with me). I have a 
fresh sage (3.4) install where I installed cmake from Jaap's package here:

  http://sage.math.washington.edu/home/jsp/SPKGS/MayaviOSMesa/

I then got 
http://sage.math.washington.edu/home/jsp/SPKGS/MayaviOSMesa/vtk-cvs-20090316osmesa.spkg

and changed the spkg-install so it builds on the Mac.

I first tried building VTK with the existing sage python build but kept 
running into build errors with VTK unable to find several Python 
symbols.  I configured VTK to build with the libpython2.5.a but that 
failed to build with link errors that I forgot to note down (I must have 
tried 10 different things trying to get this going).  After various 
failed attempts I finally decided to change the way sage builds its 
Python and added:

  --enable-framework="$SAGE_LOCAL/Frameworks"

to the configure command in the spkg-install of python-2.5.2.p9 that 
ships with sage-3.4.  This built successfully.  I basically untarred the 
standard spkg, changed the spkg-install suitably and ran it within a 
sage -sh session.  I then built VTK with the following configuration for 
cmake:
 
-DPYTHON_EXECUTABLE:FILEPATH=$SAGE_LOCAL/Frameworks/Python.framework/Versions/2.5/bin/python\
 
 
-DPYTHON_INCLUDE_PATH:PATH=$SAGE_LOCAL/Frameworks/Python.framework/Headers\
-DPYTHON_LIBRARY:FILEPATH=$SAGE_LOCAL/Frameworks/Python.framework/Versions/2.5/Python\
-DVTK_USE_CARBON:BOOL=ON

This built VTK perfectly.

I initially ran into problems like so:

sage: import vtk
Fatal Python error: Interpreter not initialized (version mismatch?)
$SAGE_LOCAL/bin/sage-sage: line 205:  1407 Abort trap 
sage-ipython "$@" -i

But figured that my existing builds were confusing matters and once I 
moved that old build out of the way, everything worked great.  I was 
able to do this:

sage: import vtk
sage: c = vtk.vtkConeSource()
[...]

I have the following questions:

  1. Why isn't --enable-framework turned on by default for the sage 
python build on the Mac?  If this isn't a hassle can you please consider 
making this the default?

  2. What else would it take to get the VTK package to optional quality?

Thanks!

cheers,
prabhu

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to