-
Notifications
You must be signed in to change notification settings - Fork 19
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
if libusb is used -- LGPL licensing causes static/dynamic compile flags, doc updates, etc. #37
Comments
Thanks for creating a separate "thread" for this issue I agree on the points - initially I intend to expose static libusb only through a specific option, so it will always require an "opt-in" behavior to have libusb statically linked. Will also add a licensing section to the docs (CC: @Erol444 ping me once you have a slice of time available for this please)
Please do, that'd be great - right now the core is already buildable with libusb used in this manner (but static currently). The branch is
Note, the above snippet is untested If you want, you may test out the approach there. Also, when installing core, the DLL/so will be pulled to |
@themarpe hi, I see progress on above PR. Is it to a point where I can start looking into the issue of controlling where Windows looks for the libusb.dll? Such functionality is needed by my app and others like Unreal, Unity, etc. where the main EXE is in a different path than the install location for the depthai-core DLL/plugin/app. Windows looks in a very tightly controlled series of paths (e.g. where the main EXE is located). Therefore when Windows OS searches for the libusb.dll to load (due to linking dynamically due to LGPL), Windows likely won't find libusb.dll because the OS doesn't know to look in the depthai-core install location. I've got code that resolves that issue, but I need your stable approach/code to fully understand how depthai-core loads xlink loads libusb. :-) |
Hi @diablodale Would be awesome to get your input and approach on these Also, by default a shared library is built, so LGPL details can be left as is. In some cases it'd be nicer to have it be a static library, but I think this should suffice for now |
I quick read luxonis/depthai-core#410
|
Correct - if static is specified, everything should work as is as well, but for licensing reasons, we'll leave it shared by default.
I agree, it puts other things accessible and before any other PATH directories as well. This is mostly an "just running tests" approach - I'm up for change For core (c++), no. For bindings, there is an explicit copy of the dll to the output directory as the mechanism by which CPython loads shared libs doesn't allow searching through PATH, etc...
Correct - its essentially private dependency of XLink (could be made private). libusb_init() is done at XLinkInitialize stage as well before other functions are called. Main app aside (either exe/dll), core can be both static or shared /w XLink and other dependencies all being static (for now, could be changed, but we'd have to deal with those dlls as well) and having libusb be only a shared library (if its decided to be static, then it would be supported as is already). And yes for python bindings, those are bindings:dll, core,et al:static, libusb:dll. |
I have a working prototype. Would appreciate feedback. xlink
depthai-core
|
made PRs to Luxonis PR branches and updated post above with links |
Thanks - left feedback in appropriate PRs. |
Introducing libusb obj/binary code into the depthai project, distributing it, etc. introduces libusb's LGPL licensing.
https://www.gnu.org/licenses/gpl-faq.html#LGPLStaticVsDynamic
I like tools that "help keep honest people honest". And to help prevent accidents.
I request tools/processes in depthai to manage the inclusion/flags of dependencies that have restrictive licensing (libusb is just the first one...)
@themarpe writes
I am in aligment with that (as a non-lawyer).
Suggested work
BUILD_SHARED
is already avail, but there will need to be more granularity to specify which components are shared/dynamic and which are static so to comply with licensingrpath
similar behavior. I can help with this. I have mature code 8+ years that does this.FYI, OpenCV has a cmake
OPENCV_ENABLE_NONFREE
. It adjusts the cmake flags/files to help devs be more honest and prevent accidential license issues.The text was updated successfully, but these errors were encountered: