-
Notifications
You must be signed in to change notification settings - Fork 19
Description
I have successfully installed SageMath 10.5 using a disk image as mentioned here.
However, when trying to install this version of the package surface_dynamics via sage -pip install surface_dynamics, I encountered an error.
Any help would be greatly appreciated!
System Information
- MacBook Pro 2017, Intel Core 5, macOS Big Sur Version 11.6.2
- Xcode version 13.2
- Clang version: Apple clang version 13.0.0 (clang-1300.0.29.30) Target: x86_64-apple-darwin20.6.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin
The full command error is
sage -pip install surface_dynamics
Collecting surface_dynamics
Using cached surface_dynamics-0.7.0.tar.gz (8.4 MB)
Installing build dependencies ... error
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [105 lines of output]
Collecting setuptools>=42
Using cached setuptools-75.8.0-py3-none-any.whl.metadata (6.7 kB)
Collecting wheel
Using cached wheel-0.45.1-py3-none-any.whl.metadata (2.3 kB)
Collecting Cython
Using cached Cython-3.0.12-cp312-cp312-macosx_10_9_x86_64.whl.metadata (3.5 kB)
Collecting numpy
Using cached numpy-2.2.3-cp312-cp312-macosx_10_13_x86_64.whl.metadata (62 kB)
Collecting cypari2
Using cached cypari2-2.2.1.tar.gz (127 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting cysignals>=1.11.3 (from cypari2)
Using cached cysignals-1.12.3-cp312-cp312-macosx_10_9_x86_64.whl.metadata (12 kB)
Using cached setuptools-75.8.0-py3-none-any.whl (1.2 MB)
Using cached wheel-0.45.1-py3-none-any.whl (72 kB)
Using cached Cython-3.0.12-cp312-cp312-macosx_10_9_x86_64.whl (3.3 MB)
Using cached numpy-2.2.3-cp312-cp312-macosx_10_13_x86_64.whl (20.9 MB)
Using cached cysignals-1.12.3-cp312-cp312-macosx_10_9_x86_64.whl (221 kB)
Building wheels for collected packages: cypari2
Building wheel for cypari2 (pyproject.toml): started
Building wheel for cypari2 (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error
× Building wheel for cypari2 (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [68 lines of output]
running bdist_wheel
running build
running build_py
creating build/lib.macosx-10.12-x86_64-cpython-312/cypari2
copying cypari2/__init__.py -> build/lib.macosx-10.12-x86_64-cpython-312/cypari2
running egg_info
writing cypari2.egg-info/PKG-INFO
writing dependency_links to cypari2.egg-info/dependency_links.txt
writing requirements to cypari2.egg-info/requires.txt
writing top-level names to cypari2.egg-info/top_level.txt
reading manifest file 'cypari2.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*.c' found anywhere in distribution
warning: no previously-included files matching '.gitignore' found anywhere in distribution
warning: no previously-included files matching 'readthedocs*' found anywhere in distribution
warning: no previously-included files matching '.install-pari.sh' found anywhere in distribution
no previously-included directories found matching '.github'
no previously-included directories found matching 'dist'
adding license file 'LICENSE'
writing manifest file 'cypari2.egg-info/SOURCES.txt'
copying cypari2/closure.pxd -> build/lib.macosx-10.12-x86_64-cpython-312/cypari2
copying cypari2/closure.pyx -> build/lib.macosx-10.12-x86_64-cpython-312/cypari2
copying cypari2/convert.pxd -> build/lib.macosx-10.12-x86_64-cpython-312/cypari2
copying cypari2/convert.pyx -> build/lib.macosx-10.12-x86_64-cpython-312/cypari2
copying cypari2/custom_block.pyx -> build/lib.macosx-10.12-x86_64-cpython-312/cypari2
copying cypari2/cypari.h -> build/lib.macosx-10.12-x86_64-cpython-312/cypari2
copying cypari2/gen.pxd -> build/lib.macosx-10.12-x86_64-cpython-312/cypari2
copying cypari2/gen.pyx -> build/lib.macosx-10.12-x86_64-cpython-312/cypari2
copying cypari2/handle_error.pxd -> build/lib.macosx-10.12-x86_64-cpython-312/cypari2
copying cypari2/handle_error.pyx -> build/lib.macosx-10.12-x86_64-cpython-312/cypari2
copying cypari2/pari_instance.pxd -> build/lib.macosx-10.12-x86_64-cpython-312/cypari2
copying cypari2/pari_instance.pyx -> build/lib.macosx-10.12-x86_64-cpython-312/cypari2
copying cypari2/paridecl.pxd -> build/lib.macosx-10.12-x86_64-cpython-312/cypari2
copying cypari2/paripriv.pxd -> build/lib.macosx-10.12-x86_64-cpython-312/cypari2
copying cypari2/pycore_long.h -> build/lib.macosx-10.12-x86_64-cpython-312/cypari2
copying cypari2/pycore_long.pxd -> build/lib.macosx-10.12-x86_64-cpython-312/cypari2
copying cypari2/stack.pxd -> build/lib.macosx-10.12-x86_64-cpython-312/cypari2
copying cypari2/stack.pyx -> build/lib.macosx-10.12-x86_64-cpython-312/cypari2
copying cypari2/string_utils.pxd -> build/lib.macosx-10.12-x86_64-cpython-312/cypari2
copying cypari2/string_utils.pyx -> build/lib.macosx-10.12-x86_64-cpython-312/cypari2
copying cypari2/types.pxd -> build/lib.macosx-10.12-x86_64-cpython-312/cypari2
copying cypari2/auto_paridecl.pxd -> build/lib.macosx-10.12-x86_64-cpython-312/cypari2
running build_ext
warning: cypari2/pari_instance.pyx:559:8: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
warning: cypari2/pari_instance.pyx:1391:0: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
Compiling cypari2/closure.pyx because it changed.
Compiling cypari2/convert.pyx because it changed.
Compiling cypari2/custom_block.pyx because it changed.
Compiling cypari2/gen.pyx because it changed.
Compiling cypari2/handle_error.pyx because it changed.
Compiling cypari2/pari_instance.pyx because it changed.
Compiling cypari2/stack.pyx because it changed.
Compiling cypari2/string_utils.pyx because it changed.
[1/8] Cythonizing cypari2/closure.pyx
[2/8] Cythonizing cypari2/convert.pyx
[3/8] Cythonizing cypari2/custom_block.pyx
[4/8] Cythonizing cypari2/gen.pyx
[5/8] Cythonizing cypari2/handle_error.pyx
[6/8] Cythonizing cypari2/pari_instance.pyx
[7/8] Cythonizing cypari2/stack.pyx
[8/8] Cythonizing cypari2/string_utils.pyx
building 'cypari2.closure' extension
creating build/temp.macosx-10.12-x86_64-cpython-312/cypari2
gcc -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall -Wno-unused -O2 -mmacosx-version-min=10.12 -mno-avx2 -mno-bmi2 -Icypari2 -I/private/var/folders/00/tlkkn7td1x523hnnlpc_cbj80000gn/T/pip-build-env-e_3k0chf/overlay/lib/python3.12/site-packages/cysignals -I/private/var/tmp/sage-10.5-current/local/include -I/private/var/tmp/sage-10.5-current/local/var/lib/sage/venv-python3.12.5/include/python3.12 -c cypari2/closure.c -o build/temp.macosx-10.12-x86_64-cpython-312/cypari2/closure.o
gcc -bundle -undefined dynamic_lookup -L/private/var/tmp/sage-10.5-current/local/lib -L/private/var/tmp/sage-10.5-current/local/lib -ld_classic -Wl,-platform_version,macos,10.12,11.3 -L/private/var/tmp/sage-10.5-current/local/lib -L/private/var/tmp/sage-10.5-current/local/var/lib/sage/venv-python3.12.5/lib -L/private/var/tmp/sage-10.5-current/local/lib -L/private/var/tmp/sage-10.5-current/local/lib -ld_classic -Wl,-platform_version,macos,10.12,11.3 build/temp.macosx-10.12-x86_64-cpython-312/cypari2/closure.o -L/private/var/tmp/sage-10.5-current/local/lib -L/private/var/tmp/sage-10.5-current/local/lib64 -L/private/var/tmp/sage-10.5-current/local/var/lib/sage/venv-python3.12.5/lib -lgmp -lpari -o build/lib.macosx-10.12-x86_64-cpython-312/cypari2/closure.cpython-312-darwin.so
ld: library not found for -ld_classic
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for cypari2
Failed to build cypari2
ERROR: Failed to build installable wheels for some pyproject.toml based projects (cypari2)
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.Using the flags CC=clang, CXX=clang++ does not solve the problem.
This is Issue #115 for surface_dynamics.
After discussing with @videlec, we decided to try to install the package without installing the build dependency of cypari2.
For this I cloned the package via git clone https://github.com/flatsurf/surface-dynamics and replaced the second line
requires = ["setuptools>=42", "wheel", "Cython", "numpy", "cypari2"] in the file pyproject.toml by the line
requires = ["setuptools>=42", "wheel", "Cython", "numpy"], then installed the package via sage -pip install surface-dynamics/.
After this I no longer received an error for cypari2, however the command cimport did not find the .pxd files and also I received the warning pplpy not installed. Will not compile iet_family from setup.py, even though ppl and pplpy are installed.
The full command error at this point is is
sage -pip install surface-dynamics/
Processing ./surface-dynamics
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [332 lines of output]
Warning: pplpy not installed. Will not compile iet_family.
Error compiling Cython file:
------------------------------------------------------------
...
# Otherwise we end up with the strange error
# sage: from .origami import Origami
# Traceback (most recent call last):
# ...
# AttributeError: 'module' object has no attribute 'ModuleElementWithMutability'
cimport sage.structure.element
^
------------------------------------------------------------
surface_dynamics/flat_surfaces/origamis/origami_dense.pyx:41:8: 'sage/structure/element.pxd' not found
Error compiling Cython file:
------------------------------------------------------------
...
# Traceback (most recent call last):
# ...
# AttributeError: 'module' object has no attribute 'ModuleElementWithMutability'
cimport sage.structure.element
from sage.rings.integer cimport Integer, smallInteger
^
------------------------------------------------------------
surface_dynamics/flat_surfaces/origamis/origami_dense.pyx:43:0: 'sage/rings/integer.pxd' not found
Error compiling Cython file:
------------------------------------------------------------
...
# Traceback (most recent call last):
# ...
# AttributeError: 'module' object has no attribute 'ModuleElementWithMutability'
cimport sage.structure.element
from sage.rings.integer cimport Integer, smallInteger
^
------------------------------------------------------------
surface_dynamics/flat_surfaces/origamis/origami_dense.pyx:43:0: 'sage/rings/integer/Integer.pxd' not found
Error compiling Cython file:
------------------------------------------------------------
...
# Traceback (most recent call last):
# ...
# AttributeError: 'module' object has no attribute 'ModuleElementWithMutability'
cimport sage.structure.element
from sage.rings.integer cimport Integer, smallInteger
^
------------------------------------------------------------
surface_dynamics/flat_surfaces/origamis/origami_dense.pyx:43:0: 'sage/rings/integer/smallInteger.pxd' not found
Error compiling Cython file:
------------------------------------------------------------
...
sage: lattice(sum(((m * b2).rows() for m in matrices), []))
(2, 1, 1)
sage: lattice(sum(((m * b3).rows() for m in matrices), []))
(2, 1, 3)
"""
cdef Integer zero = smallInteger(0)
^
------------------------------------------------------------
surface_dynamics/flat_surfaces/origamis/origami_dense.pyx:163:9: 'Integer' is not a type identifier
Error compiling Cython file:
------------------------------------------------------------
...
(2, 1, 1)
sage: lattice(sum(((m * b3).rows() for m in matrices), []))
(2, 1, 3)
"""
cdef Integer zero = smallInteger(0)
cdef Integer one = smallInteger(1)
^
------------------------------------------------------------
surface_dynamics/flat_surfaces/origamis/origami_dense.pyx:164:9: 'Integer' is not a type identifier
Error compiling Cython file:
------------------------------------------------------------
...
sage: lattice(sum(((m * b3).rows() for m in matrices), []))
(2, 1, 3)
"""
cdef Integer zero = smallInteger(0)
cdef Integer one = smallInteger(1)
cdef Integer a, m
^
------------------------------------------------------------
surface_dynamics/flat_surfaces/origamis/origami_dense.pyx:165:9: 'Integer' is not a type identifier
Error compiling Cython file:
------------------------------------------------------------
...
sage: lattice(sum(((m * b2).rows() for m in matrices), []))
(2, 1, 1)
sage: lattice(sum(((m * b3).rows() for m in matrices), []))
(2, 1, 3)
"""
cdef Integer zero = smallInteger(0)
^
------------------------------------------------------------
surface_dynamics/flat_surfaces/origamis/origami_dense.pyx:163:24: 'smallInteger' is not a constant, variable or function identifier
Error compiling Cython file:
------------------------------------------------------------
...
(2, 1, 1)
sage: lattice(sum(((m * b3).rows() for m in matrices), []))
(2, 1, 3)
"""
cdef Integer zero = smallInteger(0)
cdef Integer one = smallInteger(1)
^
------------------------------------------------------------
surface_dynamics/flat_surfaces/origamis/origami_dense.pyx:164:23: 'smallInteger' is not a constant, variable or function identifier
Error compiling Cython file:
------------------------------------------------------------
...
# Clean the list w of vectors and remove the (0, 0) entries,
# at the same time looking for vectors of the form (a, 0).
a = zero
i = 0
while i < len(w):
if not isinstance(w[i][0], Integer) or not isinstance(w[i][1], Integer):
^
------------------------------------------------------------
surface_dynamics/flat_surfaces/origamis/origami_dense.pyx:179:35: 'Integer' is not a constant, variable or function identifier
Error compiling Cython file:
------------------------------------------------------------
...
# Clean the list w of vectors and remove the (0, 0) entries,
# at the same time looking for vectors of the form (a, 0).
a = zero
i = 0
while i < len(w):
if not isinstance(w[i][0], Integer) or not isinstance(w[i][1], Integer):
^
------------------------------------------------------------
surface_dynamics/flat_surfaces/origamis/origami_dense.pyx:179:71: 'Integer' is not a constant, variable or function identifier
Error compiling Cython file:
------------------------------------------------------------
...
# at the same time looking for vectors of the form (a, 0).
a = zero
i = 0
while i < len(w):
if not isinstance(w[i][0], Integer) or not isinstance(w[i][1], Integer):
w[i] = (Integer(w[i][0]), Integer(w[i][1]))
^
------------------------------------------------------------
surface_dynamics/flat_surfaces/origamis/origami_dense.pyx:180:20: 'Integer' is not a constant, variable or function identifier
Error compiling Cython file:
------------------------------------------------------------
...
# at the same time looking for vectors of the form (a, 0).
a = zero
i = 0
while i < len(w):
if not isinstance(w[i][0], Integer) or not isinstance(w[i][1], Integer):
w[i] = (Integer(w[i][0]), Integer(w[i][1]))
^
------------------------------------------------------------
surface_dynamics/flat_surfaces/origamis/origami_dense.pyx:180:38: 'Integer' is not a constant, variable or function identifier
Error compiling Cython file:
------------------------------------------------------------
...
h = 1
i = u[i]
while seen[i] == 0:
i = u[i]
h += 1
wh[j] = (smallInteger(w), smallInteger(h))
^
------------------------------------------------------------
surface_dynamics/flat_surfaces/origamis/origami_dense.pyx:844:21: 'smallInteger' is not a constant, variable or function identifier
Error compiling Cython file:
------------------------------------------------------------
...
h = 1
i = u[i]
while seen[i] == 0:
i = u[i]
h += 1
wh[j] = (smallInteger(w), smallInteger(h))
^
------------------------------------------------------------
surface_dynamics/flat_surfaces/origamis/origami_dense.pyx:844:38: 'smallInteger' is not a constant, variable or function identifier
Error compiling Cython file:
------------------------------------------------------------
...
k = 1
while br_sg[u[j]] == 0:
i_to_tr[j] = k
j = r[j]
k += 1
periods.append((smallInteger(k), smallInteger(0)))
^
------------------------------------------------------------
surface_dynamics/flat_surfaces/origamis/origami_dense.pyx:912:32: 'smallInteger' is not a constant, variable or function identifier
Error compiling Cython file:
------------------------------------------------------------
...
k = 1
while br_sg[u[j]] == 0:
i_to_tr[j] = k
j = r[j]
k += 1
periods.append((smallInteger(k), smallInteger(0)))
^
------------------------------------------------------------
surface_dynamics/flat_surfaces/origamis/origami_dense.pyx:912:49: 'smallInteger' is not a constant, variable or function identifier
Error compiling Cython file:
------------------------------------------------------------
...
j = i
k = 1
while i_to_tr[j] == -1:
j = u[j]
k += 1
periods.append((smallInteger(-i_to_tr[j]), k))
^
------------------------------------------------------------
surface_dynamics/flat_surfaces/origamis/origami_dense.pyx:922:32: 'smallInteger' is not a constant, variable or function identifier
Error compiling Cython file:
------------------------------------------------------------
...
sage: o = Origami('(1)(2)(3)', '(1,2,3)')
sage: o.is_reduced()
False
"""
return self.lattice_of_periods() == (smallInteger(1), smallInteger(0), smallInteger(1))
^
------------------------------------------------------------
surface_dynamics/flat_surfaces/origamis/origami_dense.pyx:1043:45: 'smallInteger' is not a constant, variable or function identifier
Error compiling Cython file:
------------------------------------------------------------
...
sage: o = Origami('(1)(2)(3)', '(1,2,3)')
sage: o.is_reduced()
False
"""
return self.lattice_of_periods() == (smallInteger(1), smallInteger(0), smallInteger(1))
^
------------------------------------------------------------
surface_dynamics/flat_surfaces/origamis/origami_dense.pyx:1043:62: 'smallInteger' is not a constant, variable or function identifier
Error compiling Cython file:
------------------------------------------------------------
...
sage: o = Origami('(1)(2)(3)', '(1,2,3)')
sage: o.is_reduced()
False
"""
return self.lattice_of_periods() == (smallInteger(1), smallInteger(0), smallInteger(1))
^
------------------------------------------------------------
surface_dynamics/flat_surfaces/origamis/origami_dense.pyx:1043:79: 'smallInteger' is not a constant, variable or function identifier
Error compiling Cython file:
------------------------------------------------------------
...
d = {}
for b in blocks:
orbit = G.Orbit(b, libgap.OnSets)
action = G.Action(orbit, libgap.OnSets)
rr, uu = libgap.GeneratorsOfGroup(action)
d[frozenset(map(Integer, b))] = origami_from_gap_permutations(rr, uu)
^
------------------------------------------------------------
surface_dynamics/flat_surfaces/origamis/origami_dense.pyx:2613:28: 'Integer' is not a constant, variable or function identifier
[1/3] Cythonizing surface_dynamics/flat_surfaces/origamis/origami_dense.pyx
Traceback (most recent call last):
File "/Users/fial/Library/SageMath-10-5/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
main()
File "/Users/fial/Library/SageMath-10-5/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
json_out["return_val"] = hook(**hook_input["kwargs"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/fial/Library/SageMath-10-5/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/00/tlkkn7td1x523hnnlpc_cbj80000gn/T/pip-build-env-tl92kt8q/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 334, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/00/tlkkn7td1x523hnnlpc_cbj80000gn/T/pip-build-env-tl92kt8q/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 304, in _get_build_requires
self.run_setup()
File "/private/var/folders/00/tlkkn7td1x523hnnlpc_cbj80000gn/T/pip-build-env-tl92kt8q/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 320, in run_setup
exec(code, locals())
File "<string>", line 85, in <module>
File "/private/var/folders/00/tlkkn7td1x523hnnlpc_cbj80000gn/T/pip-build-env-tl92kt8q/overlay/lib/python3.12/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize
cythonize_one(*args)
File "/private/var/folders/00/tlkkn7td1x523hnnlpc_cbj80000gn/T/pip-build-env-tl92kt8q/overlay/lib/python3.12/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: surface_dynamics/flat_surfaces/origamis/origami_dense.pyx
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.Finally, I decided to deactivate all compiled modules in surface_dynamics, that is, I replaced all the content in setup.py by the lines
from setuptools import setup setup()
and modified some .py files of the package to make it work, after this I could finally use some of the features of surface_dynamics.