Singular
https://www.singular.uni-kl.de/forum/

Generating image (jpeg file) using ResTree
https://www.singular.uni-kl.de/forum/viewtopic.php?f=10&t=2278
Page 1 of 1

Author:  Sham92 [ Mon Aug 19, 2013 10:44 pm ]
Post subject:  Generating image (jpeg file) using ResTree

Hi all,

I am trying to use ResTree function from resgraph library. I have already installed xv and graphviz packages (all using fink project), and both are in standard search PATH. Now, when I try to replicate the exact code given here mainsite/tutor_resol.ps (well, I am not allowed to post URLs apparently).

(namely, page 4) it is not working. To be more precise, I enter all the commands (defining the necessary ring and ideal), and when I finally type in: ResTree(re, coll[1]), the following is displayed:

sh: dot: command not found
Currently showing graphics in separate window
Press <Return> to continue

And pop-up window shows-up (from XQuartz software) saying that:

Can't open the file "Users/myusername/ResTree.dot.jpg"
No such file or directory.

When I go to the indicated folder (Users/myusername/) I did find file named "ResTree.dot" (which was generated right after I entered "ResTree(re, coll[1])" command), but it is not a JPEG file. So I think the problem is Singular is not generating the desired JPEG file for some reason.

I have been spending past 3 days trying to work this out, but to no avail. I would very much appreciate any help!

Author:  Sham92 [ Mon Aug 19, 2013 10:47 pm ]
Post subject:  Re: Generating image (jpeg file) using ResTree

I forgot to mention the operating system I am using (in case it is relevant). I am using Mac OS X (Version 10.8.4).

Author:  hannes [ Tue Aug 20, 2013 1:07 pm ]
Post subject:  Re: Generating image (jpeg file) using ResTree

To produce the jpeg file:
Code:
dot  -Tjpeg  ResTree.dot -o  ResTree.dot.jpg 

Try this in a terminal.
If it does not work, graphviz is not correctly installed (dot is a program from graphviz).
Otherwise, your PATH may be wrong:
Try within Singular:
Code:
system("sh","echo $PATH");

which should have /sw/bin in it.
Also try
Code:
system("sh","which dot");


Hope that helps

Author:  Sham92 [ Thu Aug 29, 2013 4:58 pm ]
Post subject:  Re: Generating image (jpeg file) using ResTree

Dear Hannes,

Thank you very much for your help! You were quite right that graphviz wasn't installed correctly. After getting some help from IT support from the math department, it is working now and the graphic output is produced! :)

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/