Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to contribute C++ binaries to SAGE

I have written several programs in C++ for algebraic computation. I think it would be nice for SAGE users to have access to them. Of course, that means writing the binding code, but that should not be an issue.

I have looked around at existing Python packaging systems and the two prominent ones are pip and conda (poetry seems used by some but does not seem great anyway):

  • pip seems fine but it has a limit of 60M on the total size. The problem is that the compilation can be long and I would like to submit the šackage as wheel, that is precompiled binaries. And each precompiled binary is about 20M.

  • Conda has a tendency to force you to use conda for everything.

The C++ code is available at https://github.com/MathieuDutSik/polyhedral_common (Academic references for the algorithm being implemented are available https://mathieudutsik.github.io/Publications/index.html) There are many functions, but the ones that could be of interest for SAGE users:

  • Canonical form of positive definite matrices.

  • Dual description of polytopes using symmetries

  • Copositive programming

  • Isotropic vectors of rational quadratic forms.

  • Computation of Delaunay polytopes of a lattice.

  • Test of equivalence (with an explicit one if existing) and computation of automorphism group of indefinite rational quadratic forms.

The dependencies of the code are:

  • Boost and Eigen.

  • Nauty. Is Nauty an issue for SAGE? This is not completely open source. If a problem, I can use the bliss software which is less performant but fully open source.

I am using Makefile now, but I can easily create a CMakeLists.txt to provide a compilation environment (Dimitri Pasechnik mentioned this). The compilation takes about 40 minutes to compile the whole software.

Please let me know what is the path forward for the inclusion of the software in SAGE.

PS: I asked last year about that very question, but I was not yet ready and some problems can take a long time to resolve.