Skip to content

Julia binding is not available for 4.5.4 #3108

@Kumataro

Description

@Kumataro
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"

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

# --- 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
  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues,
    answers.opencv.org, Stack Overflow, etc and have not found solution
  • I updated to latest OpenCV version and the issue is still there
  • There is reproducer code and related data files: videos, images, onnx, etc

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions