[1.1.4] Linux390x: get SikuliX working

Asked by Rony Verch

*************** before doing anything on any Linux:
Pleas read:
https://sikulix-2014.readthedocs.io/en/latest/newslinux.html

---------------------------------------------------------------------------------------

Could anyone clarify if they got Sikuli working on a linux390x machine?

I am having issues with getting a working version of Java which Sikuli.

Thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

Wooouuw ;-)

That is like a flashback to the 1970's when I started my IT life on IBM 360/370 systems ;-)

I am sure, that is a challenge, since it is not only Java, that is needed (at least a Java 8 compatible version), but also a running version of OpenCV 3.x with the Java library (which is the heart of SikuliX's visual approach).

Hence I am not very optimistic about a possible access :-(

Revision history for this message
Rony Verch (rverch) said :
#2

I was actually able to get openCV 3.2.5 working on the Linux390x machine with tesseract 3.0.4.

Linux390 also has a Java 8 version available but I don't believe it's working with Sikuli.

I don't have access to the error right now but tonight I'll make sure to add the error here. Maybe you can give me some suggestions :)

Revision history for this message
Rony Verch (rverch) said :
#3

I was actually able to get openCV 3.2.5 working on the Linux390x machine with tesseract 3.0.4.

Linux390 also has a Java 8 version available but I don't believe it's working with Sikuli.

I don't have access to the error right now but tonight I'll make sure to add the error here. Maybe you can give me some suggestions :)

Revision history for this message
RaiMan (raimund-hocke) said :
#4

Well done: OpenCV and Tesseract :-)
More than half way down the road.

If you have the time: please tell me how you did that.

Java 8: version 1.1.4 should work with Java 8.

If you get a SikuliX error message about unknown Java version, please show me the message.
I will fix this immediately.

If you want, you can contact me directly per mail via sikulix--at--outlook--dot--com.

Revision history for this message
Rony Verch (rverch) said :
#5

Sorry for sending this later then expected but this is the error I am receiving:

OpenJDK 64-Bit Zero VM warning: You have loaded library /root/.Sikulix/SikulixLibs_201803080837/libVisionProxy.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
[error] RunTimeIDE: loadLib: libVisionProxy.so not usable:
java.lang.UnsatisfiedLinkError: /root/.Sikulix/SikulixLibs_201803080837/libVisionProxy.so: /root/.Sikulix/SikulixLibs_201803080837/libVisionProxy.so: wrong ELF class: ELFCLASS32 (Possible cause: endianness mismatch)
[error] RunTimeIDE: loadLib: libVisionProxy.so not usable:
java.lang.UnsatisfiedLinkError: /root/.Sikulix/SikulixLibs_201803080837/libVisionProxy.so: /root/.Sikulix/SikulixLibs_201803080837/libVisionProxy.so: wrong ELF class: ELFCLASS32 (Possible cause: endianness mismatch)
[info] runcmd: ldconfig -p
[error] LinuxSupport: buildVision: no valid Java JDK available nor found
[error] RunTimeIDE: Problematic lib: /root/.Sikulix/SikulixLibs_201803080837/libVisionProxy.so (...TEMP...)
[error] RunTimeIDE: libVisionProxy.so loaded, but it might be a problem with needed dependent libraries
ERROR: ...TEMP...: ...TEMP...: wrong ELF class: ELFCLASS32 (Possible cause: endianness mismatch)
[error] RunTimeIDE: *** terminating: problem with native library: libVisionProxy.so

Additionally, when I run "java -version" this is what I get:

openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-b13)
OpenJDK 64-Bit Zero VM (build 25.181-b13, interpreted mode)

I believe the error has something to do with the installed Java being a "Zero VM" version of Java and is loading the "libVisionProxy.so" library wrong. I've also tried installing other versions of Java but they also seem to have the same issue.

In regards to OpenCV and Tesseract, installing them wasn't too challenging actually. OpenCV 3.2.5 was available through yum (i'm on a RHEL 7 machine) so that one was especially easy. Tesseract on the other hand wasn't available through yum so that one was a little more difficult. I ended up finding Tesseract on rpmfind--dot--net (I actually found Tesseract 3.0.5 not 3.0.4) where I downloaded the rpm onto my machine, installed it, and then fixed any missing dependencies through either installing them with yum or using rpmfind--dot--net.

