CentOS 7 issue for Sikulix 2.x+

Asked by Shibly Sadeque on 2021-04-16

Hello,

I have been trying to run Sikulix 2.0.4 and Sikulix 2.0.5
I have followed the following instructions
 - https://sikulix-2014.readthedocs.io/en/latest/newslinux.html#version-1-1-4-special-for-linux-people
 - https://github.com/RaiMan/SikuliX1/wiki/macOS-Linux:-Support-Libraries-for-OpenCV-4

I have the following java version
openjdk version "1.8.0_282"
OpenJDK Runtime Environment (build 1.8.0_282-b08)
OpenJDK 64-Bit Server VM (build 25.282-b08, mixed mode)

I have the following tesseract and leptonica version
tesseract 4.1.1
 leptonica-1.80.0
  libpng 1.5.13 : zlib 1.2.7
 Found AVX2
 Found AVX
 Found SSE

I have the following ant version
Apache Ant(TM) version 1.9.4 compiled on November 5 2018

I have the following cmake version
cmake version 3.20.0
CMake suite maintained and supported by Kitware (kitware.com/cmake).

As for openCV I have compiled version 4.5.1 and have the libopencv_java451.so at these locations. I've already made a symlink to libopencv_java.so at both of these location:
/usr/local/lib64/libopencv_java451.so
/usr/local/share/java/opencv4/libopencv_java451.so

#Sikulix 2.0.4
The problem I have with Sikulix 2.0.4 is that I get 2 errors. Sometimes I get this error:

[error] java.lang.NoClassDefFoundError ( java.lang.NoClassDefFoundError: Could not initialize class org.sikuli.script.Finder$FindInput2

and sometimes I get this error:
[error] RunTime:loadLib: opencv_java (failed) probably dependent libs missing:
no opencv_java in java.library.path

#Sikulix2.0.5
The issue I've been getting for Sikulix 2.0.5 is this
[error] RunTime:loadLib: libopencv_java430.so (failed) probably dependent libs missing:
/home/mufasa/.Sikulix/SikulixLibs/libopencv_java430.so: /lib64/libm.so.6 version 'GLIB_2.27' not found (required by /home/mufasa.Sikulix/SikulixLibs/libopencv_java430.so)

The latest glibc available on CentOS7 is 2.17. I tried to update to 2.27 by compiling from source but I think the compiler crashes because afterwards I get this error when executing simple commands like `ls` also I am unable to reboot my VM afterwards.
Segmentation Fault (core dumped)

How can I fix these errors? If 2.0.5 is too much of a stretch is it possible to fix the 2.0.4 issue?
Thanks

Question information

Language:
English Edit question
Status:
Open
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

Update 4/23/21

I have posted the following issue on gitlab: https://github.com/RaiMan/SikuliX1/issues/441

I have given up on Sikulix 2.0.5 and have been trying to get Sikulix 2.0.4 to work:

It seems opencv 4.3.0 installs correctly on CentOS 7. I followed this guide to install it: https://linuxize.com/post/how-to-install-opencv-on-centos-7/
After installing, I ran `pkg-config --modversion opencv4` and it did return me a version number.

I wasn't sure where else to put the symlink to the libopencv_java430.so and so I did `java -XshowSettings:properties` and it returned me the following.
```
java.library.path = /usr/java/packages/lib/amd64
        /usr/lib64
        /lib64
        /lib
        /usr/lib
```

On each of these location I placed the symlink and retried running the jar file `java -jar sikulixide-2.0.4.jar`. I noticed that every first attempt of running a sikulix script after starting the jar file I get this error:

```
[error] RunTime:loadLib: opencv_java (failed) probably dependent libs missing:
no opencv_java in java.library.path
[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: opencv_java
[error] script [ test ] 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("1619235775332.png")
[error] --- Traceback --- end --------------
```

And every time after that:
```
[error] script [ test ] stopped with error in line 1
[error] java.lang.NoClassDefFoundError ( java.lang.NoClassDefFoundError: Could not initialize class org.sikuli.script.Finder$FindInput2 )
[error] --- Traceback --- error source first
line: module ( function ) statement
1: main ( <module> ) click("1619235775332.png")
[error] --- Traceback --- end --------------
```

Please help me Raiman. I've been trying to troubleshoot this issue for the past 3 months.

Once again here are versions of the dependencies:
```
#Tesseract
tesseract 4.1.1
 leptonica-1.80.0
  libjpeg 6b (libjpeg-turbo 1.2.90) : libpng 1.5.13 : libtiff 4.0.3 : zlib 1.2.7 : libwebp 0.3.0
 Found AVX2
 Found AVX
 Found SSE
```

```
#Ant
Apache Ant(TM) version 1.9.4 compiled on November 5 2018
```
```
#Java
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
```

#OpenCV
```
4.3.0
```

```
#Python
Python 2.7.5 (default, Nov 16 2020, 22:23:17)
```

Update 4/24

I have now tried all of the Sikulix version 2.0+.
Sikulix 2.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5 and none of them worked on CentOS 7. I get the same issue as above.

Can you help with this problem?

Provide an answer of your own, or ask Shibly Sadeque for more information if necessary.

To post a message you must log in.