opencv_contrib
opencv_contrib copied to clipboard
Build fails on compilation of Julia bindings -- `Mirrored types (marked with IsMirroredType) can't be added`
System Information
OpenCV version: 4.8.0 Operating System / Platform: Ubuntu 22.04.2 LTS (WSL2) Compiler & compiler version: GCC 11.3.0
Detailed description
Error while compiling Julia bindings (using CxxWrap
version 0.9.7):
In file included from <path>/libcxxwrap-julia/include/jlcxx/jlcxx.hpp:15,
from <path>/opencv-4.8.0/build/modules/julia/gen/autogen_cpp/cv_core.cpp:7:
<path>/libcxxwrap-julia/include/jlcxx/module.hpp: In instantiation of ‘jlcxx::TypeWrapper<T> jlcxx::Module::add_type_internal(const string&, JLSuperT*) [with T = cv::RotatedRect; SuperParametersT = jlcxx::ParameterList<>; JLSuperT = _jl_datatype_t; std::string = std::__cxx11::basic_string<char>]’:
<path>/libcxxwrap-julia/include/jlcxx/module.hpp:1222:48: required from ‘jlcxx::TypeWrapper<T> jlcxx::Module::add_type(const string&, JLSuperT*) [with T = cv::RotatedRect; SuperParametersT = jlcxx::ParameterList<>; JLSuperT = _jl_datatype_t; std::string = std::__cxx11::basic_string<char>]’
<path>/opencv-4.8.0/build/modules/julia/gen/autogen_cpp/cv_core.cpp:246:30: required from here
<path>/libcxxwrap-julia/include/jlcxx/module.hpp:1144:17: error: static assertion failed: Mirrored types (marked with IsMirroredType) can't be added using add_type, map them directly to a struct instead and use map_type or explicitly disable mirroring for this type, e.g. define template<> struct IsMirroredType<Foo> : std::false_type { };
Could possibly be related to this CxxWrap
issue, but I'm not familiar enough with the code to say: https://github.com/JuliaInterop/CxxWrap.jl/issues/271
Steps to reproduce
I built CxxWrap
following the instructions here: https://docs.opencv.org/4.x/d8/da4/tutorial_julia.html. That all completed successfully.
I configured OpenCV using -D WITH_JULIA=ON
.
The build failed.
Issue submission checklist
- [X] I report the issue, it's not a question
- [X] I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
- [X] I updated to the latest OpenCV version and the issue is still there
- [X] There is reproducer code and related data files (videos, images, onnx, etc)
The issue transferred to opencv_contrib as all Julia related things are hosted there.
@archit120 Could you take a look on it?
Hi, I have similar problem. environment: Ubuntu 22.04 .... -- Found Julia executable: /home/User/julia/bin/julia -- Julia_VERSION_STRING: 1.6.7 -- Julia_INCLUDE_DIRS: /home/User/julia/include/julia -- Julia_LIBRARY_DIR: /home/User/julia/lib -- Julia_LIBRARY: /home/User/julia/lib/libjulia.so.1 -- JULIA_HOME: /home/User/julia/bin -- Julia_LLVM_VERSION: v11.0.1 -- Julia_WORD_SIZE: 64 -- JlCxx_DIR: /home/User/.julia/artifacts/c26cbccbc5075a22f2b34a08dd9c9ad52d58f381/lib/cmake/JlCxx ....
Consolidate compiler generated dependencies of target opencv_julia
[ 89%] Building CXX object modules/julia/CMakeFiles/opencv_julia.dir/gen/autogen_cpp/cv_core.cpp.o
In file included from /home/User/.julia/artifacts/c26cbccbc5075a22f2b34a08dd9c9ad52d58f381/include/jlcxx/jlcxx.hpp:15,
from /home/User/opencv/build/modules/julia/gen/autogen_cpp/cv_core.cpp:7:
/home/User/.julia/artifacts/c26cbccbc5075a22f2b34a08dd9c9ad52d58f381/include/jlcxx/module.hpp: In instantiation of ‘jlcxx::TypeWrapper<T> jlcxx::Module::add_type_internal(const string&, JLSuperT*) [with T = cv::RotatedRect; SuperParametersT = jlcxx::ParameterList<>; JLSuperT = _jl_datatype_t; std::string = std::__cxx11::basic_string