cschwan / sage-on-gentoo

(Unofficial) Gentoo Overlay for Sage- and Sage-related ebuilds
84 stars 26 forks source link

=sci-mathematics/sage-6.7-r1 fails to compile #359

Closed humdig closed 9 years ago

humdig commented 9 years ago

When trying to compile sage-6.7-r1 the build fails with the following error:

Cythonizing sage/combinat/combinat_cython.pyx
Cythonizing sage/combinat/crystals/letters.pyx

Error compiling Cython file:
------------------------------------------------------------
...
#  as published by the Free Software Foundation; either version 2 of
#  the License, or (at your option) any later version.
#                  http://www.gnu.org/licenses/
#*****************************************************************************

from cpython.object cimport Py_TYPE, PyTypeObject
^
------------------------------------------------------------

./sage/ext/stdsage.pxd:13:0: 'Py_TYPE.pxd' not found

Error compiling Cython file:
------------------------------------------------------------
...
#  as published by the Free Software Foundation; either version 2 of
#  the License, or (at your option) any later version.
#                  http://www.gnu.org/licenses/
#*****************************************************************************

from cpython.object cimport Py_TYPE, PyTypeObject
                           ^
------------------------------------------------------------

./sage/ext/stdsage.pxd:13:28: Name 'Py_TYPE' not declared in module 'cpython.object'

Error compiling Cython file:
------------------------------------------------------------
...
    """
    Return ``t.__new__(t)``.  This works even for types like
    :class:`Integer` where we change ``tp_new`` at runtime (Cython
    optimizations assume that ``tp_new`` doesn't change).
    """
    return (<PyTypeObject*>t).tp_new(t, <object>NULL, <object>NULL)
           ^
------------------------------------------------------------

./sage/ext/stdsage.pxd:22:12: Cannot convert 'PyTypeObject *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
    """
    Manually set ``dst.__new__`` to ``src.__new__``.  This is used to
    speed up Cython's boilerplate object construction code by skipping
    irrelevant base class ``tp_new`` methods.
    """
    (<PyTypeObject*>dst).tp_new = (<PyTypeObject*>src).tp_new
                                  ^
------------------------------------------------------------

./sage/ext/stdsage.pxd:31:35: Cannot convert 'PyTypeObject *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
    """
    Manually set ``dst.__new__`` to ``src.__new__``.  This is used to
    speed up Cython's boilerplate object construction code by skipping
    irrelevant base class ``tp_new`` methods.
    """
    (<PyTypeObject*>dst).tp_new = (<PyTypeObject*>src).tp_new
    ^
------------------------------------------------------------

./sage/ext/stdsage.pxd:31:5: Cannot convert 'PyTypeObject *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...

cdef inline bint HAS_DICTIONARY(obj):
    """
    Test whether the given object has a Python dictionary.
    """
    return Py_TYPE(obj).tp_dictoffset != 0
                 ^
------------------------------------------------------------

./sage/ext/stdsage.pxd:38:18: undeclared name not builtin: Py_TYPE
Cythonizing sage/combinat/debruijn_sequence.pyx
Cythonizing sage/combinat/degree_sequences.pyx
Cythonizing sage/combinat/designs/designs_pyx.pyx

Error compiling Cython file:
------------------------------------------------------------
...
#  as published by the Free Software Foundation; either version 2 of
#  the License, or (at your option) any later version.
#                  http://www.gnu.org/licenses/
#*****************************************************************************

from cpython.object cimport Py_TYPE, PyTypeObject
^
------------------------------------------------------------

./sage/ext/stdsage.pxd:13:0: 'Py_TYPE.pxd' not found

Error compiling Cython file:
------------------------------------------------------------
...
#  as published by the Free Software Foundation; either version 2 of
#  the License, or (at your option) any later version.
#                  http://www.gnu.org/licenses/
#*****************************************************************************

from cpython.object cimport Py_TYPE, PyTypeObject
                           ^
------------------------------------------------------------

./sage/ext/stdsage.pxd:13:28: Name 'Py_TYPE' not declared in module 'cpython.object'

