python support question again (unable to compile in Ubuntu)

5 views
Skip to first unread message

Karl Tiedt

unread,
Apr 1, 2024, 11:29:01 AMApr 1
to Ldmud Talk
It seems since some point in the past year or 2, I've lost the ability to compile python support into the ldmud driver.... what worked previously, now fails with the following message:

checking for PYTHON... yes
checking for Py_Initialize in -lpython3... no
checking for Py_Initialize in -lpython3... (cached) no
checking for Py_Initialize in -lpython3... (cached) no
checking for Py_Initialize in -lpython3... (cached) no
checking for Py_Initialize in -lpython3... (cached) no
checking for Py_Initialize in -lpython3... (cached) no
checking for Py_Initialize in -lpython3... (cached) no
Python3 library not found - disabling Python support

Previously this worked with just 
enable_use_python=yes

I went back through all my notes and checked pkg-config, python3, and -dev and lib are all installed still... was a new way of checking added that relies on something more?

Now even passing in the lib path like below fails identically...

enable_use_python=/usr/local/lib/python3.10 

Thanks in advance

-Karl Tiedt

Gnomi

unread,
Apr 1, 2024, 2:54:43 PMApr 1
to ldmud...@googlegroups.com
Hi,

What's the result of 'pkg-config --cflags python3-embed'?

If the configure script cannot find this package via pkg-config, it'll do a
compilation test. It basically compiles the following program:

#include <Python.h>

void init(void)
{
Py_Initialize();
Py_Finalize();
}

And this seems to fail. Have a look at the config.log. That file should
contain the corresponding compilation errors.

Greetings,
Gnomi.

Karl Tiedt

unread,
Apr 1, 2024, 5:33:48 PMApr 1
to ldmud...@googlegroups.com
$ pkg-config --cflags python3-embed
-I/usr/include/python3.10

And python related from config.log
$ cat config.log | grep -i python
configure:12696: checking for PYTHON
configure:12703: $PKG_CONFIG --exists --print-errors "python3"
configure:12720: $PKG_CONFIG --exists --print-errors "python3"
configure:12828: checking for Py_Initialize in -lpython3
configure:12853: gcc -o conftest -g -O2 -fwrapv -I/usr/inet6/include -I/usr/include/postgresql   conftest.c -lpython3  -lnsl -lm  -lcrypt >&5
/usr/bin/ld: cannot find -lpython3: No such file or directory
configure:12828: checking for Py_Initialize in -lpython3
configure:12828: checking for Py_Initialize in -lpython3
configure:12828: checking for Py_Initialize in -lpython3
configure:12828: checking for Py_Initialize in -lpython3
configure:12828: checking for Py_Initialize in -lpython3
configure:12828: checking for Py_Initialize in -lpython3
ac_cv_env_PYTHON_CFLAGS_set=
ac_cv_env_PYTHON_CFLAGS_value=
ac_cv_env_PYTHON_LIBS_set=
ac_cv_env_PYTHON_LIBS_value=
ac_cv_lib_python3_Py_Initialize=no
lp_cv_has_python3=no
pkg_cv_PYTHON_CFLAGS='-I/usr/include/python3.10 -I/usr/include/x86_64-linux-gnu/python3.10'
pkg_cv_PYTHON_LIBS=
PYTHON_CFLAGS='-I/usr/include/python3.10 -I/usr/include/x86_64-linux-gnu/python3.10'
PYTHON_LIBS=''
cdef_python_script='#define'
cdef_use_python='#undef'
val_python_script='"startup.py"' 
-Karl Tiedt


--
You received this message because you are subscribed to the Google Groups "LDMud Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ldmud-talk+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ldmud-talk/ZgsC8D2Y7CksrNBl%40platinum.motzkau.

Croft

unread,
Apr 1, 2024, 5:41:53 PMApr 1
to ldmud...@googlegroups.com
That "/usr/bin/ld: cannot find -lpython3: No such file or directory" needs to be fixed. 
Maybe check the context of that line.

