I spent last couple days figuring out how to get mayavi2 installed
into Sage, using offscreen rendering (e.g. so that you can use mayavi
from ipython over ssh, without X), so that it can be used in the
notebook easily. It was a lot of pain, so here is the howto so that
you can build on my work:
64bit
-----
wget http://sage.math.washington.edu/home/ondrej/spkg/mesa-7.2.spkg
wget http://sage.math.washington.edu/home/ondrej/spkg/vtk-cvs.spkg
wget http://sage.math.washington.edu/home/ondrej/spkg/reportlab-2.2.spkg
wget http://sage.math.washington.edu/home/ondrej/spkg/swig-1.3.31.spkg
wget http://sage.math.washington.edu/home/ondrej/spkg/wxPython-2.8.9.1.spkg
wget http://sage.math.washington.edu/home/ondrej/spkg/ets-3.1.1.rev23061.spkg
wget http://sage.math.washington.edu/home/ondrej/spkg/mayavi_install
export MAKE="make -j10"
bash mayavi_install
32bit
-----
Instead of mesa-7.2, use:
wget http://sage.math.washington.edu/home/ondrej/spkg/mesa32bit-7.2.spkg
Notes:
* I suggest you look into the mayavi_install script and execute the
commands in there by hand. If some of them fail, install the missing
libs --- but I tested it on several computers (and both 32bit and
64bit archs) in clean sage 3.2.3 and it seems to work, but you may
need some X dev libs installed
* the mesa.spkg has a different install script for 32 and 64 bits, so
just use the correct spkg for your arch. any help in merging the two
packages is greately appreciated
* the ets package will *not* install without a net connection. I learn
this the hard way, by downloading all the stuff, going to a
presentation and then realizing, I can't install ets if I am not
connected to the net, as it tries and needs to download something from
the net. Well, you don't want to know what I was saying at the time.
:)
* this still needs lots of polishing, but it gets the job done already
This would not be possible without Prabhu and Gael, who both fixed
things almost immediatelly after I reported them, thanks a lot! And
thanks also to Jaap, who have helped me a lot over IRC and prepared
the original packages that I just customized to work offscreen using
Prabhu tips, thanks Jaap, it helped me a lot.
Ondrej
Yep, that be awesome. I am just starting to use the Sage notebook for
my things, but my advisor is very excited about the possibilities and
I expect we will do much work on this in the future. Right now I am
just putting all the tools together and trying things. Btw, here is my
first blogpost with very short videos of some regular people on the
scipy/sage/mpl lists. :)
http://ondrejcertik.blogspot.com/2009/03/siam-2009-conference-in-miami-part-i.html
Ondrej
Thats very cool Ondrej! Thanks. With more work, we could either write a
VTK to Pmesh exporter for jmol or add javascript to animate the view
to some extent. Unfortunately, I don't have the time for this ATM. This
would be awesome so if someone has the time and is interested I'd be
happy to help and offer pointers. If there are things we can do in
mayavi to help make this easier, Gael and I will be happy to add them in
the code.
cheers,
prabhu
Ok, here is a proof, that it works in the notebook:
http://nb.hpfem.org/home/pub/12/
The error messages are very annoying though. Prabhu, do you know how
to fix it? But it works, that's the most important.
Ondrej
Ok, I fixed that by commenting the warning messages in the C++ file
and reuploaded the spkg package. Well. :)
Anyway, now it looks good:
http://nb.hpfem.org/home/pub/12/
Ondrej
Right, thats the way to do it for now. I'll try and get this into VTK
cvs in the weekend, might take me a bit since I'm behind on several things.
> Anyway, now it looks good:
>
> http://nb.hpfem.org/home/pub/12/
Unfortunately, it renders the html as text/plain for me with Firefox, so
I just see the text. :(
cheers,
prabhu
Answering myself, I added the force HTML bookmarklet that fixes the problem:
http://www.howtocreate.co.uk/bookmarklets.html
After I do that it works fine. However, it might be nice to fix this be
default by changing the content type response?
cheers,
prabhu
That's weird, it works for me and I also use firefox. Do you know how
I can reproduce the problem?
Ondrej
Unfortunately, I have no idea. I am running Firefox 3.0.3 on Ubuntu 8.04.
cheers,
prabhu
This is a known issue (at least the general issue). See
http://trac.sagemath.org/sage_trac/ticket/4547 for a patch that is
awaiting someone to review a fix for the general issue.
Jason
Some questions:
1) Do you need more than just mayavi2 from the ETS? If you only need mayavi2
there are a lot less dependencies: only vtk and wxPython IIRC.
2) Why do you need vtk-cvs (vtk-5.3)? Is vtk-5.2.1 failing somehow?
3) Why do you install your own osmesa? Can't you trust a standard system
wide install?
Cheers,
Jaap
> Ondrej
In addition, you can install mayavi2 without any dependency on Envisage
or the traits UI backends (i.e. no wxPython + TraitsBackendWX
+Envisage*) -- the trouble in that approach is that you will only get
the offscreen capabilities and none of the UI goodies even if you want
them for some reason outside a notebook. But I would imagine this is a
useful case for some. The way to get that with standard Python is to
simply do: easy_install Mayavi. This should only pull in the basic
package. If you do easy_install Mayavi[app], it pulls in the other
components for the UI/app.
> 2) Why do you need vtk-cvs (vtk-5.3)? Is vtk-5.2.1 failing somehow?
I guess 5.2.1 would work but I did the experimentation with the build on
VTK cvs which is what I had handy. Ondrej also commented out a few
warning lines in his spkg. I'll try and get that into VTK cvs before
5.4 is released (CVS is currently frozen).
> 3) Why do you install your own osmesa? Can't you trust a standard system
> wide install?
Simply because it did not work for some reason. I suspect that the
standard system wide install builds with dri and that for some currently
unfathomable reason does not work cleanly with osmesa -- instead
bundling your own mesa+osmesa almost always works.
Overall, if there is a user base for the full UI and the offscreen,
perhaps two separate bundles might be useful.
cheers,
prabhu