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

SoapySDR build failure on Python 3.8 #228

Closed
mdomsch opened this issue Jun 3, 2019 · 10 comments
Closed

SoapySDR build failure on Python 3.8 #228

mdomsch opened this issue Jun 3, 2019 · 10 comments

Comments

@guruofquality
Copy link
Contributor

From the log it looks like SoapySDR is just not getting linked to python. I think this is a fedora bug in python3-config, for example, python3 on ubuntu 18.04 reports the link libraries including libpython:

python3-config --ldflags
-L/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu -L/usr/lib -lpython3.6m -lpthread -ldl  -lutil -lm  -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions

But on Fedora its only showing:

-L/usr/lib64  -lcrypt -lpthread -ldl  -lutil -lm -lm

Your other option is to pass an acceptable -DPYTHON3_LIBRARY=path_to_the_lib to cmake

@hroncok
Copy link

hroncok commented Jun 3, 2019

Python 3.8 no longer builds extension modules against libpython. See https://docs.python.org/dev/whatsnew/3.8.html#debug-build-uses-the-same-abi-as-release-build

@guruofquality
Copy link
Contributor

guruofquality commented Jun 3, 2019

On the other hand, pkg-config python3.8 --libs no longer contains -lpython3.8. C extensions must not be linked to libpython

Weird, ok. So I think the issue is that I need to remove -Wl,--no-undefined to stop all of those linker errors. And then presumably everything will work at runtime because of python3.8 having these special properties. (The no-undefined was useful with previous python versions to catch stuff like this) Assuming that is the problem anyway...

Is anyone in a state where they can test the removal of this flag on python3.8?

@hroncok
Copy link

hroncok commented Jun 3, 2019

We have an older version in Fedora, but sedding it out of SoapySDRConfig.cmake works:

sed -i 's/ -Wl,--no-undefined//g' cmake/Modules/SoapySDRConfig.cmake

@mdomsch
Copy link
Author

mdomsch commented Jun 3, 2019

I've built 0.7.1 into Fedora rawhide (will be 31) with the above patch that removes -Wl,--no-undefined in the spec file, before the build commences. This built properly.

@guruofquality
Copy link
Contributor

Follow up question, after it built did the module import? This simple command line should do it, should echo 0

python3 -c "import SoapySDR" && echo $?

@hroncok
Copy link

hroncok commented Jun 3, 2019

yes (with SoapySDR-0.6.1-4.20180806gite694813.fc31 Fedora package)

@hroncok
Copy link

hroncok commented Jun 3, 2019

same with 0.7.1

@guruofquality
Copy link
Contributor

I removed this flag on the maint branch which will be tagged as 0.7.2 and on the master for future major releases.

@mdomsch mdomsch closed this as completed Jun 4, 2019
@mdomsch
Copy link
Author

mdomsch commented Jun 4, 2019

Thank you for the speedy investigation and solution.

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

3 participants