[ 
https://issues.apache.org/jira/browse/MESOS-2216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14276618#comment-14276618
 ] 

Tony Reix commented on MESOS-2216:
----------------------------------

Hi Cody,

The difference between the IBM JVM and other JVMs should be reduced to the 
performance and reliability. In fact, there are still some more differences. 
And, about my concern with this failure while running ./configure of Mesos, I 
still don't know if the IBM JVM is not following the standard or if Mesos 
relies on features specific to Oracle JVM and OpenJDK.

Anyway, you can download the IBM JVM from: 
http://www.ibm.com/developerworks/java/jdk/linux/download.html and give it a 
try.

About your comment, the error message I'm getting is produced by the code of 
Mesos/configure :

  # Determine linker flags for Java if not set.
  if test -z "$JAVA_LDFLAGS"; then
    if test "$OS_NAME" = "darwin"; then
      JAVA_LDFLAGS="-framework JavaVM"
    elif test "$OS_NAME" = "linux"; then
      JAVA_LDFLAGS=""
      for arch in amd64 i386; do
        dir="$JAVA_HOME/jre/lib/$arch/server"
        if test -e "$dir"; then
          # Note that these are libtool specific flags.
          JAVA_LDFLAGS="-L$dir -R$dir -Wl,-ljvm"
          break;
          fi
      done
    fi
  fi

  if test -z "$JAVA_LDFLAGS"; then
    as_fn_error $? "failed to determine linker flags for using Java \
(bad JAVA_HOME or missing support for your architecture?)" "$LINENO" 5
  fi

Which output is (since the  
/usr/lib/jvm/ibm-java-x86_64-71/jre/lib/amd64/server  directory does not exist) 
:

+ JAVA_LDFLAGS=
+ for arch in amd64 i386
+ dir=/usr/lib/jvm/ibm-java-x86_64-71/jre/lib/amd64/server
+ test -e /usr/lib/jvm/ibm-java-x86_64-71/jre/lib/amd64/server
+ for arch in amd64 i386
+ dir=/usr/lib/jvm/ibm-java-x86_64-71/jre/lib/i386/server
+ test -e /usr/lib/jvm/ibm-java-x86_64-71/jre/lib/i386/server
+ test -z ''
+ as_fn_error 0 'failed to determine linker flags for using Java (bad JAVA_HOME 
or missing support for your architecture?)' 18875 5
+ as_status=0
+ test 0 -eq 0
+ as_status=1
+ test 5
+ as_lineno=18875
+ as_lineno_stack=as_lineno_stack=
+ printf '%s\n' 'configure:18875: error: failed to determine linker flags for 
using Java (bad JAVA_HOME or missing support for your architecture?)'
+ printf '%s\n' 'configure: error: failed to determine linker flags for using 
Java (bad JAVA_HOME or missing support for your architecture?)'
configure: error: failed to determine linker flags for using Java (bad 
JAVA_HOME or missing support for your architecture?)


Then, after I've added the missing directory and after I've copied from 
elsewhere in the IBM JVM the required files, .configure does:

$as_echo_n "checking whether or not we can build with JNI... " >&6; }
  if test -z "$JAVA_CPPFLAGS"; then
    if test "$OS_NAME" = "darwin"; then
      while true; do # Loop until sucessful (via break) or exhausted options.
        JAVA_CPPFLAGS="-I$JAVA_HOME/include -I$JAVA_HOME/include/$OS_NAME"

  cat <<__EOF__ >conftest.cpp
#include <jni.h>
int main(int argc, char** argv)
{
  JNIEnv* env;
  JavaVM* jvm;
  JavaVMInitArgs vmArgs;
  return JNI_CreateJavaVM(&jvm, (void**) &env, &vmArgs);
}
__EOF__

  # Try to compile and link via libtool (the one we generate).
  ./libtool --tag=CXX --mode=link $CXX -Wall -Werror $JAVA_CPPFLAGS \
    -o conftest conftest.cpp $JAVA_LDFLAGS >&5


producing the output:

