polymake wrapper

107 views
Skip to first unread message

Burcin Erocal

unread,
Sep 5, 2011, 9:58:05 PM9/5/11
to sage-...@googlegroups.com
Hi,

I just uploaded a prototype python wrapper for the new library
interface to polymake on bitbucket:

https://bitbucket.org/burcin/pypolymake

The docstrings in polymake.pyx contain examples of what is possible
right now:

https://bitbucket.org/burcin/pypolymake/src/tip/polymake.pyx#cl-105


The wrapper looks much uglier than it should be. I wanted to use the
C++ support in Cython. Unfortunately, I couldn't get many things
working with the Cython version in Sage (0.14). I didn't try installing
the latest version of Cython (0.15).

Getting the wrapper working, that is, installing Sage, polymake and the
wrapper properly is a major hassle. There are instructions below
describing how I set up my testing environment within Sage.


A few remarks:

- The latest polymake version (2.10) doesn't build with the partial
boost install that comes with Sage. I just used a package I had
from a prerelease.

- Embedding perl in a python module is quite an adventure. Perl needs
the RTLD_GLOBAL flag to be set so that the modules it loads can find
symbols from the main (perl) library. However, modifying dlopenflags
with sys.setdlopenflags() doesn't help (at least on my machine).
It seems that adding the polymake library to LD_PRELOAD is the only
solution for now.


Installation instructions:

- get a recent Sage version (we won't apply any patches to Sage)

- Update the MPFI and MPFR versions in Sage

./sage -i
http://sage.math.washington.edu/home/burcin/polymake/mpfi-1.5.spkg

./sage -i
http://sage.math.washington.edu/home/burcin/polymake/mpfr-3.0.0.spkg

- Rebuild MPIR:

./sage -f spkg/standard/mpir-1.2.2.p2.spkg

- Install (old) polymake:

http://sage.math.washington.edu/home/burcin/polymake/polymake-2.9.10.p0.spkg

- rebuild (part of) Sage library so that it works with the updates

./sage -b

- go to $SAGE_ROOT/local/bin and apply attached sage-env.patch

cd local/bin
hg qimport sage-env.patch
hg qpush

- Clone the wrapper

hg clone https://bitbucket.org/burcin/pypolymake

- Start a sage shell, go into the wrapper directory and install

./sage -sh
cd <wrapper_dir>
python setup.py install

- Preferably on a different shell, start sage and enjoy


Comments & suggestions welcome.


Cheers,
Burcin

leif

unread,
Sep 5, 2011, 10:34:47 PM9/5/11
to sage-devel
On 6 Sep., 03:58, Burcin Erocal <bur...@erocal.org> wrote:
> The wrapper looks much uglier than it should be. I wanted to use the
> C++ support in Cython. Unfortunately, I couldn't get many things
> working with the Cython version in Sage (0.14). I didn't try installing
> the latest version of Cython (0.15).

See #11761, currently needing review... ;-)


-leif

jplab

unread,
Nov 3, 2011, 5:50:26 AM11/3/11
to sage-devel
Hi,

This is just to connect discussions. Here is the link to pypolymake
discussion on the forum of polymake:

http://forum.polymake.org/viewtopic.php?f=9&t=178

Cheers,
J-P
Reply all
Reply to author
Forward
0 new messages