Solved TERMINATING: problem with native library: libopencv_java430.so

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" function,I've got the error message that you see below and I don't know how to fix it :

Code:
[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: [URL]https://github.com/RaiMan/SikuliX1/wiki/macOS-Linux:-Support-Libraries-for-OpenCV-4[/URL]
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 --------------


Screenshot_2022-06-27_18-42-58.jpg


and yes,I have installed opencv and even more relevant packages on FreeBSD :

Code:
mario@marietto:/home/marietto # find / -name libopencv_java430.so
 
mario@marietto:/home/marietto # pkg search opencv


frei0r-plugins-opencv-1.8.0    Frei0r OpenCV plugins
gstreamer1-plugins-opencv-1.16.2_3 GStreamer opencv real time computer vision plugin
opencv-4.5.5_7                 Open Source Computer Vision library
opencvs-20151230               BSD-licensed CVS implementation


mario@marietto:/home/marietto # pkg install opencv
 
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Updating database digests format: 100%
New version of pkg detected; it needs to be installed first.
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
pkg: 1.18.1 -> 1.18.2

Number of packages to be upgraded: 1

The process will require 1 MiB more space.
8 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching pkg-1.18.2.pkg: 100%    8 MiB   8.8MB/s    00:01   
Checking integrity... done (0 conflicting)
[1/1] Upgrading pkg from 1.18.1 to 1.18.2...
[1/1] Extracting pkg-1.18.2: 100%
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed


mario@marietto:/home/marietto # pkg install opencv


Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed


mario@marietto:/home/marietto # find / -name libopencv_java430.so


mario@marietto:/home/marietto # pkg install gstreamer1-plugins-opencv


Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
gstreamer1-plugins-opencv: 1.16.2_3

Number of packages to be installed: 1

88 KiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching gstreamer1-plugins-opencv-1.16.2_3.pkg: 100% 88 KiB 90.0kB/s 00:01
Checking integrity... done (0 conflicting)
[1/1] Installing gstreamer1-plugins-opencv-1.16.2_3...
[1/1] Extracting gstreamer1-plugins-opencv-1.16.2_3: 100%


mario@marietto:/home/marietto # pkg install frei0r-plugins-opencv


Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed


mario@marietto:/home/marietto # find / -name libopencv_java430.so


mario@marietto:/home/marietto # pkg install frei0r-plugins-opencv

Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed
 
UPDATE :

as grahamperrin suggested,I did something like this :

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

but it didn't work :

Code:
.........

===>  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
 
Code:
mario@marietto:/usr/ports/graphics/opencv # make (enabled JAVA)
everything is ok

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

everything is ok until this point :

Code:
===>  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

is the folder /usr/ports/graphics/opencv/work/stage/usr/local/lib/python3.9/ that's missing.
 
I have enabled it because the hope was that from the compilation the missing file "libopencv_java430.so" was produced,but it didn't happen.
 
Even if it was able to produce the libopencv_java455.so file, it would be a good result, because I would try to use it instead of libopencv_java430.so. Or in any case, I would contact the creator of sikulix to understand what to do. So,what should I do to make some progress ?
 
the file mentioned by you has been produced :

Code:
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

but it's not useful.
 
I did something like this :

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

and :

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

but the error is still the same.
 
I've installed FreeBSD 13.0-RELEASE and then I did :

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

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

Screenshot_2022-06-30_01-50-16.jpg
 
Ports have nothing to do with the version of FreeBSD, you should know that by now.
 
You have an old ports tree on 13.0. graphics/opencv on that tree is at version 3.4.1_1, whereas on the 13.1 system it's at 4.5.5_7.

If open-cv 4.5.5_7 produces libopencv_java455.so,open-cv 3.4.1_1 should produce libopencv_java341.so ?. But since I need the file libopencv_java430.so,if I make the upgrade of the ports,will I have that file ? Even if the JAVA option is not there ?
 
The ports tree was already up to date :

Code:
........
Building new INDEX files... done.
mario@marietto-phy:/home/marietto # portsnap fetch update
Looking up portsnap.FreeBSD.org mirrors... 4 mirrors found.
Fetching snapshot tag from ipv4.aws.portsnap.freebsd.org... done.
Latest snapshot on server matches what we already have.
No updates needed.
Ports tree is already up to date.

mario@marietto-phy:/home/marietto # uname -a

FreeBSD marietto-phy 13.0-RELEASE-p11 FreeBSD 13.0-RELEASE-p11 #0: Tue Apr  5 18:54:35 UTC 2022     root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64
 
Ports have nothing to do with the version of FreeBSD, you should know that by now.

At this point I can't understand really what you mean,because I haven't been able to fix this problem and I'm confused. When I will have fixed it,maybe I will learn this lesson.
 
Last edited:
I'm reading here :


it's nice to see that he found the package opencv-java-3.4.1_37 between the packages :

Code:
[leonardo@ws1 ~/.weasis/log] $ sudo pkg search opencv    


frei0r-plugins-opencv-1.6.1_1  Frei0r OpenCV plugins

gstreamer-plugins-opencv-0.10.23_6,3 Gstreamer opencv real time computer vision plugin

gstreamer1-plugins-opencv-1.16.2 GStreamer opencv real time computer vision plugin

opencv-3.4.1_37                Open Source Computer Vision library

opencv-core-3.4.1_37           Open Source Computer Vision library

opencv-java-3.4.1_37           Open Source Computer Vision library

opencvs-20151230               BSD-licensed CVS implementation

py37-opencv-3.4.1_37           Open Source Computer Vision library

but I'm not :

Code:
mario@marietto:/home/marietto # pkg search opencv

frei0r-plugins-opencv-1.8.0    Frei0r OpenCV plugins
gstreamer1-plugins-opencv-1.16.2_3 GStreamer opencv real time computer vision plugin
opencv-4.5.5_7                 Open Source Computer Vision library
opencvs-20151230               BSD-licensed CVS implementation
 
Almost worked the sikuli 2.6 snapshot which run with java 11. Problem is that the lib libm.so.6 is written for linux and can't work under FreeBSD ?

Screenshot_2022-07-07_00-21-54.jpg
 
I made some progress. I've tried to run Sikuli from the linuxulator. It is able to start and it doesn't complain about the "libopencv_java430.so library,but for the libdl.so.2 library that it can't find. I found this library inside the /Ubuntu-2004/usr/lib/x86_64-linux-gnu folder of Linux and I copied it into the folder /home/marietto/.Sikulix/SikulixLibs,but the error didn't disappear. What do you suggest I do ? This library should be accepted because it comes from Linux now,not from FreeBSD. I have recorded a video to show you. Do you want to give it a look ? thanks.

 
Back
Top