+ printf '%s\n' 'configure:18881: checking whether or not we can build with JNI'
+ printf %s 'checking whether or not we can build with JNI... '
checking whether or not we can build with JNI... + test -z ''
+ test linux = darwin
+ true
+ JAVA_CPPFLAGS='-I/usr/lib/jvm/ibm-java-x86_64-71/include 
-I/usr/lib/jvm/ibm-java-x86_64-71/include/linux'
+ cat
+ ./libtool --tag=CXX --mode=link g++ -Wall -Werror 
-I/usr/lib/jvm/ibm-java-x86_64-71/include 
-I/usr/lib/jvm/ibm-java-x86_64-71/include/linux -o conftest conftest.cpp 
-L/usr/lib/jvm/ibm-java-x86_64-71/jre/lib/amd64/server 
-R/usr/lib/jvm/ibm-java-x86_64-71/jre/lib/amd64/server -Wl,-ljvm
/usr/lib/jvm/ibm-java-x86_64-71/jre/lib/amd64/server/libjvm.so: undefined 
reference to `dlopen'
/usr/lib/jvm/ibm-java-x86_64-71/jre/lib/amd64/server/libjvm.so: undefined 
reference to `dlclose'
/usr/lib/jvm/ibm-java-x86_64-71/jre/lib/amd64/server/libjvm.so: undefined 
reference to `dlerror'
/usr/lib/jvm/ibm-java-x86_64-71/jre/lib/amd64/server/libjvm.so: undefined 
reference to `dlsym'
/usr/lib/jvm/ibm-java-x86_64-71/jre/lib/amd64/server/libjvm.so: undefined 
reference to `dladdr'


So, the command:
./libtool --tag=CXX --mode=link g++ -Wall -Werror 
-I/usr/lib/jvm/ibm-java-x86_64-71/include 
-I/usr/lib/jvm/ibm-java-x86_64-71/include/linux -o conftest conftest.cpp 
-L/usr/lib/jvm/ibm-java-x86_64-71/jre/lib/amd64/server 
-R/usr/lib/jvm/ibm-java-x86_64-71/jre/lib/amd64/server -Wl,-ljvm
fails.

My understanding is that Mesos wants to check ("checking whether or not we can 
build with JNI") if JNI is OK within the JVM.
JNI is a standard component of a standard JVM, AFAIK. So the IBM JVM does 
provide it. See: 
http://www-01.ibm.com/support/knowledgecenter/SSYKE2_7.0.0/com.ibm.java.lnx.71.doc/user/usejni.html
However, is Mesos correctly checking that the JNI feature is delivered by the 
JVM ?

My question is: In order to do this checking: 
 1) Is Mesos following a standard way that all JVMs must implement ? or 
 2) Is Mesos using features (the amd64/server exists and contains the  
libjvm.so  file which must have the expected objects) that are provided by 
Oracle JVM by their own decision ?
If the answer is yes to the first question, then it is an issue in the IBM JVM.
If the answer is no to the first question, then Mesos should check the JNI 
stuff in a different way.

> The "configure" phase breaks with the IBM JVM.
> ----------------------------------------------
>
>                 Key: MESOS-2216
>                 URL: https://issues.apache.org/jira/browse/MESOS-2216
>             Project: Mesos
>          Issue Type: Bug
>    Affects Versions: 0.20.1
>         Environment: Ubuntu / x86_64
>            Reporter: Tony Reix
>
> ./configure does not work with IBM JVM, since it looks for a directory:
>    /usr/lib/jvm/ibm-java-x86_64-71/jre/lib/amd64/server       x86_64
>    /usr/lib/jvm/ibm-java-ppc64le-71/jre/lib/ppc64le/server    PPC64 LE
> that does not exist for the IBM JVM.
> Though this directory does exist for Oracle JVM and Open JDK:
>    /usr/lib/jvm/jdk1.7.0_71/jre/lib/amd64/server                  Oracle JVM
>    /usr/lib/jvm/java-1.7.0-openjdk-amd64/jre/lib/amd64/server     OpenJDK
> However, the files:
>   libjsig.so
>   libjvm.so   (3 versions)
> do exist for IBM JVM.
> Anyway, creating the server directory and copying the files (tried with the 3 
> versions of libjvm.so) does not fix the issue:
> checking whether or not we can build with JNI... 
> /usr/lib/jvm/ibm-java-x86_64-71/jre/lib/amd64/server/libjvm.so: undefined 
> reference to `dlopen'
> /usr/lib/jvm/ibm-java-x86_64-71/jre/lib/amd64/server/libjvm.so: undefined 
> reference to `dlclose'
> /usr/lib/jvm/ibm-java-x86_64-71/jre/lib/amd64/server/libjvm.so: undefined 
> reference to `dlerror'
> /usr/lib/jvm/ibm-java-x86_64-71/jre/lib/amd64/server/libjvm.so: undefined 
> reference to `dlsym'
> /usr/lib/jvm/ibm-java-x86_64-71/jre/lib/amd64/server/libjvm.so: undefined 
> reference to `dladdr'
> Something (dlopen, dlclose, dlerror, dlsym, dladdr) is missing in IBM JVM.
> So, either the configure step relies on a feature that is not in the Java 
> standard but only in the Oracle JVM and OpenJDK, or the IBM JVM lacks part of 
> the Java standard.
> I'm not an expert about this. So, I'd like Mesos people to experiment with 
> IBM JVM. Maybe there is another solution for this step of the Mesos configure 
> that would work with all 3 JVMs.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to