Revision history for this message
RaiMan (raimund-hocke) said :
#6

1. Java
The Java version is ok and should be recognized by SikuliX

2. SikuliX version
Are you using version 1.1.4? Does not look like.
I do not support system problems with 1.1.3 anymore (does not run with OpenCV 3 anyways)

So please use 1.1.4 and read
https://sikulix-2014.readthedocs.io/en/latest/newslinux.html

3. wrong ELF class: ELFCLASS32
Since you are using a Java version 64-Bit, any native stuff has to be 64-Bit too.

Revision history for this message
Rony Verch (rverch) said :
#7

Trying to run the new sikulixapi.jar, I get the following error:

[error] RunTimeINIT: *** terminating: Java arch not 64 Bit or not detected (java 8-32 version 1.8 vm 25.181-b13 class 52.0 arch null)

Nothing on the machine was changed (same java version), any idea why I am getting that?

Revision history for this message
Rony Verch (rverch) said :
#8

Additonally, you said "Since you are using a Java version 64-Bit, any native stuff has to be 64-Bit too." but what do you mean by that? Are you saying that I have packages installed that SikuliX is using that aren't 64bit?

Revision history for this message
RaiMan (raimund-hocke) said :
#9

Ok, SikuliX 1.1.4 only works with a 64-Bit Java - you have a 32-Bit Java (java 8-32 version 1.8 vm 25.181-b13 class 52.0 arch null)

So if it is not possible to get a 64-Bit Java working, then you would need to use SikuliX 1.1.3, which would make things much more complicated, since you would need an OpenCV 2.4 and would have to build the SikuliX native stuff from the sources - and everything as 32-Bit versions.

Revision history for this message
Rony Verch (rverch) said :
#10

Am I not running a 64-Bit Java though? When I run "java -version" I get the following:

openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-b13)
OpenJDK 64-Bit Zero VM (build 25.181-b13, interpreted mode)

Revision history for this message
RaiMan (raimund-hocke) said :
#11

please try again with the latest build as:
java -jar <path-to>/sikulixapi.jar

You should get a log section titled
*** system properties dump

please post this here or send it by mail to me personally (sikulix---at---outlook---dot---com)

Revision history for this message
Rony Verch (rverch) said :
#12

I get the same error I was getting before:

[error] RunTimeINIT: *** terminating: Java arch not 64 Bit or not detected (java 8-32 version 1.8 vm 25.181-b13 class 52.0 arch null)

Revision history for this message
RaiMan (raimund-hocke) said :
#13

please try again with:
java -Dsikuli.Debug=3 -jar <path-to>/sikulixapi.jar

Revision history for this message
Rony Verch (rverch) said :
#14

When I add the debug this is what is outputted:

[debug] RunTimeINIT: starting
[debug] RunTimeINIT: java version
[error] RunTimeINIT: *** terminating: Java arch not 64 Bit or not detected (java 8-32 version 1.8 vm 25.181-b13 class 52.0 arch null)

Revision history for this message
RaiMan (raimund-hocke) said :
#15

Uuuups, I am sorry for my fault.

please try again with:
java -Dsikuli.Debug=4 -jar <path-to>/sikulixapi.jar

Revision history for this message
Rony Verch (rverch) said :
#16

No worries, this is what I get running Debug=4.

[debug] RunTimeINIT: starting
[debug] RunTimeINIT: java version
*** system properties dump
awt.toolkit = sun.awt.X11.XToolkit
file.encoding = UTF-8
file.encoding.pkg = sun.io
file.separator = /
java.awt.graphicsenv = sun.awt.X11GraphicsEnvironment
java.awt.printerjob = sun.print.PSPrinterJob
java.class.path = sikulixapi.jar
java.class.version = 52.0
java.endorsed.dirs = /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.s390x/jre/lib/endorsed
java.ext.dirs = /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.s390x/jre/lib/ext:/usr/java/packages/lib/ext
java.home = /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.s390x/jre
java.io.tmpdir = /tmp
java.library.path = /usr/java/packages/lib/s390x:/usr/lib64:/lib64:/lib:/usr/lib
java.runtime.name = OpenJDK Runtime Environment
java.runtime.version = 1.8.0_181-b13
java.specification.name = Java Platform API Specification
java.specification.vendor = Oracle Corporation
java.specification.version = 1.8
java.vendor = Oracle Corporation
java.vendor.url = http://java.oracle.com/
java.vendor.url.bug = http://bugreport.sun.com/bugreport/
java.version = 1.8.0_181
java.vm.info = interpreted mode
java.vm.name = OpenJDK 64-Bit Zero VM
java.vm.specification.name = Java Virtual Machine Specification
java.vm.specification.vendor = Oracle Corporation
java.vm.specification.version = 1.8
java.vm.vendor = Oracle Corporation
java.vm.version = 25.181-b13
line.separator =

