Closed enriqueartal closed 1 year ago
Thanks for the report. Could you upload a complete log of the output prior to the error? We'll need more to go on to figure this out.
Here is the log; I tried also with the git version; would that log also useful?
It seems to be independent of sagemath, essentially the same error happens with pip, both with 3.0.3 or the from github repo
What version of Cython do you have? Since Python 3.11 is relatively new, you need a recent Cython to be able to build snappy.
The version is 0.29.32, last one in Fedora 37
Thanks for the clarification. Your error messages look a lot like these from https://github.com/cython/cython/issues/4500. But that issue was fixed in https://github.com/cython/cython/pull/4584 and we have successfully built SnapPy with Cython 0.29.32 and Python 3.11 on Linux, namely the pypa docker image.
Does the below wheel work for you? That might be the easiest solution here:
snappy-3.1rc1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.gz
I tried to install the above file (after gunzip) via pip install name_of_the_file I got a similar error:
gcc -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Iplanarity_src/c/ -I/usr/include/python3.11 -c planarity_src/c/stack.c -o build/temp.linux-x86_64-cpython-311/planarity_src/c/stack.o
gcc -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Iplanarity_src/c/ -I/usr/include/python3.11 -c planarity_src/planarity.c -o build/temp.linux-x86_64-cpython-311/planarity_src/planarity.o
planarity_src/planarity.c:216:12: error fatal: longintrepr.h: No existe el fichero o el directorio
216 | #include "longintrepr.h"
Nevertheless I found /usr/include/python3.11/cpython/longintrepr.h
in my system.
That error is from it trying to build the dependency spherogram
from the source tarball (no compilation will is needed to install the snappy
wheel itself) on pypi
. That tarball includes Cython-generated C code that is incompatible with Python 3.11. I think you need to clone https://github.com/3-manifolds/Spherogram and then do pip install .
in the resulting directory. Then try installing the snappy
wheel again.
It did not work straightforward because I did not send the whole log; doing the same thing with low-index (cloning and installing). BTW, I do not know how to start snappy from the command line! But I can work inside inside sagemath which was the goal. Thanks!
You can start the app with python3 -m snappy.app
assuming the Fedora package python3-tkinter
is installed.
Why does spherogram
include Cython-generated files? Isn't Cython standard enough so that you don't have to do this?
Should spherogram
be a separate package on in SageMath?
Why does
spherogram
include Cython-generated files?
Because this is the practice that has always been recommended by the Cython docs. I believe the issue is many machines lack Cython or at least a sufficiently up-to-date version. Withpyproject.toml
, you can now specify separate build-time requirements (like Cython), but that's a new development and snappy
hasn't switched over to it entirely.
I think the real issue here is that we have yet to do a formal release of SnapPy that supports Python 3.11. I hope to do so in the next few weeks.
I don't understand - pip install Cython
isn't such a big deal. (I think it's a bad, outdated, advice on Cython side, too - probably from pre-pip times?)
Please see https://github.com/cython/cython/issues/5089 - while Cython devs still sit on the fence regarding the issue, please feel free to voice your opinion there.
I got error with
make snappy
in Sagemath 9.8beta7, with python3-3.1.11: