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

Error on install_longintrepr.h #998

Open
manueldeprada opened this issue Nov 22, 2022 · 6 comments
Open

Error on install_longintrepr.h #998

manueldeprada opened this issue Nov 22, 2022 · 6 comments

Comments

@manueldeprada
Copy link

I came across this error while trying to install on Python 3.11 or Python 3.10:

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 -I/home/prada/.local/lib/python3.11/site-packages/numpy/core/include -I. -I/usr/include/python3.11 -c GPy/kern/src/stationary_cython.c -o build/temp.linux-x86_64-cpython-311/GPy/kern/src/stationary_cython.o -fopenmp -O3
      GPy/kern/src/stationary_cython.c:196:12: error fatal: longintrepr.h: File does not exist
        196 |   #include "longintrepr.h"
            |            ^~~~~~~~~~~~~~~

Solution I found: download sources from git, link like ln -s /usr/include/python3.10/cpython/longintrepr.h longintrepr.h and build GPy.

It still doesn't build in Python 3.11 due API changes like this one:

GPy/kern/src/stationary_cython.c:318:11: error: no enough arguments for function ‘PyCode_New’
  318 |           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
      |           ^~~~~~~~~~

but soft-linking longintrepr.h allows successful building with Python 3.10.

@casellimarco
Copy link

Installing python3.10-dev solves it, I haven't tried it on 3.11

@muxator
Copy link

muxator commented Jan 13, 2023

Same error here: Fedora 37, python 3.11.1, tried to install GPy 1.10.0 via pip.

Apparently there are no binary wheels available for python 3.11 (and 3.100, too). Pip then tries to locally build GPy, and there is this failure (which is due to changes in CPython):

gcc [...] -c GPy/kern/src/stationary_cython.c -o [...]/stationary_cython.o [...]
GPy/kern/src/stationary_cython.c:196:12: fatal error: longintrepr.h: No such file or directory
    196 |   #include "longintrepr.h"
        |            ^~~~~~~~~~~~~~~
compilation terminated.

@bpkroth
Copy link

bpkroth commented Jan 27, 2023

(hasty notes)
Looking at this for a conda environment too. There the .h file is in the conda env, but the path to find it is missing.
It only looks in include/python3.11 instead of include/python3.11/cython which is where the .h file is.

@jeremysanders
Copy link
Contributor

The real fix is for someone to run cython on each of the .pyx files in the repository, and replacing the generated .c files in the repository.

@muxator
Copy link

muxator commented Aug 21, 2023

Hi, are there any plans to support python 3.11? This is going to be a progressively bigger issue as times goes by. Is some help needed?

@muxator
Copy link

muxator commented Aug 21, 2023

Note for whoever is following this issue: the closer fix seems to be this PR: #1020.

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

5 participants