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

navit fails to build in python bindings (*_getattr_py) #1287

Open
l29ah opened this issue Jan 15, 2025 · 2 comments
Open

navit fails to build in python bindings (*_getattr_py) #1287

l29ah opened this issue Jan 15, 2025 · 2 comments

Comments

@l29ah
Copy link

l29ah commented Jan 15, 2025

Trying to build 329c6a2 (trunk HEAD) on Gentoo Lignux. Observing lots of errors like:

/var/tmp/portage/sci-geosciences/navit-9999-r1/work/navit-9999/navit/binding/python/navigation.c: In function ‘navigation_getattr_py’:
/var/tmp/portage/sci-geosciences/navit-9999-r1/work/navit-9999/navit/binding/python/navigation.c:43:12: error: implicit declaration of function ‘Py_FindMethod’ [-Wimplicit-function-declaration]
   43 |     return Py_FindMethod(navigation_methods, self, name);
      |            ^~~~~~~~~~~~~
/var/tmp/portage/sci-geosciences/navit-9999-r1/work/navit-9999/navit/binding/python/navigation.c:43:12: error: returning ‘int’ from a function with return type ‘PyObject *’ {aka ‘struct _object *’} makes pointer from integer without a cast [-Wint-conversion]
   43 |     return Py_FindMethod(navigation_methods, self, name);
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Not sure if relevant, cmake says:

CMake Warning (dev) at CMakeLists.txt:239 (find_package):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.
$ python2 --version
Python 2.7.18
$ python3 --version
Python 3.12.8
$ cmake --version
cmake version 3.31.4

CMake suite maintained and supported by Kitware (kitware.com/cmake).
@jkoan
Copy link
Member

jkoan commented Jan 16, 2025

Please try #1266 aka the fix_python2_build branch

@l29ah
Copy link
Author

l29ah commented Jan 16, 2025

Tried it, the result is:

In file included from /var/tmp/portage/sci-geosciences/navit-9999-r1/work/navit-9999/navit/binding/python/pcoord.c:20:
/var/tmp/portage/sci-geosciences/navit-9999-r1/work/navit-9999/navit/binding/python/common.h:20:10: fatal error: Python.h: No such file or directory
   20 | #include <Python.h>
      |          ^~~~~~~~~~

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

2 participants