-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Link wechat_qrcode with libiconv on MinGW #2931
Conversation
Iconv isn't automatic on all systems, non-POSIX have a separate libiconv that needs to be found in CMake and linked.
unfortunately, it does not work "out-of-the-box" here ;( (from cmake-gui, configure) i do have libiconv.a in C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\x86_64-w64-mingw32\lib
so, does it look for an "external package" ? any idea, how to "debug" it ? please also note, that the buildbots don't have any mingw installed, and thus won't check |
libiconv is I suppose the question is, what to do if iconv is not available? We could just disable iconv in the module, as you'd previously been doing... since I guess it can be built without it (though what effect that has on functionality isn't clear to me)... or, we could disable the entire module in the build, as not being usable due to the missing dependency. |
what does one have to do, exactly ?
i don't like that idea (esp. given, that it works fine without)
hmm, both 7.2.0 and 8.1.0 versions have it here,
but this is painful. we cannot expect noobs to dig 4 levels deep into their compiler installation to find those things |
Yeah, I agree the need to dig iconv out from that path is a bridge too far, when installed via the MSYS2 package
That's interesting, actually — I wonder if that means it's finding that (weirdly buried) library using ...Huh, there is a I thought maybe there was some implicit automatic fallback to Well, all of this is sort of tangential. As you say, obviously we can't be expecting users to direct CMake to I'll update the PR with that change. |
That should do it. Though, turns out I can't easily test that change... the MSYS2 |
indeed, it does, all fine here :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello , to add this to opencv Fedora package, I need clarification on license of content on https://github.com/WeChatCV/opencv_3rdparty . These models are patent free ? and what license they have ? Thank you |
@sergiomb2 Given that there's no license statement at that repo, I don't think that's a question anyone but @dddzg (the author of nearly all commits related to WeChat + OpenCV, and uploader of the model files) can answer. The checked-in code is all licensed under Apache 2.0, so maybe the intent is that the models would be licensed the same way... but no way that's explicit enough to satisfy legal. Without a license file in that repo, it's pretty much in limbo. Even a clarification statement here would be unlikely to fly. I suppose someone could submit a PR to WeChatCV/opencv_3rdparty, adding an Apache 2.0 license file to the repo, and see if it gets merged. That would presumably count as clarification/agreement. Otherwise, perhaps the package can contain a download script the user can use to retrieve the models themselves? Has legal ever ruled on whether they'd be OK with that? |
what user download in his computer, is not a concern . |
Licensing discussion should be in initial patch: #2821 Whole repo license for opencv_3rdparty is not possible due to different content (repo is a collection of 3rdparty dependencies or files or models). |
@alalek Yeah, I don't see that there was much discussion there, either. If the repo can't be licensed homogeneously, that's fine, different licenses can apply to different branches/directories/datasets. Heck, tools like reuse make it possible to have a different license for each individual file in a repo. Reuse also requires that some license be explicitly documented for every file in a project's repo, which is one of its big advantages. Mystery-license repos like WeChatCV/opencv_3rdparty are minefields, and "everything doesn't have the same license" still isn't any kind of reason not to have clear licensing. I looked at a bunch of the branches there, and not a single one included a license file, OR any license statement in the README. |
It depends: https://github.com/opencv/opencv_3rdparty/tree/ffmpeg/4.x Anyway, we should go to #2821 or create a new issue and ask @dddzg (contribution author) for clarification with model licenses. |
This PR is an alternate approach that fixes #2862, and partially reverts #2916 (with original submitter @berak's approval).
Instead of disabling
wechat_qrcode
's use oficonv
in MinGW environments, the module simply needs to be linked with the external librarylibiconv
, which is packaged and available as part of the MSYS2 collection.(On POSIX systems
iconv
is built into libc, but on others it's provided by an external library.)Fortunately, since CMake 3.11 the standard module
FindIconv.cmake
has been included in the distribution that can handle linking with libiconv if necessary on the target system.The use of
FindIconv.cmake
is safe on POSIX systems; on my Fedora box it simply noted that iconv is built in to the C library and fell through harmlessly:Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
N/A:
Patch to opencv_extra has the same branch name.