-
Notifications
You must be signed in to change notification settings - Fork 318
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
Cross compiling with python bindings fails #561
Comments
The bindings have to be able to find the library, which is also required to build the doc. We need some more information about how you are actually buildings things. -Travis |
I'm building libiio with yocto. The build platform is my x86_64 laptop, the target platform is a z7000 board. The bindings will be able to load libiio on the target platform, but it is not possible on the build platform at install time. I'm not building the documentation for the target platform, so did not notice this. I've seen in the cmake_install files that there is a CMAKE_CROSSCOMPILING variable that is correctly set to TRUE, but did not yet figured out how to properly inject this in the "execute_process" call, or if this is really the right thing to do : there seems to be some caveats in using this variable, see cmake doc For now I've just patched the setup.py to comment the Strangely also, I needed to dive into the install logs to figure all this out since the "setup.py install" target actually does not fail. It just spits out error in the logs. It exits with success, and just does not install the bindings files. |
I'm assuming you are enabling python bindings with PACKAGECONFIG?
That looks like a problem of the |
Yes
This line obviously cannot succeed on the build host.
Either |
Yeah, this can be problematic for build systems as yocto. I would need to further investigate to check if there's anything that can be done in yocto to workaround this. One thing that comes to my mind is that if |
@nunojsa The reason that check exists is for the pypi package. When the pypi package installs it will look to make sure the library has been installed first, if not it will tell the users where to get it. The pypi package is the dominant use case for python support. -Travis |
I think @balister owes me a couple minutes for some hardware I gave him; and groks yocto pretty well. Phil? Any pointers? |
Can someone look for me on irc (Crofton) in #oe when I wake up? I thought there was an existing libiio recipe, but I am guessing it is built without python bindings. |
Use the cmake CROSSCOMPILING to bypass checks for packages installed in the build python that are only needed at runtime. One could install a -native version into the sysroot python, but easier to bypass the check and let the recipe define the DEPENDS for the package. |
@balister; thanks for the pointer - I think the doc says we should be able to do things like: https://github.com/gottingen/carbin-py/blob/master/carbin/prefix.py#L182 but that would just turn off sphinx when building with the python bindings. (which might be all that is needed?) |
Is there a reason why ADI is not using (or at least appending to) the meta-oe variant of the recipe referred to by @julienmalik ? I assume this is the variant most of us are using and thus serves as a "common ground"... |
@nunojsa yes, I am thinking of of meta-adi - glad to hear it is on the roadmap 👍 |
This should fix analogdevicesinc#561 Signed-off-by: Julien Malik <[email protected]>
closing, based on the merged PR #576 |
Commit 21023a5#diff-72e868772be40795455997094ac5215e now prevents cross compilation of python bindings.
The InstallWrapper class added in said commit tries to load the libiio shared lib during python wrapper installation. This obviously fails when cross compiling for different architecture, raising an expected OSError exception instead.
The text was updated successfully, but these errors were encountered: