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:
* 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.
<pra...@aero.iitb.ac.in> wrote: > On 03/06/09 09:40, Ondrej Certik wrote: >> Hi,
>> 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:
> [...]
> 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.
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. :)
> 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:
[...]
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.
On Thu, Mar 5, 2009 at 11:10 PM, Ondrej Certik <ond...@certik.cz> wrote: > Hi,
> 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
Ok, here is a proof, that it works in the notebook:
On Fri, Mar 6, 2009 at 12:53 AM, Ondrej Certik <ond...@certik.cz> wrote: > On Thu, Mar 5, 2009 at 11:10 PM, Ondrej Certik <ond...@certik.cz> wrote: >> Hi,
>> 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
> Ok, here is a proof, that it works in the notebook:
> On 03/06/09 12:14, Ondrej Certik wrote: >>> The error messages are very annoying though. Prabhu, do you know how >>> to fix it? But it works, that's the most important. >> Ok, I fixed that by commenting the warning messages in the C++ file >> and reuploaded the spkg package. Well. :)
> 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.
> On 03/06/09 12:45, Prabhu Ramachandran wrote: >> On 03/06/09 12:14, Ondrej Certik wrote: >>>> The error messages are very annoying though. Prabhu, do you know how >>>> to fix it? But it works, that's the most important. >>> Ok, I fixed that by commenting the warning messages in the C++ file >>> and reuploaded the spkg package. Well. :)
>> 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.
Prabhu Ramachandran wrote: > On 03/06/09 13:18, Ondrej Certik wrote: >>> After I do that it works fine. However, it might be nice to fix this be >>> default by changing the content type response? >> That's weird, it works for me and I also use firefox. Do you know how >> I can reproduce the problem?
> Unfortunately, I have no idea. I am running Firefox 3.0.3 on Ubuntu 8.04.
> 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: [...]
> 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.
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?
> 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.
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.