Error compiling Cython file:
------------------------------------------------------------
...
    """
    Return ``t.__new__(t)``.  This works even for types like
    :class:`Integer` where we change ``tp_new`` at runtime (Cython
    optimizations assume that ``tp_new`` doesn't change).
    """
    return (<PyTypeObject*>t).tp_new(t, <object>NULL, <object>NULL)
           ^
------------------------------------------------------------

./sage/ext/stdsage.pxd:22:12: Cannot convert 'PyTypeObject *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
    """
    Manually set ``dst.__new__`` to ``src.__new__``.  This is used to
    speed up Cython's boilerplate object construction code by skipping
    irrelevant base class ``tp_new`` methods.
    """
    (<PyTypeObject*>dst).tp_new = (<PyTypeObject*>src).tp_new
                                  ^
------------------------------------------------------------

./sage/ext/stdsage.pxd:31:35: Cannot convert 'PyTypeObject *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
    """
    Manually set ``dst.__new__`` to ``src.__new__``.  This is used to
    speed up Cython's boilerplate object construction code by skipping
    irrelevant base class ``tp_new`` methods.
    """
    (<PyTypeObject*>dst).tp_new = (<PyTypeObject*>src).tp_new
    ^
------------------------------------------------------------

./sage/ext/stdsage.pxd:31:5: Cannot convert 'PyTypeObject *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...

cdef inline bint HAS_DICTIONARY(obj):
    """
    Test whether the given object has a Python dictionary.
    """
    return Py_TYPE(obj).tp_dictoffset != 0
                 ^
------------------------------------------------------------

./sage/ext/stdsage.pxd:38:18: undeclared name not builtin: Py_TYPE

Error compiling Cython file:
------------------------------------------------------------
...
#  as published by the Free Software Foundation; either version 2 of
#  the License, or (at your option) any later version.
#                  http://www.gnu.org/licenses/
#*****************************************************************************

from cpython.object cimport Py_TYPE, PyTypeObject
^
------------------------------------------------------------

./sage/ext/stdsage.pxd:13:0: 'Py_TYPE.pxd' not found

Error compiling Cython file:
------------------------------------------------------------
...
#  as published by the Free Software Foundation; either version 2 of
#  the License, or (at your option) any later version.
#                  http://www.gnu.org/licenses/
#*****************************************************************************

from cpython.object cimport Py_TYPE, PyTypeObject
                           ^
------------------------------------------------------------

./sage/ext/stdsage.pxd:13:28: Name 'Py_TYPE' not declared in module 'cpython.object'

Error compiling Cython file:
------------------------------------------------------------
...
    """
    Return ``t.__new__(t)``.  This works even for types like
    :class:`Integer` where we change ``tp_new`` at runtime (Cython
    optimizations assume that ``tp_new`` doesn't change).
    """
    return (<PyTypeObject*>t).tp_new(t, <object>NULL, <object>NULL)
           ^
------------------------------------------------------------

./sage/ext/stdsage.pxd:22:12: Cannot convert 'PyTypeObject *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
    """
    Manually set ``dst.__new__`` to ``src.__new__``.  This is used to
    speed up Cython's boilerplate object construction code by skipping
    irrelevant base class ``tp_new`` methods.
    """
    (<PyTypeObject*>dst).tp_new = (<PyTypeObject*>src).tp_new
                                  ^
------------------------------------------------------------

./sage/ext/stdsage.pxd:31:35: Cannot convert 'PyTypeObject *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
    """
    Manually set ``dst.__new__`` to ``src.__new__``.  This is used to
    speed up Cython's boilerplate object construction code by skipping
    irrelevant base class ``tp_new`` methods.
    """
    (<PyTypeObject*>dst).tp_new = (<PyTypeObject*>src).tp_new
    ^
------------------------------------------------------------

./sage/ext/stdsage.pxd:31:5: Cannot convert 'PyTypeObject *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...

cdef inline bint HAS_DICTIONARY(obj):
    """
    Test whether the given object has a Python dictionary.
    """
    return Py_TYPE(obj).tp_dictoffset != 0
                 ^
