Julia binding is not available for 4.5.4
envgap__opencv__opencv_contrib-3108
01 / FAILURE SIGNATURE
As reported upstream
No identifying execution failure has been captured.
Not a benchmark task.
- In a clean container the reported failure did not reproduce, or the known fix did not make the project run.
02 / ENVIRONMENT RECIPE
- Base commit
49ea8642e1c4486f9dc438b13e2aa732e44d216d- Manifest
modules/julia/CMakeLists.txt- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
opencv/opencv_contrib #3108 · read the original issue
##### System information (version)
- OpenCV => 4.5.4 ( both opencv/opencv_contrib )
- Operating System / Platform => Ubuntu 21.10
- Compiler => clang++-13
##### Detailed description
I try to use Julia binding in ubuntu 21.10.
Julia library is found, but Julia binding is not available for 4.5.4.
I think HAVE_JULIA flag handling should be checked.
cmake Log is below.
```
-- Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_INCLUDE_DIRS) (found version "")
-- Registering hook 'STATUS_DUMP_EXTRA': /home/kmtr/work/opencv_contrib-4.5.4/modules/julia/cmake/hooks/STATUS_DUMP_EXTRA.cmake
-- Found Julia executable: /usr/bin/julia
-- Julia_VERSION_STRING: 1.5.3
-- Julia_INCLUDE_DIRS: /usr/include/julia
-- Julia_LIBRARY_DIR: /usr/lib/x86_64-linux-gnu
-- Julia_LIBRARY: /usr/lib/x86_64-linux-gnu/libjulia.so.1
-- JULIA_HOME: /usr/bin
-- Julia_LLVM_VERSION: v9.0.1
-- Julia_WORD_SIZE: 64
-- Julia not found. Not compiling Julia Bindings. ON
-- Module opencv_ovis disabled because OGRE3D was not found
```
`-- Julia not found. Not compiling Julia Bindings. ON`
This message is shown in opencv_contrib-4.5.4/modules/julia/CMakeLists.txt
It means that HAVE_JULIA is not "YES", but is "ON"
```cmake
if(NOT HAVE_JULIA MATCHES "YES")
message(STATUS "Julia not found. Not compiling Julia Bindings. ${HAVE_JULIA}")
```
"HAVE_JULIA" is set in opencv_contrib-4.5.4/modules/julia/cmake/init.cmake
```cmake
# --- Julia ---
if(WITH_JULIA AND NOT DEFINED Julia_FOUND)
include(${CMAKE_CURRENT_LIST_DIR}/FindJulia.cmake)
if(NOT Julia_FOUND)
message(WARNING "Julia was not found. Disabling Julia bindings...")
ocv_module_disable(julia)
endif()
set(HAVE_JULIA ON)
endif()
```
I grep "HAVE_JULIA". it seems to be better to use "YES".
```
kmtr@kmtr-virtual-machine:~/work$ grep HAVE_JULIA opencv_contrib-4.5.4/ -r
opencv_contrib-4.5.4/modules/julia/CMakeLists.txt:if(NOT HAVE_JULIA MATCHES "YES")
opencv_contrib-4.5.4/modules/julia/CMakeLists.txt: message(STATUS "Julia not found. Not compiling Julia Bindings. ${HAVE_JULIA}")
opencv_contrib-4.5.4/modules/julia/CMakeLists.txt:set(HAVE_JULIA "YES" CACHE STRING ADVANCED)
opencv_contrib-4.5.4/modules/julia/cmake/hooks/STATUS_DUMP_EXTRA.cmake:if(WITH_JULIA OR HAVE_JULIA)
opencv_contrib-4.5.4/modules/julia/cmake/hooks/STATUS_DUMP_EXTRA.cmake: status(" JULIA:" HAVE_JULIA THEN "YES" ELSE "NO")
opencv_contrib-4.5.4/modules/julia/cmake/hooks/STATUS_DUMP_EXTRA.cmake: if(HAVE_JULIA)
opencv_contrib-4.5.4/modules/julia/cmake/hooks/STATUS_DUMP_EXTRA.cmake: if(HAVE_JULIA MATCHES "YES")
opencv_contrib-4.5.4/modules/julia/cmake/init.cmake: set(HAVE_JULIA ON)
```
There are same code in 4.x/5.x/master/next branches.
##### Steps to reproduce
1. (I refer https://docs.opencv.org/4.x/d8/da4/tutorial_julia.html)
2. `sudo apt install julia julia-dev`
3. Download opencv-4.5.4 and opencv_contrib-4.5.4, and expand .
4. Execute cmake with this option.
```
cmake -S opencv-4.5.4 -B build -DCMAKE_CXX_COMPILER=clang++-13 -DOPENCV_EXTRA_MODULES_PATH=./opencv_contrib-4.5.4/modules -DWITH_JULIA=ON
```
##### Issue submission checklist
- [X] I report the issue, it's not a question
- [X] I checked the problem with documentation, FAQ, open issues,
answers.opencv.org, Stack Overflow, etc and have not found solution
- [X] I updated to latest OpenCV version and the issue is still there
- [X] There is reproducer code and related data files: videos, images, onnx, etc
04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]