[Bug 265063] graphics/opencv : Can't load library: /root/.Sikulix/SikulixLibs/libopencv_java430.so

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 06 Jul 2022 14:51:22 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265063

            Bug ID: 265063
           Summary: graphics/opencv : Can't load library:
                    /root/.Sikulix/SikulixLibs/libopencv_java430.so
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: desktop@FreeBSD.org
          Reporter: marietto2008@gmail.com
             Flags: maintainer-feedback?(desktop@FreeBSD.org)
          Assignee: desktop@FreeBSD.org

Hello.

I'm playing a little bit with sikulix. I'm trying to learn how it works because
I want to automatize the daily tasks of my FreeBSD 13.1-RELEASE. So,as soon as
I have implemented my first "click on the image to make a screenshot"
function,I've got the error message that you see below and I don't know how to
fix it :


[error] RunTime:loadLib: libopencv_java430.so (failed) probably dependent libs
missing:
Can't load library: /root/.Sikulix/SikulixLibs/libopencv_java430.so
[error] Save your work, correct the problem and restart the IDE!
[error] see:
https://github.com/RaiMan/SikuliX1/wiki/macOS-Linux:-Support-Libraries-for-OpenCV-4
TERMINATING: problem with native library: libopencv_java430.so
[error] script [ click_image ] stopped with error in line 1
[error] java.lang.ExceptionInInitializerError (
java.lang.ExceptionInInitializerError )
[error] --- Traceback --- error source first
line: module ( function ) statement
1: main ( <module> ) click("1656348124939.png")
[error] --- Traceback --- end -------------


To fix it I tried something like this :


mario@marietto:/usr/ports/graphics/opencv # make (enabled JAVA)


No errors.


mario@marietto:/usr/ports/graphics/opencv # make install

===>  Installing for opencv-4.5.5_7 ===>  Checking if opencv is already
installed ===>   Registering installation for opencv-4.5.5_7 
pkg-static: Unable to access file
/usr/ports/graphics/opencv/work/stage/usr/local/lib/python3.9/site-packages/cv2/__init__.py:No
such file or directory

pkg-static: Unable to access file
/usr/ports/graphics/opencv/work/stage/usr/local/lib/python3.9/site-packages/cv2/config-3.9.py:No
such file or directory

pkg-static: Unable to access file
/usr/ports/graphics/opencv/work/stage/usr/local/lib/python3.9/site-packages/cv2/config.py:No
such file or directory

pkg-static: Unable to access file
/usr/ports/graphics/opencv/work/stage/usr/local/lib/python3.9/site-packages/cv2/gapi/__init__.py:No
such file or directory

pkg-static: Unable to access file
/usr/ports/graphics/opencv/work/stage/usr/local/lib/python3.9/site-packages/cv2/load_config_py2.py:No
such file or directory

pkg-static: Unable to access file
/usr/ports/graphics/opencv/work/stage/usr/local/lib/python3.9/site-packages/cv2/load_config_py3.py:No
such file or directory

pkg-static: Unable to access file
/usr/ports/graphics/opencv/work/stage/usr/local/lib/python3.9/site-packages/cv2/mat_wrapper/__init__.py:No
such file or directory

pkg-static: Unable to access file
/usr/ports/graphics/opencv/work/stage/usr/local/lib/python3.9/site-packages/cv2/misc/__init__.py:No
such file or directory

pkg-static: Unable to access file
/usr/ports/graphics/opencv/work/stage/usr/local/lib/python3.9/site-packages/cv2/misc/version.py:No
such file or directory 

pkg-static: Unable to access file
/usr/ports/graphics/opencv/work/stage/usr/local/lib/python3.9/site-packages/cv2/python-3.9/cv2.cpython-39.so:No
such file or directory

pkg-static: Unable to access file
/usr/ports/graphics/opencv/work/stage/usr/local/lib/python3.9/site-packages/cv2/utils/__init__.py:No
such file or directory *** 

Error code 1  Stop.

make[1]: stopped in /usr/ports/graphics/opencv ***

Error code 1  Stop. make: stopped in /usr/ports/graphics/opencv


the folder /usr/ports/graphics/opencv/work/stage/usr/local/lib/python3.9/ is
missing.

I guess java binding might be missing in the port. And anyway the compiled file
is libopencv_java455.so,not libopencv_java430.so. Anyway the library
libopencv_java455.so has been produced despite the errors :


mario@marietto:/home/marietto # find / -name libopencv_java455.so
/usr/ports/graphics/opencv/work/.build/lib/libopencv_java455.so 
/usr/ports/graphics/opencv/work/stage/usr/local/share/java/opencv4/libopencv_java455.so


I tried to see if it was accepted by sikulix,doing :


1) ln -s libopencv_java455.so /root/.Sikulix/SikulixLibs

or :

2) mv libopencv_java455.so libopencv_java430.so ; ln -s libopencv_java430.so
/root/.Sikulix/SikulixLibs


but the error is still there.


At this point I've installed FreeBSD 13.0-RELEASE and then I did :


pkg install openjdk17 
mount -t fdescfs fdesc /dev/fd 
mount -t procfs proc /proc 
mario@marietto:/usr/ports/graphics/opencv # make


I wanted to enable JAVA at this point,but I didn't see any JAVA option to
enable as you can see below...


https://ibb.co/dJPD836


Instead,if I do the same thing with FreeBSD 13.1,I can see the java option :


https://ibb.co/HCkZc7Q


Unfortunately with 13.1 it produces a library that does not work and with 13.0
I can't enable java so the file that I need can't be produced. And anyway,even
if it was produced,I need to have libopencv_java430.so and not
libopencv_java341.so. So,what can I do to enjoy myself a little bit with sikuli
and opencv ?

It looks like the application is expecting version 430 and I'm giving it
version 455 and they may be incompatible. What about building sikulix from
source? maybe then it'll try to use the correct version. So. Can someone
provide some tutorials where I can learn and try to build Sikulix from source ?
Or if you have some different suggestion,I will appreciate it. Very thanks to
everyone.

-- 
You are receiving this mail because:
You are the assignee for the bug.