------------------------------------------------------------

./sage/ext/stdsage.pxd:38:18: undeclared name not builtin: Py_TYPE
Cythonizing sage/combinat/designs/evenly_distributed_sets.pyx

Error compiling Cython file:
------------------------------------------------------------
...
#  as published by the Free Software Foundation; either version 2 of
#  the License, or (at your option) any later version.
#                  http://www.gnu.org/licenses/
#*****************************************************************************

from cpython.object cimport Py_TYPE, PyTypeObject
^
------------------------------------------------------------

./sage/ext/stdsage.pxd:13:0: 'Py_TYPE.pxd' not found

Error compiling Cython file:
------------------------------------------------------------
...
#  as published by the Free Software Foundation; either version 2 of
#  the License, or (at your option) any later version.
#                  http://www.gnu.org/licenses/
#*****************************************************************************

from cpython.object cimport Py_TYPE, PyTypeObject
                           ^
------------------------------------------------------------

./sage/ext/stdsage.pxd:13:28: Name 'Py_TYPE' not declared in module 'cpython.object'

Error compiling Cython file:
------------------------------------------------------------
...
    """
    Return ``t.__new__(t)``.  This works even for types like
    :class:`Integer` where we change ``tp_new`` at runtime (Cython
    optimizations assume that ``tp_new`` doesn't change).
    """
    return (<PyTypeObject*>t).tp_new(t, <object>NULL, <object>NULL)
           ^
------------------------------------------------------------

./sage/ext/stdsage.pxd:22:12: Cannot convert 'PyTypeObject *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
    """
    Manually set ``dst.__new__`` to ``src.__new__``.  This is used to
    speed up Cython's boilerplate object construction code by skipping
    irrelevant base class ``tp_new`` methods.
    """
    (<PyTypeObject*>dst).tp_new = (<PyTypeObject*>src).tp_new
                                  ^
------------------------------------------------------------

./sage/ext/stdsage.pxd:31:35: Cannot convert 'PyTypeObject *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
    """
    Manually set ``dst.__new__`` to ``src.__new__``.  This is used to
    speed up Cython's boilerplate object construction code by skipping
    irrelevant base class ``tp_new`` methods.
    """
    (<PyTypeObject*>dst).tp_new = (<PyTypeObject*>src).tp_new
    ^
------------------------------------------------------------

./sage/ext/stdsage.pxd:31:5: Cannot convert 'PyTypeObject *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...

cdef inline bint HAS_DICTIONARY(obj):
    """
    Test whether the given object has a Python dictionary.
    """
    return Py_TYPE(obj).tp_dictoffset != 0
                 ^
------------------------------------------------------------

./sage/ext/stdsage.pxd:38:18: undeclared name not builtin: Py_TYPE

Error compiling Cython file:
------------------------------------------------------------
...
#  as published by the Free Software Foundation; either version 2 of
#  the License, or (at your option) any later version.
#                  http://www.gnu.org/licenses/
#*****************************************************************************

from cpython.object cimport Py_TYPE, PyTypeObject
^
------------------------------------------------------------

./sage/ext/stdsage.pxd:13:0: 'Py_TYPE.pxd' not found

Error compiling Cython file:
------------------------------------------------------------
...
#  as published by the Free Software Foundation; either version 2 of
#  the License, or (at your option) any later version.
#                  http://www.gnu.org/licenses/
#*****************************************************************************

from cpython.object cimport Py_TYPE, PyTypeObject
                           ^
------------------------------------------------------------

./sage/ext/stdsage.pxd:13:28: Name 'Py_TYPE' not declared in module 'cpython.object'

Error compiling Cython file:
------------------------------------------------------------
...
    """
    Return ``t.__new__(t)``.  This works even for types like
    :class:`Integer` where we change ``tp_new`` at runtime (Cython
    optimizations assume that ``tp_new`` doesn't change).
    """
    return (<PyTypeObject*>t).tp_new(t, <object>NULL, <object>NULL)
           ^
