how to compile Ignite application on CMake?

2019-08-25 03:05发布

问题:

I did compile Ignite Application successfully. but The Binary didn't work.

/tmp/tmp.Nw0IPD6ru3/cmake-build-debug-local-container/planet_engine: error while loading shared libraries: libjvm.so: cannot open shared object file: No such file or directory

how can I make to it work?

Also, I compiled C++ Examples successfully. such as ignite-compute-example. and, I execute that but I got an error message. An error occurred: JVM library is not found (did you set JAVA_HOME environment variable?)

and I using a nightly release version 2.8.0.20190213 because I couldn't build to version 2.7 in my environment.

I posted environment values down.

IGNITE_HOME=
TERM=xterm-256color
SHELL=/bin/bash 
LIBRARY_PATH=/root/jre1.8.0_201/lib/amd64/server:/root/jre1.8.0_201/lib/amd64/
LC_NUMERIC=ko_KR.UTF-8
SSH_TTY=/dev/pts/0
JRE_HOME=/root/jre1.8.0_201
USER=root
LS_COLORS=rs=0:d...
LD_LIBRARY_PATH=/root/jre1.8.0_201/lib/amd64/server:/root/jre1.8.0_201/lib/amd64/
CLASS_PATH=/root/jdk-11.0.2/lib:
LC_TELEPHONE=ko_KR.UTF-8
MAIL=/var/mail/root
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/jdk-11.0.2/bin
LC_IDENTIFICATION=ko_KR.UTF-8 
JAVA_HOME=/root/jdk-11.0.2
LANG=en_US.UTF-8
LC_MEASUREMENT=ko_KR.UTF-8
JDK_HOME=/root/jdk-11.0.2/lib
SHLVL=1
HOME=/root
LOGNAME=root 
LESSOPEN=| /usr/bin/lesspipe %s
LESSCLOSE=/usr/bin/lesspipe %s %s
LC_TIME=ko_KR.UTF-8
LC_NAME=ko_KR.UTF-8
_=/usr/bin/env 

Thank you for reading. :)

回答1:

I got it.

I am working on a docker container environment.

and therefore I am using remote build and debug with ssh and gdb.

finally, I found out why it couldn't find libjvm.so and why couldn't read environment values such as JAVA_HOME.

because it is working in gdb for now.

I confirmed that it is working when without gdb.

I will find a solution. and, if I have been found, I will update the answer.


[Solved]

I share how I make solved that.

I was using an Oracle JDK-11 through source install.

but Ignite C++ client need something different with latest released jdk versions.

Ignite need a directory structure like this

JAVA_HOME/ (as JDK install directory)
  - jre/
    - lib/
  - lib/
  ...

I solved by apt install openjdk-8-jdk. openjdk-8-jdk have structure for what Ignite need.

i added JAVA_HOME, IGNITE_HOME, at /etc/environment.

It works finally.

but I got another problem. HAHA I am so sad.

This also GDB problem..