Scripting

Questions and problems about using polymake go here.
dacatanz
Posts: 2
Joined: 03 Mar 2017, 13:36

Scripting

Postby dacatanz » 03 Mar 2017, 13:42

Dear Polymake Team,

I am new to polymake and I am making some small experiments to familiarise with the software.

At present, I am struggling to make polymake execute this simple script saved as "~/Desktop/myscript.poly":

use application "Attempt";

print "Hello, World!\n";

The command that I run from the mac os shell is

/Applications/polymake.app/Contents/MacOS/polymake.start --script myscript.poly

Polymake loads properly, but nothing is printed out.

What am I doing wrong?

Thanks in advance for your help.

User avatar
gawrilow
Main Author
Posts: 423
Joined: 25 Dec 2010, 17:40

Re: Scripting

Postby gawrilow » 03 Mar 2017, 16:49

Just because there is no such application "Attempt". You should refer to one of the existing applications, e.g. "common" or "polytope".

dacatanz
Posts: 2
Joined: 03 Mar 2017, 13:36

Re: Scripting

Postby dacatanz » 03 Mar 2017, 17:09

Thank you for the answer.

if in the file myscript.poly I put the following content

use application "common";

print "Hello, World!\n";

Nothing happens. It does not change if I replace common with polytope. The command I use is

/Applications/polymake.app/Contents/MacOS/polymake.start --script myscript.poly

The output is

Blue-Noah:Desktop darkstar$ /Applications/polymake.app/Contents/MacOS/polymake.start --script myscript.poly
Welcome to polymake version 3.0
Copyright (c) 1997-2015
Ewgenij Gawrilow, Michael Joswig (TU Berlin)
http://www.polymake.org

This is free software licensed under GPL; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Press F1 or enter 'help;' for basic instructions.

Application polytope currently uses following third-party software packages:
4ti2, cdd, jreality, libnormaliz, lrs, nauty, permlib, porta, ppl, singular, sketch, sympol, threejs, tikz, tosimplex
For more details: show_credits;
polytope >

User avatar
gawrilow
Main Author
Posts: 423
Joined: 25 Dec 2010, 17:40

Re: Scripting

Postby gawrilow » 03 Mar 2017, 20:10

I'm not sure about that polymake.start, it's some wrapper specific to the mac bundle. Maybe it does not pass the command line arguments to polymake itself. Andreas should be able to explain this miracle, as he is responsible for these bundles. At any rate, the "canonical" way of working with polymake is just to open a terminal window and run it directly (must be somewhere in your unpacked disk image under .../bin/polymake), then you'll be sure which command line arguments it gets.


Return to “Helpdesk”