Re: gdb/head build, --with-python= FAILs @ "no usable python found " ?

Christian Biesinger
2020-03-25T22:24:42Z

On Wed, Mar 25, 2020 at 5:14 PM PGNet Dev <pgnet.dev@gmail.com> wrote:
>
> On 3/25/20 2:57 PM, Christian Biesinger wrote:
> ...
> > Yes, Python 3 is known to work, though Python 2.7 is also supported.
>
> gr8, thx
>
> > - What does gdb/config.log say?
>
> ==> https://pastebin.com/ZPaKjG9Z

So the immediate problem is this:

configure:10601: checking for python
configure:10619: /usr/bin/gcc-10 -o conftest -O3 -Wall
-fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables
-fmessage-length=0 -grecord-gcc-switches -march=native -mtune=native
-O3 -Wall -fstack-protector-strong -funwind-tables
-fasynchronous-unwind-tables -fmessage-length=0 -grecord-gcc-switches
-march=native -mtune=native -D_FORTIFY_SOURCE=2
-I/usr/local/pyenv/versions/3.8-dev/include/python3.8
-I/usr/local/pyenv/versions/3.8-dev/include/python3.8 conftest.c
-lpython3.8 -lcrypt -lpthread -ldl -lutil -lm -lm -Xlinker
-export-dynamic -lncursesw -lm -ldl >&5
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
cannot find -lpython3.8

GDB uses basically this commandline to find the linker flags:
python3.8 ./gdb/python-config.py --ldflags

So I guess you'll either have to figure out why that does the wrong
thing (it seems to ask Python for the right values) or pass
LDFLAGS=/usr/local/pyenv/versions/3.8-dev/lib/ to configure.

Hope this helps,
Christian

>
>
>
> > - Do you also have the headers
>
> yep.
>
> ls -al /usr/local/pyenv/versions/3.8-dev/include/python3.8/Python.h
> -rw-r--r-- 1 root root 3.6K Mar 20 20:44 /usr/local/pyenv/versions/3.8-dev/include/python3.8/Python.h
> ... etc ...
>
> > and libraries installed?
>
> ls -al /usr/local/pyenv/versions/3.8-dev/lib/
> total 17M
> drwxr-xr-x 4 root root 4.0K Mar 20 20:44 ./
> drwxr-xr-x 7 root root 4.0K Mar 20 20:49 ../
> lrwxrwxrwx 1 root root 19 Mar 20 20:44 libpython3.8.so -> libpython3.8.so.1.0*
> -rwxr-xr-x 1 root root 17M Mar 20 20:44 libpython3.8.so.1.0*
> -rwxr-xr-x 1 root root 8.6K Mar 20 20:44 libpython3.so*
> drwxr-xr-x 2 root root 4.0K Mar 20 20:44 pkgconfig/
> drwxr-xr-x 35 root root 4.0K Mar 20 20:44 python3.8/
>
> atm, NO add'l *FLAGS set to either ...
>
> > - Just to confirm, /usr/local/pyenv/versions/3.8-dev/bin/python3.8 is the binary and not a directory, right?
>
> correct.
>
> ls -ald /usr/local/pyenv/versions/3.8-dev/bin/python3.8
> -rwxr-xr-x 1 root root 15K Mar 20 20:44 /usr/local/pyenv/versions/3.8-dev/bin/python3.8*
>
> /usr/local/pyenv/versions/3.8-dev/bin/python3.8 -V
> Python 3.8.2+