Skip to content

Compilation failed when building Julia bindings #3915

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

Open
4 tasks done
Invalid-Memory opened this issue Mar 31, 2025 · 0 comments
Open
4 tasks done

Compilation failed when building Julia bindings #3915

Invalid-Memory opened this issue Mar 31, 2025 · 0 comments

Comments

@Invalid-Memory
Copy link

System Information

Operating System: Deepin 23 / Linux 6.6.71-amd64-desktop-hwe
OpenCV: 4.12.0
GCC: 12.3.0
Julia: 1.11.2

Detailed description

Compiler reported compilation errors that appear to originate from the Julia bindings when building OpenCV. The last five lines of make output before the error occurred are as follows:

[ 80%] Built target ade
[ 86%] Built target opencv_gapi
[ 90%] Built target opencv_test_gapi
[ 91%] Built target opencv_perf_gapi
[ 91%] Building CXX object modules/julia/CMakeFiles/opencv_julia.dir/gen/autogen_cpp/cv_core.cpp.o

Due to the excessive length of the error messages, the complete compiler output has been saved in err.log. Below are the errors in it:

$ grep ": error:" ./err.log 
/usr/local/src/opencv/build/modules/julia/gen/autogen_cpp/jlcxx/array.hpp:192:66: error: macro "jl_array_data" requires 2 arguments, but only 1 given
/usr/local/src/opencv/build/modules/julia/gen/autogen_cpp/jlcxx/array.hpp:197:72: error: macro "jl_array_data" requires 2 arguments, but only 1 given
/usr/local/src/opencv/build/modules/julia/gen/autogen_cpp/jlcxx/array.hpp:202:66: error: macro "jl_array_data" requires 2 arguments, but only 1 given
/usr/local/src/opencv/build/modules/julia/gen/autogen_cpp/jlcxx/array.hpp:207:72: error: macro "jl_array_data" requires 2 arguments, but only 1 given
/usr/local/src/opencv/build/modules/julia/gen/autogen_cpp/jlcxx/array.hpp:224:45: error: macro "jl_array_data" requires 2 arguments, but only 1 given
/usr/local/src/opencv/build/modules/julia/gen/autogen_cpp/jlcxx/array.hpp:229:45: error: macro "jl_array_data" requires 2 arguments, but only 1 given
/usr/local/src/opencv/build/modules/julia/gen/autogen_cpp/jlcxx/array.hpp:192:43: error: ‘jl_array_data’ was not declared in this scope
/usr/local/src/opencv/build/modules/julia/gen/autogen_cpp/jlcxx/array.hpp:197:49: error: ‘jl_array_data’ was not declared in this scope
/usr/local/src/opencv/build/modules/julia/gen/autogen_cpp/jlcxx/array.hpp:202:43: error: ‘jl_array_data’ was not declared in this scope
/usr/local/src/opencv/build/modules/julia/gen/autogen_cpp/jlcxx/array.hpp:207:49: error: ‘jl_array_data’ was not declared in this scope
/usr/local/src/opencv/build/modules/julia/gen/autogen_cpp/jlcxx/array.hpp:224:22: error: ‘jl_array_data’ was not declared in this scope
/usr/local/src/opencv/build/modules/julia/gen/autogen_cpp/jlcxx/array.hpp:229:22: error: ‘jl_array_data’ was not declared in this scope
/usr/local/src/opencv/build/modules/julia/gen/autogen_cpp/cv_core.cpp:464:92: error: ‘vector_int’ was not declared in this scope; did you mean ‘vector_Mat’?
/usr/local/src/opencv/build/modules/julia/gen/autogen_cpp/cv_core.cpp:464:102: error: template argument 1 is invalid
/usr/local/src/opencv/build/modules/julia/gen/autogen_cpp/cv_core.cpp:464:110: error: expected ‘,’ or ‘...’ before ‘&’ token
/usr/local/src/opencv/build/modules/julia/gen/autogen_cpp/cv_core.cpp:464:131: error: ‘vector_int’ was not declared in this scope; did you mean ‘vector_Mat’?
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/module.hpp:1263:37: 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 { };
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<cv::dnn::dnn4_v20241223::Layer>::Ptr(jlcxx::NoSmartOther&)’
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<const cv::dnn::dnn4_v20241223::Layer>::Ptr(jlcxx::NoSmartOther&)’
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<cv::CLAHE>::Ptr(jlcxx::NoSmartOther&)’
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<const cv::CLAHE>::Ptr(jlcxx::NoSmartOther&)’
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<cv::GeneralizedHoughBallard>::Ptr(jlcxx::NoSmartOther&)’
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<const cv::GeneralizedHoughBallard>::Ptr(jlcxx::NoSmartOther&)’
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<cv::GeneralizedHoughGuil>::Ptr(jlcxx::NoSmartOther&)’
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<const cv::GeneralizedHoughGuil>::Ptr(jlcxx::NoSmartOther&)’
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<cv::StereoBM>::Ptr(jlcxx::NoSmartOther&)’
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<const cv::StereoBM>::Ptr(jlcxx::NoSmartOther&)’
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<cv::StereoSGBM>::Ptr(jlcxx::NoSmartOther&)’
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<const cv::StereoSGBM>::Ptr(jlcxx::NoSmartOther&)’
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<float>::Ptr(jlcxx::NoSmartOther&)’
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<const float>::Ptr(jlcxx::NoSmartOther&)’
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<cv::SimpleBlobDetector>::Ptr(jlcxx::NoSmartOther&)’
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<const cv::SimpleBlobDetector>::Ptr(jlcxx::NoSmartOther&)’
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<cv::Algorithm>::Ptr(jlcxx::NoSmartOther&)’
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<const cv::Algorithm>::Ptr(jlcxx::NoSmartOther&)’
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<cv::IStreamReader>::Ptr(jlcxx::NoSmartOther&)’
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<const cv::IStreamReader>::Ptr(jlcxx::NoSmartOther&)’
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<cv::StereoMatcher>::Ptr(jlcxx::NoSmartOther&)’
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<const cv::StereoMatcher>::Ptr(jlcxx::NoSmartOther&)’
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<cv::GeneralizedHough>::Ptr(jlcxx::NoSmartOther&)’
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<const cv::GeneralizedHough>::Ptr(jlcxx::NoSmartOther&)’
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<cv::Feature2D>::Ptr(jlcxx::NoSmartOther&)’
/home/USR/src/julia/pkgs/libcxxwrap-julia/include/jlcxx/smart_pointers.hpp:48:12: error: no matching function for call to ‘cv::Ptr<const cv::Feature2D>::Ptr(jlcxx::NoSmartOther&)’
/usr/include/c++/12/bits/stl_function.h:408:20: error: no match for ‘operator<’ (operand types are ‘const cv::Rect_<int>’ and ‘const cv::Rect_<int>’)
/usr/include/c++/12/bits/stl_function.h:408:20: error: no match for ‘operator<’ (operand types are ‘const cv::Vec<float, 4>’ and ‘const cv::Vec<float, 4>’)
/usr/include/c++/12/bits/stl_function.h:408:20: error: no match for ‘operator<’ (operand types are ‘const cv::Vec<float, 6>’ and ‘const cv::Vec<float, 6>’)
/usr/include/c++/12/bits/stl_function.h:408:22: error: cannot convert ‘cv::MatExpr’ to ‘bool’ in return
/usr/include/c++/12/bits/stl_function.h:408:20: error: no match for ‘operator<’ (operand types are ‘const cv::Point_<float>’ and ‘const cv::Point_<float>’)
/usr/include/c++/12/bits/stl_function.h:408:20: error: no match for ‘operator<’ (operand types are ‘const cv::Point_<int>’ and ‘const cv::Point_<int>’)
/usr/include/c++/12/bits/stl_function.h:408:20: error: no match for ‘operator<’ (operand types are ‘const std::vector<cv::Mat>’ and ‘const std::vector<cv::Mat>’)
/usr/include/c++/12/compare:1236:41: error: no match for call to ‘(const std::__detail::_Synth3way) (cv::Mat&, cv::Mat&)’
/usr/include/c++/12/bits/stl_function.h:408:20: error: no match for ‘operator<’ (operand types are ‘const std::vector<cv::Point_<float> >’ and ‘const std::vector<cv::Point_<float> >’)
/usr/include/c++/12/compare:1236:41: error: no match for call to ‘(const std::__detail::_Synth3way) (cv::Point_<float>&, cv::Point_<float>&)’
/usr/include/c++/12/bits/stl_function.h:408:20: error: no match for ‘operator<’ (operand types are ‘const cv::Rect_<double>’ and ‘const cv::Rect_<double>’)

About Julia:
I followed the official documentation to set up Julia bindings. The libcxxwrap-julia version is 0.13.4, and the CxxWrap version is 0.16.2.

julia> using CxxWrap
julia> CxxWrap.CxxWrapCore.prefix_path()
"/home/USR/pkgs/julia/lib/packages/jlcxx"

CMake shown that:

--   JULIA:                         YES
--     Julia_EXECUTABLE:            /home/USR/pkgs/julia/bin/julia
--     JlCxx_DIR:                   /home/USR/pkgs/julia/lib/packages/jlcxx

Steps to reproduce

mkdir ./build
cd ./build
cmake .. -DCMAKE_BUILD_TYPE=Release -DWITH_JULIA=ON -DJulia_EXECUTABLE=/home/USR/pkgs/julia/bin/julia -DOPENCV_EXTRA_MODULES_PATH=../contrib/modules
make # failed

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)
@opencv-alalek opencv-alalek transferred this issue from opencv/opencv Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants