Skip to content
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

Add comment to OpenCV to force rebuild #7941

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cdsousa
Copy link

@cdsousa cdsousa commented Jan 12, 2024

OpenCV.jl is not working in Julia 1.10 (JuliaImages/OpenCV.jl#36).
It seems to have something to do with OpenCV_jll, something like it not being compiled against the newest CxxWrap and libjulia.
Trying a rebuild.

@imciner2
Copy link
Member

Looks like upstream opencv needs to update the Julia modules because the Julia API has changed. The errors being thrown on the 1.11 build are:

[17:45:27] In file included from /workspace/srcdir/build/modules/julia/gen/autogen_cpp/cv_core.cpp:6:
[17:45:27] /workspace/srcdir/build/modules/julia/gen/autogen_cpp/jlcxx/array.hpp:192:66: error: too few arguments provided to function-like macro invocation
[17:45:27]     return iterator(static_cast<julia_t*>(jl_array_data(wrapped())));
[17:45:27]                                                                  ^
[17:45:27] /workspace/destdir/include/julia/julia.h:1132:9: note: macro 'jl_array_data' defined here
[17:45:27] #define jl_array_data(a,t) ((t*)((jl_array_t*)(a))->ref.ptr_or_offset)
[17:45:27]         ^
[17:45:27] In file included from /workspace/srcdir/build/modules/julia/gen/autogen_cpp/cv_core.cpp:6:
[17:45:27] /workspace/srcdir/build/modules/julia/gen/autogen_cpp/jlcxx/array.hpp:197:72: error: too few arguments provided to function-like macro invocation
[17:45:27]     return const_iterator(static_cast<julia_t*>(jl_array_data(wrapped())));
[17:45:27]                                                                        ^
[17:45:27] /workspace/destdir/include/julia/julia.h:1132:9: note: macro 'jl_array_data' defined here
[17:45:27] #define jl_array_data(a,t) ((t*)((jl_array_t*)(a))->ref.ptr_or_offset)
[17:45:27]         ^
[17:45:27] In file included from /workspace/srcdir/build/modules/julia/gen/autogen_cpp/cv_core.cpp:6:
[17:45:27] /workspace/srcdir/build/modules/julia/gen/autogen_cpp/jlcxx/array.hpp:202:66: error: too few arguments provided to function-like macro invocation
[17:45:27]     return iterator(static_cast<julia_t*>(jl_array_data(wrapped())) + jl_array_len(wrapped()));
[17:45:27]                                                                  ^
[17:45:27] /workspace/destdir/include/julia/julia.h:1132:9: note: macro 'jl_array_data' defined here
[17:45:27] #define jl_array_data(a,t) ((t*)((jl_array_t*)(a))->ref.ptr_or_offset)
[17:45:27]         ^
[17:45:27] In file included from /workspace/srcdir/build/modules/julia/gen/autogen_cpp/cv_core.cpp:6:
[17:45:27] /workspace/srcdir/build/modules/julia/gen/autogen_cpp/jlcxx/array.hpp:207:72: error: too few arguments provided to function-like macro invocation
[17:45:27]     return const_iterator(static_cast<julia_t*>(jl_array_data(wrapped())) + jl_array_len(wrapped()));
[17:45:27]                                                                        ^
[17:45:27] /workspace/destdir/include/julia/julia.h:1132:9: note: macro 'jl_array_data' defined here
[17:45:27] #define jl_array_data(a,t) ((t*)((jl_array_t*)(a))->ref.ptr_or_offset)
[17:45:27]         ^
[17:45:27] In file included from /workspace/srcdir/build/modules/julia/gen/autogen_cpp/cv_core.cpp:6:
[17:45:27] /workspace/srcdir/build/modules/julia/gen/autogen_cpp/jlcxx/array.hpp:224:45: error: too few arguments provided to function-like macro invocation
[17:45:27]     return (julia_t*)jl_array_data(wrapped());
[17:45:27]                                             ^
[17:45:27] /workspace/destdir/include/julia/julia.h:1132:9: note: macro 'jl_array_data' defined here
[17:45:27] #define jl_array_data(a,t) ((t*)((jl_array_t*)(a))->ref.ptr_or_offset)
[17:45:27]         ^
[17:45:27] In file included from /workspace/srcdir/build/modules/julia/gen/autogen_cpp/cv_core.cpp:6:
[17:45:27] /workspace/srcdir/build/modules/julia/gen/autogen_cpp/jlcxx/array.hpp:229:45: error: too few arguments provided to function-like macro invocation
[17:45:27]     return (julia_t*)jl_array_data(wrapped());
[17:45:27]                                             ^
[17:45:27] /workspace/destdir/include/julia/julia.h:1132:9: note: macro 'jl_array_data' defined here
[17:45:27] #define jl_array_data(a,t) ((t*)((jl_array_t*)(a))->ref.ptr_or_offset)
[17:45:27]         ^
[17:45:27] In file included from /workspace/srcdir/build/modules/julia/gen/autogen_cpp/cv_core.cpp:6:
[17:45:27] /workspace/srcdir/build/modules/julia/gen/autogen_cpp/jlcxx/array.hpp:192:43: error: use of undeclared identifier 'jl_array_data'
[17:45:27]     return iterator(static_cast<julia_t*>(jl_array_data(wrapped())));
[17:45:27]                                           ^
[17:45:27] /workspace/srcdir/build/modules/julia/gen/autogen_cpp/jlcxx/array.hpp:197:49: error: use of undeclared identifier 'jl_array_data'
[17:45:27]     return const_iterator(static_cast<julia_t*>(jl_array_data(wrapped())));
[17:45:27]                                                 ^
[17:45:27] /workspace/srcdir/build/modules/julia/gen/autogen_cpp/jlcxx/array.hpp:202:43: error: use of undeclared identifier 'jl_array_data'
[17:45:27]     return iterator(static_cast<julia_t*>(jl_array_data(wrapped())) + jl_array_len(wrapped()));
[17:45:27]                                           ^
[17:45:27] /workspace/srcdir/build/modules/julia/gen/autogen_cpp/jlcxx/array.hpp:207:49: error: use of undeclared identifier 'jl_array_data'
[17:45:27]     return const_iterator(static_cast<julia_t*>(jl_array_data(wrapped())) + jl_array_len(wrapped()));
[17:45:27]                                                 ^
[17:45:27] /workspace/srcdir/build/modules/julia/gen/autogen_cpp/jlcxx/array.hpp:224:22: error: use of undeclared identifier 'jl_array_data'
[17:45:27]     return (julia_t*)jl_array_data(wrapped());
[17:45:27]                      ^
[17:45:27] /workspace/srcdir/build/modules/julia/gen/autogen_cpp/jlcxx/array.hpp:229:22: error: use of undeclared identifier 'jl_array_data'
[17:45:27]     return (julia_t*)jl_array_data(wrapped());
[17:45:27]                      ^

The FreeBSD builds are failing because the headers have changed, and so it needs another include statement added to the file:

[16:43:59] /workspace/srcdir/build/3rdparty/ippicv/ippicv_lnx/iw/src/iw_own.c:84:12: error: call to undeclared library function 'memalign' with type 'void *(unsigned long, unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
[16:43:59]     return memalign(iAlign, iSize);
[16:43:59]            ^
[16:43:59] /workspace/srcdir/build/3rdparty/ippicv/ippicv_lnx/iw/src/iw_own.c:84:12: note: include the header <malloc.h> or explicitly provide a declaration for 'memalign'

@cdsousa
Copy link
Author

cdsousa commented Jan 13, 2024

I can confirm that using the new artifact OpenCV.v4.6.0.x86_64-linux-gnu-cxx11-julia_version+1.10.0.tar.gz and OpenCV.jl from JuliaImages/OpenCV.jl#28 seems to fix the issue reported at JuliaImages/OpenCV.jl#36, although it gives an error during precompilation:

  1 dependency had output during precompilation:
┌ OpenCV
│  ┌ Error: Calling `@wrapmodule` with the path of the library to load is no longer supported.
│  │ Pass the name of a function returning the path instead, e.g. use `libfoo_jll.get_libfoo_path` instead of `libfoo_jll.libfoo`.
│  └ @ CxxWrap.CxxWrapCore ~/.julia/packages/CxxWrap/5IZvn/src/CxxWrap.jl:729

@marcoxa
Copy link

marcoxa commented May 31, 2024

Any update on this?

@brianguenter
Copy link

Any update on this? OpenCV throws a precompilation error on my machine for Julia 1.10. I've read in another thread that downgrading Julia 1.9 works but I'd hate to do that if a fix is coming soon.

@giordano
Copy link
Member

If no one resolves the issues discussed above, no.

@marcoxa
Copy link

marcoxa commented Jul 29, 2024

Hi

I explored the issue a bit. AFAIU you must "fix" the binding generation in OpenCV, which is a major (time wise) undertaking, given the - ahem - less than optimal way the OpenCV headers are munched and their representation spewed up. Plus you need knowledge of all the way Julia binds to C++.

All the best

Marco

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants