-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[aravis] add new port (+add to OpenCV 4 as optional feature) #42351
base: master
Are you sure you want to change the base?
Conversation
ports/opencv4/vcpkg.json
Outdated
"aravis": { | ||
"description": "aravis", | ||
"dependencies": [ | ||
"aravis" |
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.
Enable opt-out from usb.
"aravis" | |
{ | |
"name": "aravis", | |
"default-features": false | |
} |
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.
then it might be better to leave usb
away as a default feature from aravis? i now went with that option to stay aligned with aravis (though i think they make it dependent on the availability of the library by default since they set it to auto
)
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.
vcpkg will install aravis' default feature by default. This change enables the user to explicitly request installation of aravis without default features.
include(FindPkgConfig) | ||
pkg_search_module(Aravis REQUIRED aravis-0.8) | ||
if (Aravis_FOUND) | ||
set(Aravis_LIBS "aravis-0.8") | ||
endif() |
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.
This wrapper is pointless and not working correctly.
The code should be added to the consuming projects instead.
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.
without this wrapper i can't do find_package(Aravis REQUIRED)
- i didn't find any documentation on how to resolve this (even vcpkg-cmake-wrapper.cmake
is undocumented beyond the fact that it may exist). how else would you solve this?
ports/aravis/usage
Outdated
The aravis package provides CMake targets: | ||
|
||
find_package(aravis REQUIRED) | ||
target_link_libraries(main PRIVATE ${Aravis_LIBRARIES}) |
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.
Don't add a usage
file here. The tool generates the desired information heristically for pkg-config.
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.
ok, i've removed it.
but then it just says:
aravis provides pkg-config modules:
# Camera control and image acquisition library
aravis-0.8
isn't this less helpful than having a clear example on what to do (as is e.g. the case with the usage
i had provided)?
ed919f4
to
16cbe1d
Compare
51a354c
to
69fffe6
Compare
@dg0yt: thanks a lot for your super fast review! i now have one last CI failure in the android CI builds which i don't know how to solve:
based on labstreaminglayer/liblsl-Android#4 (unrelated library, just found the error description there) this is caused when using a too-old Android NDK as these methods were implemented more recently (Android NDK 24, see also the source code). is there a way to force the CI to build with a newer android SDK version for this port (though the log file does talk about also, i just got this result on windows in the CI:
i guess i do need to add a patch for the build after all to skip generating these bins (at least until it's done in upstream)? |
The Android problem is not the NDK (vcpkg CI has r27c) but the API level (vcpkg uses 21 as default). |
For the executables in |
69fffe6
to
bb39fe6
Compare
would you mind adding aravis feature to the vcpkg-ci-opencv port, so that it is tested in CI? |
it seems that OpenCV doesn't find Aravis on Windows with their
i've added it (as a dedicated entry due to having to add |
Unfortunately, the CI failure logs weren't uploaded. |
here's the relevant excerpt from
aravis itself was installed successfully (and i can find it in
|
i am trying to reproduce it locally on my computer. If I will find any solution, I will ask your permission to push to your vcpkg fork |
ok I have a patch. Can I push to your fork? please add me as a contributor to https://github.com/rursprung/vcpkg or add this patch
|
then it complains about missing to better speed up the work, please let me be a contributor to your fork so that i can quickly add everything that i find |
thank you for looking into this! i've added you as a collaborator. is flagging the dependencies as |
detect_aravis.cmake should be called only if aravis is required. And in that case those findings are required, not optional, so that's the rationale adopted also in other opencv patches |
This patch worked for me:
|
added the patch so that you know the current state of art. We will need to work on the aravis_libraries list and append missing glib ones to fully fix the link errors |
drastically simplified (does not even need a new patch anymore and it builds here) |
Ah, I forgot to add a note. The linker line has everything which is need. However, the linux toolchain has what CMake calls a "traditional linker": The order of static libraries matters. But here CMake doesn't provide link libs correctly. We have seen this before, and we don't know the exact triggers :-( Unfortunately, I can't provide more help ATM. |
i have the same error in my opencv PR |
What is blocking this from being merged to vcpkg? I would be so happy to have this available and thank you all for your great work in this! |
This PR depends on #42371 |
I hope #42371 can be merged soon, so then rebasing this PR on master should fix the error and let also this one come in :) |
@rursprung my PR has been merged, i fixed conflicts here, let's hope for a green flag from CI :) |
thanks a lot @cenit! i saw the other PR getting merged (great works, thanks for keeping on it for that long!) and was about to rebase this PR here, but you beat me to it |
you can undraft this one, so that if the flag is green it can be accepted asap |
i've marked it ready for review + rebased it due to "This branch must not contain merge commits.". the verify ran through successfully before, so it should be fine now 🤞 note: i do not have access to an aravis-compatible camera anymore (neither USB vision nor GigE vision), so i can't re-test the actual functionality after the rebase! hopefully someone with such a camera could re-test this? (@thjordanatlas: based on your comment you seem to have such a camera since you would like to use this - could you maybe give this PR a try? thanks!) |
@rursprung, on behalf of @thjordanatlas: |
Sorry for the late reply, I am busy with other projects, but will try as soon as I can and give feedback. Thank you for work work! |
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.
The port aravis[fast-heartbeat,packet-socket,usb]
, opencv[aravis]
installation tests pass with the following triplets:
- x64-linux
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.
Can you just double check the license? Thanks for the new port!
94104a3
to
dca9244
Compare
Co-Authored-By: Stefano Sinigardi <[email protected]>
dca9244
to
b218dbc
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
There is no gobject-introspection support for the debug build type in vcpkg.
list(APPEND OPTIONS -Dviewer=disabled) | ||
list(APPEND OPTIONS -Dgst-plugin=disabled) |
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.
list(APPEND OPTIONS -Dviewer=disabled) | |
list(APPEND OPTIONS -Dgst-plugin=disabled) | |
set(OPTIONS "") | |
set(OPTIONS_RELEASE "") |
list(APPEND OPTIONS -Dfast-heartbeat=false) | ||
endif() | ||
if("introspection" IN_LIST FEATURES) | ||
list(APPEND OPTIONS -Dintrospection=enabled) |
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.
list(APPEND OPTIONS -Dintrospection=enabled) | |
list(APPEND OPTIONS_RELEASE -Dintrospection=enabled) | |
else | |
list(APPEND OPTIONS_RELEASE -Dintrospection=disabled) |
SOURCE_PATH | ||
"${SOURCE_PATH}" | ||
OPTIONS | ||
${OPTIONS} |
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.
${OPTIONS} | |
${OPTIONS} | |
-Dviewer=disabled | |
-Dgst-plugin=disabled | |
OPTIONS_RELEASE | |
${OPTIONS_RELEASE} | |
OPTIONS_DEBUG | |
-Dintrospection=disabled |
list(APPEND OPTIONS -Dintrospection=enabled) | ||
endif() | ||
|
||
set(GLIB_TOOLS_DIR "${CURRENT_HOST_INSTALLED_DIR}/tools/glib") |
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.
set(GLIB_TOOLS_DIR "${CURRENT_HOST_INSTALLED_DIR}/tools/glib") | |
set(GLIB_TOOLS_DIR "${CURRENT_HOST_INSTALLED_DIR}/tools/glib") | |
set(GIR_TOOLS_DIR "${CURRENT_HOST_INSTALLED_DIR}/tools/gobject-introspection") | |
if(CMAKE_HOST_WIN32 AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") | |
set(GIR_TOOLS_DIR "${CURRENT_INSTALLED_DIR}/tools/gobject-introspection") | |
endif() |
${OPTIONS} | ||
ADDITIONAL_BINARIES | ||
"glib-mkenums='${GLIB_TOOLS_DIR}/glib-mkenums'" | ||
"glib-compile-resources='${GLIB_TOOLS_DIR}/glib-compile-resources${VCPKG_HOST_EXECUTABLE_SUFFIX}'" |
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.
"glib-compile-resources='${GLIB_TOOLS_DIR}/glib-compile-resources${VCPKG_HOST_EXECUTABLE_SUFFIX}'" | |
"glib-compile-resources='${GLIB_TOOLS_DIR}/glib-compile-resources${VCPKG_HOST_EXECUTABLE_SUFFIX}'" | |
"g-ir-compiler='${GIR_TOOLS_DIR}/g-ir-compiler${VCPKG_HOST_EXECUTABLE_SUFFIX}'" | |
"g-ir-scanner='${GIR_TOOLS_DIR}/g-ir-scanner' |
please note:
aravis
feature introduced in this PR) and it worked finearv-camera-test-0.8
,arv-fake-gv-camera-0.8
,arv-test-0.8
andarv-tool-0.8
) which cannot be disabled at the moment (except with a patch to their build system), i've reported this to upstream: add meson option to build only the library AravisProject/aravis#962. i think they currently don't hurt and it's better if this gets fixed in upstream rather than having a patch here.resolves #37072
resolves #3411
checklist:
find_package
calls are REQUIRED, are satisfied byvcpkg.json
's declared dependencies, or disabled with CMAKE_DISABLE_FIND_PACKAGE_Xxx.vcpkg.json
matches what upstream says.vcpkg.json
matches what upstream says../vcpkg x-add-version --all
and committing the result.