Ask Your Question

Revision history [back]

Problem installing surface_dynamics package

I am using Sagemath on my Pixelbook using the Linux terminal. I was able to successfully install sagemath using get-apt install sagemath. I am now trying to install the surface_dynamics package and am running into an error. In the sage shell, I am running the following two commands, (as described on the package installation instructions):

source /usr/share/sagemath/bin/sage-env
pip install surface_dynamics --user

When I do this, I get the following error:

surface_dynamics/flat_surfaces/origamis/origami_dense.c:457:35: fatal error: sage/libs/ntl/ntlwrap.h: No such file or directory
 #include "sage/libs/ntl/ntlwrap.h"
                                   ^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

I am quite confused as to why I am getting this error because if I go to the /usr/lib/python2.7/dist-packages/sage/libs/ntl directory, the file does exist. Any suggestions as to what is going wrong here would be greatly appreciated.


Update: I installed cython, and now I am getting a different error when I run pip install surface_dynamics --user:

warning: /usr/lib/python2.7/dist-packages/sage/libs/gmp/types.pxd:15:4: 'mp_limb_t' redeclared

Error compiling Cython file:
------------------------------------------------------------
...
#*****************************************************************************

cimport sage.structure.category_object
from sage.structure.coerce_dict cimport MonoDict, TripleDict

cdef class Parent(category_object.CategoryObject):
                                ^
------------------------------------------------------------

/usr/lib/python2.7/dist-packages/sage/structure/parent.pxd:12:33: First base of 'Parent' is not an extension type
Adding extension surface_dynamics.flat_surfaces.origamis.origami_dense:
  sources = ['origami_dense.pyx', 'normal_form.c', 'lyapunov_exponents.c']
  headers = ['origami_dense.pxd', 'lyapunov_exponents.h', 'normal_form.h']
Adding extension surface_dynamics.interval_exchanges.integer_iet:
  sources = ['integer_iet.pyx', 'int_iet.c', 'int_vector.c']
  headers = ['integer_iet.pxd', 'int_iet.h']
Adding extension surface_dynamics.interval_exchanges.lyapunov_exponents:
  sources = ['lyapunov_exponents.pyx', 'generalized_permutation.c', 'lin_alg.c', 'quad_cover.c', 'random.c', 'permutation.c']
  headers = ['lyapunov_exponents.h']
Compiling surface_dynamics/flat_surfaces/origamis/origami_dense.pyx because it changed.
Compiling surface_dynamics/interval_exchanges/integer_iet.pyx because it changed.
Compiling surface_dynamics/interval_exchanges/lyapunov_exponents.pyx because it changed.
[1/3] Cythonizing surface_dynamics/flat_surfaces/origamis/origami_dense.pyx
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-build-vUqyYH/surface-dynamics/setup.py", line 112, in <module>
    ext_modules=cythonize(extensions),
  File "/home/marissaelena34/.local/lib/python2.7/site-packages/Cython/Build/Dependencies.py", line 1102, in cythonize
    cythonize_one(*args)
  File "/home/marissaelena34/.local/lib/python2.7/site-packages/Cython/Build/Dependencies.py", line 1225, in cythonize_one
    raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: surface_dynamics/flat_surfaces/origamis/origami_dense.pyx

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-vUqyYH/surface-dynamics/