pythonc++cpypypyephem

PyPy ephem couldn't install on linux


I want to install ephem package on PyPy 3.7 but i couldn't make it. Because i got following message during install. I guess, i'm missing something.

gcc -pthread -DNDEBUG -O2 -fPIC -Ilibastro -I. -I/root/pypy3.7/include -c extensions/_libastro.c -o build/temp.linux-x86_64-3.7/extensions/_libastro.o -ffloat-store
extensions/_libastro.c: In function ‘Body_repr’:
extensions/_libastro.c:20:17: error: ‘Body’ {aka ‘struct <anonymous>’} has no member named ‘ob_base’; did you mean ‘ob_type’?
 #define OB_TYPE ob_base.ob_type
                 ^~~~~~~
extensions/_libastro.c:1380:18: note: in expansion of macro ‘OB_TYPE’
            body->OB_TYPE->tp_name, name, body);
                  ^~~~~~~
extensions/_libastro.c:20:17: error: ‘Body’ {aka ‘struct <anonymous>’} has no member named ‘ob_base’; did you mean ‘ob_type’?
 #define OB_TYPE ob_base.ob_type
                 ^~~~~~~
extensions/_libastro.c:1385:16: note: in expansion of macro ‘OB_TYPE’
          body->OB_TYPE->tp_name,
                ^~~~~~~
extensions/_libastro.c:20:17: error: ‘Body’ {aka ‘struct <anonymous>’} has no member named ‘ob_base’; did you mean ‘ob_type’?
 #define OB_TYPE ob_base.ob_type
                 ^~~~~~~
extensions/_libastro.c:1389:16: note: in expansion of macro ‘OB_TYPE’
          body->OB_TYPE->tp_name, body);
                ^~~~~~~
error: command 'gcc' failed with exit status 1

PyPy info

Python 3.7.10 (77787b8f4c49, May 15 2021, 11:50:33)
[PyPy 7.3.5 with GCC 7.3.1 20180303 (Red Hat 7.3.1-5)]

Solution

  • After the Ronan Lamy answer, I changed the body->OB_TYPE with Py_TYPE(body) and it worked for v4.0.1