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

cmake finds incorrect python #2

Open
jamesoncollins opened this issue May 24, 2022 · 7 comments
Open

cmake finds incorrect python #2

jamesoncollins opened this issue May 24, 2022 · 7 comments

Comments

@jamesoncollins
Copy link

While this likely doesn't matter for your project I noticed that find_package(pybind11) in GNU Radio's CMakeList.txt ends up using the wrong python exec (the host, rather than the target).

If the host is 64 bit and the target is 32-bit then you'll get this error:
“Python config failure: Python is 64-bit, chosen compiler is 32-bit”

I believe that, regardless of that error, the compilation of gnuradio will include an -isystem path to the host rather than the target.

@gwbres
Copy link
Collaborator

gwbres commented Jun 27, 2022

Hello @jamesoncollins,

indeed pybind has caused many issues since I naively introduced it back in 2018.
But me and other Buildroot developpers did fix that package as of late 2021.
If you consider upgrading your local BR to 2022.x you will be fine.

I added a specific note to our documentation, regarding python-scipy and sklearn as they require a slightly newer BR revision, compared to what my colleagues recommend for the rest of this repo.

@gwbres gwbres closed this as completed Jun 27, 2022
@jamesoncollins
Copy link
Author

Hm, I am using 2022.02.1. Maybe I just did something else wrong. I'll look into it a bit more.

@gwbres gwbres reopened this Jun 28, 2022
@gwbres
Copy link
Collaborator

gwbres commented Jun 28, 2022

Hello @jamesoncollins,
I'll leave this open for a bit then.

You seem to have a different use case than me and my colleagues.
Personally, I need pybind for scipy, that's why it was submitted to BR (we already had gnuradio for years at that point).
My colleagues use gnuradio all the time, but they don't need scipy.
I'm pretty sure we have never combined the two. I was not aware that gnuradio could take advantage of pybind, that is what's happening if I understand correctly.

Can you elaborate a little more on your configuration? which targetted board? why is pybind activated if you need gnuradio ?

On my side, I can confirm that I have scipy + sklearn properly embedded (no gnuradio), using March 2022.02 BR release. You know your BR is recent enough if it came with a file named buildroot/package/python-pybind/0001-support-staging.patch

hope this helps 😃

@trabucayre
Copy link
Member

@jamesoncollins I confirm, with qemu_x86_defconfig (ie x86_32) I have the same issue. -DPYTHON_EXECUTABLE=$(HOST_DIR)/bin/python3 is required for cross-compile: for some tasks (at build time) python is required but target one can't be used (wrong architecture). for non x86 targets everything is working, but with same architecture and different size no. Seems this use case is not taken into account by pybind or something must be done for the specific situation. I don't know if it's relevant to ask buildroot people or pybind about that.

@gwbres @jamesoncollins try to build gnuradio-3.9 where swig was replaced by pybind.

@gwbres
Copy link
Collaborator

gwbres commented Jun 30, 2022

Hello,
so far all I can confirm is I reproduced the problem by manually selecting pybind and BR 2022.02.1 trying to build gnuradio 3.9.4.0

@gwbres
Copy link
Collaborator

gwbres commented Jul 8, 2022

@trabucayre @jamesoncollins
Ok I did not quite get at first that gnuradio 3.9 (recent) was a new dependent of pybind.
I mentionned scipy in the above, thinking you were combining the two.

If i'm able to build the scipy suite on an architecture that fails at gnuradio3.9, would not this demonstrate that the problem lies in how gnuradio 3.9 operates pybind?

@trabucayre
Copy link
Member

@jamesoncollins with a bit a delay: I have updated gnuradio package. Content is similar to the patch send to the mainline to bump gnuradio to version 3.10.4.
Now issues with pybind seems fixed and no more errors when target and host have not the same size.

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