I have a Mathematica installation on a Linux server that is intended to be used for batch processing. Some of the things that will be processed will include rendering of graphics. However, if I use Export["/file/name.gif", graphicsobject]
, Mathematica wants to connect to an X server.
Yes, I can run Xvfb or similar, but this seems like inordinate overkill. Is this really the only option? Is there no way to get Mathematica to render to GIF (or PNG, or BMP, or TIFF, or whatever; I don't really care) without having an X server running?
Update:
I just ran this small program without an X server available:
s=Graphics[Sphere[]];
Do[
Print[fmt];
TimeConstrained[
Export["/tmp/img-"<>fmt, s, fmt],
10, Print["Timeout"] ],
{fmt, $ExportFormats} ]
and found that the only files created that contained something other than just the text Graphics[Sphere[0, 0, 0]]
or -Graphics-
were DXF and JVX, both of which were very simple renderings without axes or labels or anything once anything remotely more complex was rendered.
Answer
I got this response from Wolfram support:
I understand you are wondering whether an X server is required to export to graphics files.
The answer is yes. Exporting to a raster format requires the front end, which in turn must be able to connect to an X server. You can accomplish this using X forwarding if you already have an X server working, or you can try setting up a virtual X server like Xvnc.
Comments
Post a Comment