goToMain / libosdp

Implementation of IEC 60839-11-5 OSDP (Open Supervised Device Protocol); provides a C library with support for C++, Rust and Python3
https://libosdp.sidcha.dev
Apache License 2.0
134 stars 71 forks source link

integrating into yocto. #64

Closed mmohtashamirad closed 3 years ago

mmohtashamirad commented 3 years ago

Hello, I'm trying to integrate the library into a yocto cmake project as it's instructed in user manual. the problem is that I'm able to compile the same project in ubuntu and manually cross compile it for the target. but when it comes to yocto bitbake, it fails because it's compiling the libosdp for the host, not for target. does anyone have any idea about it?

sidcha commented 3 years ago

You’d have to export cross compilers before invoking cmake. Did you have a look at https://libosdp.gotomain.io/libosdp/cross-compiling.html?

Even though it’s not something that you can directly use, it’s a good starting point on what the library expects in order to be cross compiled.

On Thu 15. Jul 2021 at 05:05, mmohtashamirad @.***> wrote:

Hello, I'm trying to integrate the library into a yocto cmake project as it's instructed in user manual. the problem is that I'm able to compile the same project in ubuntu and manually cross compile it for the target. but when it comes to yocto bitbake, it fails because it's compiling the libosdp for the host, not for target. does anyone have any idea about it?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/goToMain/libosdp/issues/64, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAW3LGIDOARX2HDWJQHZYNLTXZF6RANCNFSM5AMUPS3Q .

mmohtashamirad commented 3 years ago

You’d have to export cross compilers before invoking cmake. Did you have a look at https://libosdp.gotomain.io/libosdp/cross-compiling.html? Even though it’s not something that you can directly use, it’s a good starting point on what the library expects in order to be cross compiled. On Thu 15. Jul 2021 at 05:05, mmohtashamirad @.***> wrote: Hello, I'm trying to integrate the library into a yocto cmake project as it's instructed in user manual. the problem is that I'm able to compile the same project in ubuntu and manually cross compile it for the target. but when it comes to yocto bitbake, it fails because it's compiling the libosdp for the host, not for target. does anyone have any idea about it? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#64>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAW3LGIDOARX2HDWJQHZYNLTXZF6RANCNFSM5AMUPS3Q .

Thanks for your answer, Sidcha. I already checked all parts of the manual pages. In yocto, you don't need to set cross compiler. It's done automatically. Actually, the main project is compiled for target, but only libosdp is being compiled for host.

sidcha commented 3 years ago

@mmohtashamirad, can you give me some link/steps/reproducer to reproduce the problem locally? Did you have to make some changes to LibOSDP to get to where you are?

I'm not super familiar with Yocto and and there isn't much to go on here :)

mmohtashamirad commented 3 years ago

Sure, I will try to provide you some guidance alongside with needed materials to build yocto and compile a simple osdp application using your library here. it takes a while for me to do so. I'll let you know when it's ready. also about the question "Did you have to make some changes to LibOSDP to get to where you are?": I haven't made any changes to your source code yet. and I think the best would be not to make any change to your library to keep it intact.

sidcha commented 3 years ago

Ping?

sidcha commented 3 years ago

@mmohtashamirad, feel free to reopen when you have something I can look into.

xJurgen commented 3 years ago

We had same issue with integrating libosdp in yocto. If you have "recipe-sysroot-native" in line "Found OpenSSL" (in do_configure cmake log), you have to change it to just "recipe-sysroot" We solved it by adding openssl in recipe dependencies and now everything compiles accordingly.

DEPENDS += "openssl"

Also we compile only libraries, so we added EXTRA_OECMAKE option in recipe aswell

EXTRA_OECMAKE += "-DCONFIG_OSDP_LIB_ONLY:BOOL=ON"

sidcha commented 3 years ago

@xJurgen, Thanks for letting us know. Please feel free to raise a PR for any changes needed to the library to make it easy for integration into yocto.

If you think that your yocto recipe can be helpful for others, you can send a PR for that too. There a misc directory to have configuration files.