os.arch = s390x
os.name = Linux
os.version = 3.10.0-327.28.2.el7.s390x
path.separator = :
sikuli.Debug = 4
sun.arch.data.model = 64
sun.boot.class.path = /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.s390x/jre/lib/resources.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.s390x/jre/lib/rt.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.s390x/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.s390x/jre/lib/jsse.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.s390x/jre/lib/jce.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.s390x/jre/lib/charsets.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.s390x/jre/lib/jfr.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.s390x/jre/classes
sun.boot.library.path = /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.s390x/jre/lib/s390x
sun.cpu.endian = big
sun.cpu.isalist =
sun.io.unicode.encoding = UnicodeBig
sun.java.command = sikulixapi.jar
sun.java.launcher = SUN_STANDARD
sun.jnu.encoding = UTF-8
sun.os.patch.level = unknown
user.country = CA
user.dir = /root/sikuli_files
user.home = /root
user.language = en
user.name = root
user.timezone = America/Toronto
*** system properties dump end
[error] RunTimeINIT: *** terminating: Java arch not 64 Bit or not detected (java 8-32 version 1.8 vm 25.181-b13 class 52.0 arch null)

Revision history for this message
RaiMan (raimund-hocke) said :
#17

Thanks, I think I fixed it. (now using sun.arch.data.model instead of os.arch to detect the bit-ness)

Try normally with latest build (#97+)

Revision history for this message
Rony Verch (rverch) said :
#18

It seems to be running now (not showing the error it was before) but, in the previous version there was a exectutable (runsikulix) I could run that would run a previousily created sikuliX project.

With version 1.1.4 how would I go about running a project I previously created?

To explain better, previously to run test.sikuli I would run "runsikulix -r test.sikuli --args arg1 arg2 arg3" my question is how would I do the same with version 1.1.4?

Revision history for this message
Rony Verch (rverch) said :
#19

Scratch the comment above.

I figured out that it wasn't working due to Jython and JRuby not being on the machine. Downloaded both and got another issue, this time with opencv.

After running I got the following error:

[error] RunTimeIDE: loadLib: opencv_java not usable:
java.lang.UnsatisfiedLinkError: no opencv_java in java.library.path
[error] RunTimeIDE: *** terminating: problem with native library: opencv_java

I have OpenCV 2.4.5 installed.

Revision history for this message
Rony Verch (rverch) said :
#20

Adding on to the previous comment,

I built OpenCV 3.4.0 for Linux390x and installed on the machine and that didn't fix the issue either. I still receive the error:

[error] RunTimeIDE: loadLib: opencv_java not usable:
java.lang.UnsatisfiedLinkError: no opencv_java in java.library.path
[error] RunTimeIDE: *** terminating: problem with native library: opencv_java

Even when running on the latest OpenCV version, version 3.4.0.

Revision history for this message
Rony Verch (rverch) said :
#21

Was able to fix the issue above. To fix it, I added "-Djava.library.path=" when running "java -jar sikulix.jar" and set the path to where opencv_java340.so (OpenCV 3.4.0) is stored. For example:

java -jar -Djava.library.path=/usr/lib64 /path-to/sikulix.jar --args arg1 arg2 arg3

This got SikuliX working on the Linux390x machine.

Thank you for all the help in getting it working, keep doing the great work!

Revision history for this message
Best RaiMan (raimund-hocke) said :
#22

as mentioned in #6:

So please use 1.1.4 and read
https://sikulix-2014.readthedocs.io/en/latest/newslinux.html

there I wrote:
- must be an OpenCV 3.x (best 3.4.x)

- As a last step you need to find the installed libopencv_javaXYZ.so and as mentioned above create a symbolic link, that is found in the library path (which is the more general solution)

Revision history for this message
Rony Verch (rverch) said :
#23

Thanks RaiMan, that solved my question.