"undefined symbol _Py_NoneStruct" when building Pure Data [pyo~] external

12 views
Skip to first unread message

Alexandros Drymonitis

unread,
May 24, 2021, 9:39:54 AM5/24/21
to pyo-discuss
Actually, I've now started a new thread about this error message. The conversation was left at Olivier's reply:

"Everything seems ok... Did you try with 3.8. Lately, on Windows, I didn't succeed to use python 3.9 in a pyo embedded project. I didn't have the time to investigate deeply, and I reverted to 3.8, which was working flawlessly. I had set up an Ubuntu 20.04 (but 32-bit, it's an old computer), I'll see if I can get it working there with python 3.9...

Olivier"

Trying Python3.8 did not work either.

Alexandros Drymonitis

unread,
Aug 31, 2021, 4:45:37 AM8/31/21
to pyo-discuss
Hi, revisiting this thread because I included Pd's current makefile system. The one that ships with Pyo uses the old Makefile, which, IIRC, is from the Pd-extended era. Nowdays the makefile system used for building externals in Pd is this https://github.com/pure-data/pd-lib-builder. Copying the Makefile.pdlibbuilder file in the directory of the [pyo~] source files, and copying the m_pyo.h file there as well, builds a Pd external with the following Makefile:

```
# Makefile for mylib

lib.name = pyo~

class.sources = pyo~.c

# m_pyo.h should be in this directory, don't know how to include it when it's in the parent directory
common.sources = m_pyo.h

datafiles = pyo~-help.pd manual.txt README.md

cflags = -I"$(PD_INCLUDE)" -I.. -Wno-cast-function-type -Wno-unused-parameter $(shell python-config --cflags)

ldflags = $(shell python-config --ldflags)

ldlibs = $(shell python-config --libs)

# use the following two lines if you have pd-lib-builder with the Makefile.pdlibbuilder in the parent directory of this one
#PDLIBBUILDER_DIR=../pd-lib-builder/
#include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder

# otherwise use the line below. In this case you should have Makefile.pdlibbuilder in this directory
include Makefile.pdlibbuilder
```
Note that I'm not using python3 in the cflags, ldflas, and ldlibs variables, because Python3 is the default Python on my system, and runs with the `python` command. Change according to your system.

The error message of this thread's subject line remains, still the object builds. Thought I'd share this makefile system update, since it's maintained by the core team of developers of Pd (not Miller himself, but the core around him).
If anyone has any idea why this error message occurs when I try to load the object in Pd, please enlighten me.

My system is Ubuntu Studio 21.04 with Pd-0.51.4

Alexandros

unread,
Aug 31, 2021, 4:53:14 AM8/31/21
to pyo-d...@googlegroups.com

Another update. This is the output when typing make:

cc -DPD -I "/usr/include/pd" -DUNIX  -fPIC -I"" -I.. -Wno-cast-function-type -Wno-unused-parameter -I/usr/include/python3.9 -I/usr/include/python3.9  -Wno-unused-result -Wsign-compare -g -ffile-prefix-map=/build/python3.9-1n6GrT/python3.9-3.9.5=. -flto=auto -ffat-lto-objects -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector -Wformat -Werror=format-security  -DNDEBUG -g -fwrapv -O3 -Wall -Wall -Wextra -Wshadow -Winline -Wstrict-aliasing -O3 -ffast-math -funroll-loops -fomit-frame-pointer -march=core2 -mfpmath=sse -msse -msse2 -msse3 -o pyo~.o -c pyo~.c
make: *** No rule to make target 'm_pyo.o', needed by 'pyo~.pd_linux'.  Stop.

So, the building process stops at this point. I guess this could be cause the error message?

--
You received this message because you are subscribed to a topic in the Google Groups "pyo-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyo-discuss/ESClWoB9Qz0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pyo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyo-discuss/cdb046f7-ec75-4d90-ab04-be8f0116d68en%40googlegroups.com.

Olivier Bélanger

unread,
Sep 2, 2021, 8:13:00 PM9/2/21
to pyo-d...@googlegroups.com
Hi,

Have you tried adding the "-rdynamic" (without the quotes) flag to the linker (which tells the program to resolve symbols dynamically at run-time)?

Olivier


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

Olivier Bélanger

unread,
Sep 2, 2021, 8:16:12 PM9/2/21
to pyo-d...@googlegroups.com
Hi again!

In the previous message, you said that the object builds....

On Tue, Aug 31, 2021 at 4:53 AM Alexandros <alexdry...@gmail.com> wrote:

Another update. This is the output when typing make:

cc -DPD -I "/usr/include/pd" -DUNIX  -fPIC -I"" -I.. -Wno-cast-function-type -Wno-unused-parameter -I/usr/include/python3.9 -I/usr/include/python3.9  -Wno-unused-result -Wsign-compare -g -ffile-prefix-map=/build/python3.9-1n6GrT/python3.9-3.9.5=. -flto=auto -ffat-lto-objects -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector -Wformat -Werror=format-security  -DNDEBUG -g -fwrapv -O3 -Wall -Wall -Wextra -Wshadow -Winline -Wstrict-aliasing -O3 -ffast-math -funroll-loops -fomit-frame-pointer -march=core2 -mfpmath=sse -msse -msse2 -msse3 -o pyo~.o -c pyo~.c
make: *** No rule to make target 'm_pyo.o', needed by 'pyo~.pd_linux'.  Stop.


... but this says it is not. Maybe a typo in the Makefile?

Olivier
 
You received this message because you are subscribed to the Google Groups "pyo-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyo-discuss/95465e45-970a-8a21-e3b4-615a642c57b6%40gmail.com.
Reply all
Reply to author
Forward
0 new messages