Croft

Karl Tiedt

unread,
Apr 1, 2024, 5:45:09 PMApr 1
to ldmud...@googlegroups.com
That is the compiler test after the pkg-config fails it seems.

configure:12720: $PKG_CONFIG --exists --print-errors "python3"
configure:12723: $? = 0
configure:12761: result: yes

configure:12828: checking for Py_Initialize in -lpython3
configure:12853: gcc -o conftest -g -O2 -fwrapv -I/usr/inet6/include -I/usr/include/postgresql   conftest.c -lpython3  -lnsl -lm  -lcrypt >&5
/usr/bin/ld: cannot find -lpython3: No such file or directory
collect2: error: ld returned 1 exit status
configure:12853: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "LDMud"
 
-Karl Tiedt


Gnomi

unread,
Apr 1, 2024, 5:52:10 PMApr 1
to ldmud...@googlegroups.com
Hi,

Karl Tiedt wrote:
> > configure:12696: checking for PYTHON
> > configure:12703: $PKG_CONFIG --exists --print-errors "python3"
> > configure:12720: $PKG_CONFIG --exists --print-errors "python3"

What is your LDMud version? It should check for python3-embed first.
(This was added in LDMud 3.6.4.) I think this is the main cause.

> > configure:12828: checking for Py_Initialize in -lpython3

This should be -lpython3.10.

> > configure:12853: gcc -o conftest -g -O2 -fwrapv -I/usr/inet6/include
> > -I/usr/include/postgresql conftest.c -lpython3 -lnsl -lm -lcrypt >&5
> > /usr/bin/ld: cannot find -lpython3: No such file or directory

That is the reason, why the test program failed to compile.

> > pkg_cv_PYTHON_CFLAGS='-I/usr/include/python3.10
> > pkg_cv_PYTHON_LIBS=

So, pkg-config returned cflags, but not libs. I'm suspecting querying
python3 instead of python3-embed with pkg-config for that.

Greetings,
Gnomi.

Karl Tiedt

unread,
Apr 1, 2024, 6:01:31 PMApr 1
to ldmud...@googlegroups.com
I am testing against github head currently, I did just update it, it was failing before I updated it too, I thought that might have been the "im stupid, smacking my own forehead" answer but it was not.

is python-embed another python package? I'm not finding that in apt-get.... so maybe I missed that memo when it became a requirement?



-Karl Tiedt


--
You received this message because you are subscribed to the Google Groups "LDMud Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ldmud-talk+...@googlegroups.com.

Gnomi

unread,
Apr 1, 2024, 6:14:04 PMApr 1
to ldmud...@googlegroups.com
Hi,

Karl Tiedt schrieb:
> I am testing against github head currently, I did just update it, it was
> failing before I updated it too, I thought that might have been the "im
> stupid, smacking my own forehead" answer but it was not.

That's really strange. Because

> > > > configure:12696: checking for PYTHON

exists in 3.6.3 configure
(https://github.com/ldmud/ldmud/blob/3.6.3/autoconf/configure#L12696),
also on that exact line, but not in the master branch
(https://github.com/ldmud/ldmud/blob/master/autoconf/configure).

Did you call autogen.sh after updating to head?

> is python-embed another python package? I'm not finding that in apt-get....

The pkg-config package was split. The original python3 is used to build
Python packages, and the python3-embed package is used for software that
is embedding a Python interpreter (as LDMud does).

Both package definitions are part of the Debian package libpython3-dev,
so no additional package needs to be installed.

Greetings,
Gnomi.

Karl Tiedt

unread,
Apr 1, 2024, 6:19:30 PMApr 1
to ldmud...@googlegroups.com
Did you call autogen.sh after updating to head?

You're a wizard Gnomi, I totally forgot to rerun that.... it appears its working now.
 
-Karl Tiedt


--
You received this message because you are subscribed to the Google Groups "LDMud Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ldmud-talk+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages