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

Errors with homebrew python3 after successful compilation #6

Open
shakfu opened this issue Nov 24, 2021 · 2 comments
Open

Errors with homebrew python3 after successful compilation #6

shakfu opened this issue Nov 24, 2021 · 2 comments

Comments

@shakfu
Copy link

shakfu commented Nov 24, 2021

I compiled flext successfully and used the following to build py without errors (python3.9 is installed via homebrew):

NP_INCL=`python3 -c "import numpy; print(numpy.get_include())"`
make CPPFLAGS="-I ../flext/source -DPY_NUMPY" \
     CFLAGS="-mmacosx-version-min=10.9 `python3-config --cflags` -I $NP_INCL" \
     LDFLAGS="-mmacosx-version-min=10.9 `python3-config --ldflags`"

After trying to run in PD, I get the following errors:

pyext simple ex3
... couldn't create
/Users/me/py/py.pd_darwin: dlopen(/Users/me/py/py.pd_darwin, 10): Symbol not found: _PyCapsule_Type
  Referenced from: /Users/me/py/py.pd_darwin
  Expected in: flat namespace
 in /Users/me/py/py.pd_darwin
 py script strcat
... couldn't create
/Users/me/py/py.pd_darwin: dlopen(/Users/me/py/py.pd_darwin, 10): Symbol not found: _PyCapsule_Type
  Referenced from: /Users/me/py/py.pd_darwin
  Expected in: flat namespace
 in /Users/me/py/py.pd_darwin
 py script addall
... couldn't create
/Users/me/py/py.pd_darwin: dlopen(/Users/me/py/py.pd_darwin, 10): Symbol not found: _PyCapsule_Type
  Referenced from: /Users/me/py/py.pd_darwin
  Expected in: flat namespace
 in /Users/me/py/py.pd_darwin
 py script
... couldn't create
/Users/me/py/py.pd_darwin: dlopen(/Users/me/py/py.pd_darwin, 10): Symbol not found: _PyCapsule_Type
  Referenced from: /Users/me/py/py.pd_darwin
  Expected in: flat namespace
 in /Users/me/py/py.pd_darwin
 py script strlen
... couldn't create
/Users/me/py/py.pd_darwin: dlopen(/Users/me/py/py.pd_darwin, 10): Symbol not found: _PyCapsule_Type
  Referenced from: /Users/me/py/py.pd_darwin
  Expected in: flat namespace
 in /Users/me/py/py.pd_darwin
 py script ret3
... couldn't create

Furthermore, running otool -L on the external shows that its not linked to any python lib:

$ otool -L py.pd_darwin
py.pd_darwin:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1677.104.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 902.1.0)

Any ideas on what to do next?

@shakfu shakfu changed the title gk Errors with homebrew python3 after successful compilation Nov 27, 2021
@grybouilli
Copy link

If you use cmake, I made a fork & pull request with linking reinforcement which may solve your problem.

Otherwise, I'd advise you to look for the following line in the pd-lib-builder/Makefile.pdlibbuilder file:

cxx.ldlibs := -lc -lm -lstdc++

and add -lpython3.9. (Try several placement as linkers are sensitive to that).

But even then, things may not work (python will show up with otool -L tho); you might need to set the rpath of the py.pd_linux to point to where your libpython3.9.so file is located.

@shakfu
Copy link
Author

shakfu commented Jun 29, 2023

@grybouilli Thanks for your response. I will revisit this and see how it goes.

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