------------------------------------------------------------

./sage/ext/stdsage.pxd:22:12: Cannot convert 'PyTypeObject *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
    """
    Manually set ``dst.__new__`` to ``src.__new__``.  This is used to
    speed up Cython's boilerplate object construction code by skipping
    irrelevant base class ``tp_new`` methods.
    """
    (<PyTypeObject*>dst).tp_new = (<PyTypeObject*>src).tp_new
                                  ^
------------------------------------------------------------

./sage/ext/stdsage.pxd:31:35: Cannot convert 'PyTypeObject *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
    """
    Manually set ``dst.__new__`` to ``src.__new__``.  This is used to
    speed up Cython's boilerplate object construction code by skipping
    irrelevant base class ``tp_new`` methods.
    """
    (<PyTypeObject*>dst).tp_new = (<PyTypeObject*>src).tp_new
    ^
------------------------------------------------------------

./sage/ext/stdsage.pxd:31:5: Cannot convert 'PyTypeObject *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...

cdef inline bint HAS_DICTIONARY(obj):
    """
    Test whether the given object has a Python dictionary.
    """
    return Py_TYPE(obj).tp_dictoffset != 0
                 ^
------------------------------------------------------------

./sage/ext/stdsage.pxd:38:18: undeclared name not builtin: Py_TYPE Traceback (most recent call last): File "/usr/lib64/python2.7/site-packages/Cython/Build/Dependencies.py", line 1003, in cythonize_one_helper return cythonize_one(*m[1:]) File "/usr/lib64/python2.7/site-packages/Cython/Build/Dependencies.py", line 985, in cythonize_one raise CompileError(None, pyx_file) CompileError: sage/categories/map.pyx Cythonizing sage/combinat/designs/orthogonal_arrays_find_recursive.pyx Traceback (most recent call last): File "setup.py", line 565, in run_cythonize() File "setup.py", line 557, in run_cythonize 'profile': profile, File "/usr/lib64/python2.7/site-packages/Cython/Build/Dependencies.py", line 856, in cythonize result.get(99999) # seconds File "/usr/lib64/python2.7/multiprocessing/pool.py", line 558, in get raise self._value Cython.Compiler.Errors.CompileError: sage/categories/map.pyx

kiwifb commented 9 years ago

I should have locked the dependency on cython to 0.22-r3, you are getting this because of cython 0.22.1, it misses some sage patches.

humdig commented 9 years ago

That fixed it. Thank you.

kiwifb commented 9 years ago

I just restricted dependencies so it won't happen anymore. I may forward port the patch to 0.22.1 if it becomes a real problem.

WPettersson commented 9 years ago

If dev-python/cython-0.22 is installed, portage things that this is sufficient for the installation of Sage but these errors pop up again. I've had to specify that cython-0.22-r5 be installed to get Sage to compile properly on my end. Note that it was already unmasked, portage just didn't think it had to update it before installing Sage.

I'm not sure on the best way to specify these requirements (cython at least 0.22-r3 but not 0.22.1) but the current ones can potentially cause this issue for other people still.

kiwifb commented 9 years ago

It is a fair comment. The only thing I can do is pin the version, which has its own problems (maintenance mainly). In the past I tried to put two requirements at once but it didn't work. The range of options you can give in the ebuild is not fine grained enough.

The alternative is to provide a package.mask file and tell people to use it. I don't want to go there.

Yet another alternative that I have avoided so far but may be required in this case, until such time as cython 0.23 is released and is usable by these ebuild, is to depend on cython::sage-on-gentoo that force the use of the overlay.

WPettersson commented 9 years ago

Yeah I don't really have a good fix, I just wanted to point to other users that it is still possible to be seeing this problem. I think leaving everything as-is for now is fine.

Alessandro-Barbieri commented 8 years ago

I have the same issue.

kiwifb commented 8 years ago

version of sage and cython because I don't provide 6.7 anymore.

Alessandro-Barbieri commented 8 years ago

Nevermind, I have switched to sage 7 ::sage-on-gentoo which depends on newer cython