Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compile in Sagemath 9.8beta7 in Fedora 37 #88

Closed
enriqueartal opened this issue Jan 19, 2023 · 15 comments
Closed

Cannot compile in Sagemath 9.8beta7 in Fedora 37 #88

enriqueartal opened this issue Jan 19, 2023 · 15 comments

Comments

@enriqueartal
Copy link

I got error with make snappy in Sagemath 9.8beta7, with python3-3.1.11:

[snappy]       
error: Command "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 -Ikernel/headers -Ikernel/unix_kit -Ikernel/addl_code -Ikernel/real_type -I/usr/local/sage-310/local/var/lib/sage/venv-python3.11/include -I/usr/include/python3.11 -c cython/SnapPy.c -o build/temp.linux-x86_64-cpython-311/cython/SnapPy.o" failed with exit status 1
@NathanDunfield
Copy link
Member

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.

@enriqueartal
Copy link
Author

snappy.log

Here is the log; I tried also with the git version; would that log also useful?

@enriqueartal
Copy link
Author

It seems to be independent of sagemath, essentially the same error happens with pip, both with 3.0.3 or the from github repo

@NathanDunfield
Copy link
Member

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.

@enriqueartal
Copy link
Author

The version is 0.29.32, last one in Fedora 37

@NathanDunfield
Copy link
Member

Thanks for the clarification. Your error messages look a lot like these from cython/cython#4500. But that issue was fixed in cython/cython#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

@enriqueartal
Copy link
Author

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.

@NathanDunfield
Copy link
Member

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.

@enriqueartal
Copy link
Author

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!

@NathanDunfield
Copy link
Member

You can start the app with python3 -m snappy.app assuming the Fedora package python3-tkinter is installed.

@dimpase
Copy link

dimpase commented Jan 25, 2023

Why does spherogram include Cython-generated files? Isn't Cython standard enough so that you don't have to do this?

@dimpase
Copy link

dimpase commented Jan 25, 2023

Should spherogram be a separate package on in SageMath?

@NathanDunfield
Copy link
Member

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.

@dimpase
Copy link

dimpase commented Jan 25, 2023

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?)

@dimpase
Copy link

dimpase commented Jan 26, 2023

Please see cython/cython#5089 - while Cython devs still sit on the fence regarding the issue, please feel free to voice your opinion there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants