java: clean up MPI Java configury
The Java configury is split into two parts: 1. Determine if we want MPI Java bindings. 2. Find the Java compiler (and related). This commit does a few things: - Move the "Find the Java compiler" step from OPAL to OMPI (because there is no Java in OPAL, and there doesn't appear to be any immanent danger that there will be). - As a direct consequence, remove the --enable-java CLI option (--enable-mpi-java still remains). Enabling the MPI Java bindings and enabling Java are now considered the same thing (since there is no Java elsewhere in the code base, the different was meaningless). - Only invoke the "Find the Java compiler" step if we actually want the MPI Java bindings. - A few miscellaneous Java-related cleanups in configury (E.g., change testing "$foo" == "1" to $foo -eq 1, etc. This commit is mostly s/opal/ompi/gi in many places in configury and shifting code around. But it looks bigger than it actually is because of two reasons: 1. Some files were renamed: * ompi_setup_java.m4 -> ompi_setup_mpi_java.m4 (setup MPI Java bindings) * opal_setup_java.m4 -> ompi_setup_java.m4 (setup Java compiler) 2. Indenting level changed in (the new) ompi_setup_java.m4. Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
This commit is contained in:
parent
d72c4e9d20
commit
9f21ea437c
@ -13,9 +13,11 @@ dnl All rights reserved.
|
||||
dnl Copyright (c) 2006-2012 Los Alamos National Security, LLC. All rights
|
||||
dnl reserved.
|
||||
dnl Copyright (c) 2007-2012 Oracle and/or its affiliates. All rights reserved.
|
||||
dnl Copyright (c) 2008-2012 Cisco Systems, Inc. All rights reserved.
|
||||
dnl Copyright (c) 2015 Research Organization for Information Science
|
||||
dnl Copyright (c) 2008-2018 Cisco Systems, Inc. All rights reserved
|
||||
dnl Copyright (c) 2013 Intel, Inc. All rights reserved.
|
||||
dnl Copyright (c) 2015-2018 Research Organization for Information Science
|
||||
dnl and Technology (RIST). All rights reserved.
|
||||
dnl Copyright (c) 2017 FUJITSU LIMITED. All rights reserved.
|
||||
dnl $COPYRIGHT$
|
||||
dnl
|
||||
dnl Additional copyrights may follow
|
||||
@ -23,82 +25,225 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
# This macro is necessary to get the title to be displayed first. :-)
|
||||
AC_DEFUN([OMPI_SETUP_JAVA_BINDINGS_BANNER],[
|
||||
opal_show_subtitle "Java MPI bindings"
|
||||
])
|
||||
dnl _OMPI_SETUP_JAVA()
|
||||
dnl ----------------
|
||||
dnl Invoked by OMPI_SETUP_JAVA only if --enable-mpi-java was specified.
|
||||
AC_DEFUN([_OMPI_SETUP_JAVA],[
|
||||
OPAL_VAR_SCOPE_PUSH([ompi_java_bad ompi_java_found ompi_java_dir ompi_java_jnih ompi_java_PATH_save ompi_java_CPPFLAGS_save])
|
||||
|
||||
# OMPI_SETUP_JAVA_BINDINGS()
|
||||
# ----------------
|
||||
# Do everything required to setup the Java MPI bindings. Safe to AC_REQUIRE
|
||||
# this macro.
|
||||
AC_DEFUN([OMPI_SETUP_JAVA_BINDINGS],[
|
||||
# must have Java setup
|
||||
AC_REQUIRE([OPAL_SETUP_JAVA])
|
||||
# Check for bozo case: ensure a directory was specified
|
||||
AS_IF([test "$with_jdk_dir" = "yes" || test "$with_jdk_dir" = "no"],
|
||||
[AC_MSG_WARN([Must specify a directory name for --with-jdk-dir])
|
||||
AC_MSG_ERROR([Cannot continue])])
|
||||
AS_IF([test "$with_jdk_bindir" = "yes" || test "$with_jdk_bindir" = "no"],
|
||||
[AC_MSG_WARN([Must specify a directory name for --with-jdk-bindir])
|
||||
AC_MSG_ERROR([Cannot continue])])
|
||||
AS_IF([test "$with_jdk_headers" = "yes" || test "$with_jdk_headers" = "no"],
|
||||
[AC_MSG_WARN([Must specify a directory name for --with-jdk-headers])
|
||||
AC_MSG_ERROR([Cannot continue])])
|
||||
|
||||
AC_REQUIRE([OMPI_SETUP_JAVA_BINDINGS_BANNER])
|
||||
# Check for bozo case: either specify --with-jdk-dir or
|
||||
# (--with-jdk-bindir, --with-jdk-headers) -- not both.
|
||||
ompi_java_bad=0
|
||||
AS_IF([test -n "$with_jdk_dir" && \
|
||||
(test -n "$with_jdk_bindir" || test -n "$with_jdk_headers")],
|
||||
[ompi_java_bad=1])
|
||||
AS_IF([(test -z "$with_jdk_bindir" && test -n "$with_jdk_headers") || \
|
||||
(test -n "$with_jdk_bindir" && test -z "$with_jdk_headers")],
|
||||
[ompi_java_bad=1])
|
||||
AS_IF([test $ompi_java_bad -eq 1],
|
||||
[AC_MSG_WARN([Either specify --with-jdk-dir or both of (--with-jdk_bindir, --with-jdk-headers) -- not both.])
|
||||
AC_MSG_ERROR([Cannot continue])])
|
||||
|
||||
AC_MSG_CHECKING([if want Java bindings])
|
||||
AC_ARG_ENABLE(mpi-java,
|
||||
AC_HELP_STRING([--enable-mpi-java],
|
||||
[enable Java MPI bindings (default: disabled)]))
|
||||
AS_IF([test -n "$with_jdk_dir"],
|
||||
[with_jdk_bindir=$with_jdk_dir/bin
|
||||
with_jdk_headers=$with_jdk_dir/include])
|
||||
|
||||
# check for required support
|
||||
if test "$opal_java_happy" = "no" && test "$enable_mpi_java" = "yes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_MSG_WARN([Java bindings requested but no Java support found])
|
||||
AC_MSG_ERROR([cannot continue])
|
||||
fi
|
||||
##################################################################
|
||||
# with_jdk_dir can now be ignored; with_jdk_bindir and
|
||||
# with_jdk_headers will be either empty or have valid values.
|
||||
##################################################################
|
||||
|
||||
# Only build the Java bindings if requested
|
||||
if test "$opal_java_happy" = "yes" && test "$enable_mpi_java" = "yes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
WANT_MPI_JAVA_SUPPORT=1
|
||||
AC_MSG_CHECKING([if shared libraries are enabled])
|
||||
AS_IF([test "$enable_shared" != "yes"],
|
||||
[AC_MSG_RESULT([no])
|
||||
AC_MSG_WARN([Java bindings cannot be built without shared libraries])
|
||||
AC_MSG_WARN([Please reconfigure with --enable-shared])
|
||||
AC_MSG_ERROR([Cannot continue])],
|
||||
[AC_MSG_RESULT([yes])])
|
||||
# must have Java support
|
||||
AC_MSG_CHECKING([if Java support was found])
|
||||
AS_IF([test "$opal_java_happy" = "yes"],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_WARN([Java MPI bindings requested, but Java support was not found])
|
||||
AC_MSG_WARN([Please reconfigure the --with-jdk options to where Java])
|
||||
AC_MSG_WARN([support can be found])
|
||||
AC_MSG_ERROR([Cannot continue])])
|
||||
# Some java installations are in obscure places. So let's
|
||||
# hard-code a few of the common ones so that users don't have to
|
||||
# specify --with-java-<foo>=LONG_ANNOYING_DIRECTORY.
|
||||
AS_IF([test -z "$with_jdk_bindir"],
|
||||
[ # OS X/macOS
|
||||
ompi_java_found=0
|
||||
# The following logic was deliberately decided upon in
|
||||
# https://github.com/open-mpi/ompi/pull/5015 specifically
|
||||
# to prevent this script and the rest of Open MPI's build
|
||||
# system from getting confused by the somewhat unorthodox
|
||||
# Java toolchain layout present on OS X/macOS systems,
|
||||
# described in depth by
|
||||
# https://github.com/open-mpi/ompi/pull/5015#issuecomment-379324639,
|
||||
# and mishandling OS X/macOS Java toolchain path detection
|
||||
# as a result.
|
||||
AS_IF([test -x /usr/libexec/java_home],
|
||||
[ompi_java_dir=`/usr/libexec/java_home`],
|
||||
[ompi_java_dir=/System/Library/Frameworks/JavaVM.framework/Versions/Current])
|
||||
AC_MSG_CHECKING([for Java in OS X/macOS locations])
|
||||
AS_IF([test -d $ompi_java_dir],
|
||||
[AC_MSG_RESULT([found ($ompi_java_dir)])
|
||||
ompi_java_found=1
|
||||
if test -d "$ompi_java_dir/Headers" && test -d "$ompi_java_dir/Commands"; then
|
||||
with_jdk_headers=$ompi_java_dir/Headers
|
||||
with_jdk_bindir=$ompi_java_dir/Commands
|
||||
elif test -d "$ompi_java_dir/include" && test -d "$ompi_java_dir/bin"; then
|
||||
with_jdk_headers=$ompi_java_dir/include
|
||||
with_jdk_bindir=$ompi_java_dir/bin
|
||||
else
|
||||
AC_MSG_WARN([No recognized OS X/macOS JDK directory structure found under $ompi_java_dir])
|
||||
ompi_java_found=0
|
||||
fi],
|
||||
[AC_MSG_RESULT([not found])])
|
||||
|
||||
# Mac Java requires this file (i.e., some other Java-related
|
||||
# header file needs this file, so we need to check for
|
||||
# it/include it in our sources when compiling on Mac).
|
||||
AC_CHECK_HEADERS([TargetConditionals.h])
|
||||
if test "$ompi_java_found" = "0"; then
|
||||
# Various Linux
|
||||
if test -z "$JAVA_HOME"; then
|
||||
ompi_java_dir='/usr/lib/jvm/java-*-openjdk-*/include/'
|
||||
else
|
||||
ompi_java_dir=$JAVA_HOME/include
|
||||
fi
|
||||
ompi_java_jnih=`ls $ompi_java_dir/jni.h 2>/dev/null | head -n 1`
|
||||
AC_MSG_CHECKING([for Java in Linux locations])
|
||||
AS_IF([test -r "$ompi_java_jnih"],
|
||||
[with_jdk_headers=`dirname $ompi_java_jnih`
|
||||
OPAL_WHICH([javac], [with_jdk_bindir])
|
||||
AS_IF([test -n "$with_jdk_bindir"],
|
||||
[AC_MSG_RESULT([found ($with_jdk_headers)])
|
||||
ompi_java_found=1
|
||||
with_jdk_bindir=`dirname $with_jdk_bindir`],
|
||||
[with_jdk_headers=])],
|
||||
[ompi_java_dir='/usr/lib/jvm/default-java/include/'
|
||||
ompi_java_jnih=`ls $ompi_java_dir/jni.h 2>/dev/null | head -n 1`
|
||||
AS_IF([test -r "$ompi_java_jnih"],
|
||||
[with_jdk_headers=`dirname $ompi_java_jnih`
|
||||
OPAL_WHICH([javac], [with_jdk_bindir])
|
||||
AS_IF([test -n "$with_jdk_bindir"],
|
||||
[AC_MSG_RESULT([found ($with_jdk_headers)])
|
||||
ompi_java_found=1
|
||||
with_jdk_bindir=`dirname $with_jdk_bindir`],
|
||||
[with_jdk_headers=])],
|
||||
[AC_MSG_RESULT([not found])])])
|
||||
fi
|
||||
|
||||
# dladdr and Dl_info are required to build the full path to libmpi on OS X 10.11 aka El Capitan
|
||||
AC_CHECK_TYPES([Dl_info], [], [], [[#include <dlfcn.h>]])
|
||||
if test "$ompi_java_found" = "0"; then
|
||||
# Solaris
|
||||
ompi_java_dir=/usr/java
|
||||
AC_MSG_CHECKING([for Java in Solaris locations])
|
||||
AS_IF([test -d $ompi_java_dir && test -r "$ompi_java_dir/include/jni.h"],
|
||||
[AC_MSG_RESULT([found ($ompi_java_dir)])
|
||||
with_jdk_headers=$ompi_java_dir/include
|
||||
with_jdk_bindir=$ompi_java_dir/bin
|
||||
ompi_java_found=1],
|
||||
[AC_MSG_RESULT([not found])])
|
||||
fi
|
||||
],
|
||||
[ompi_java_found=1])
|
||||
|
||||
if test "$ompi_java_found" = "1"; then
|
||||
OPAL_CHECK_WITHDIR([jdk-bindir], [$with_jdk_bindir], [javac])
|
||||
OPAL_CHECK_WITHDIR([jdk-headers], [$with_jdk_headers], [jni.h])
|
||||
|
||||
# Look for various Java-related programs
|
||||
ompi_java_happy=no
|
||||
ompi_java_PATH_save=$PATH
|
||||
AS_IF([test -n "$with_jdk_bindir" && test "$with_jdk_bindir" != "yes" && test "$with_jdk_bindir" != "no"],
|
||||
[PATH="$with_jdk_bindir:$PATH"])
|
||||
AC_PATH_PROG(JAVAC, javac)
|
||||
AC_PATH_PROG(JAR, jar)
|
||||
AC_PATH_PROG(JAVADOC, javadoc)
|
||||
AC_PATH_PROG(JAVAH, javah)
|
||||
PATH=$ompi_java_PATH_save
|
||||
|
||||
# Check to see if we have all 3 programs.
|
||||
AS_IF([test -z "$JAVAC" || test -z "$JAR" || test -z "$JAVADOC"],
|
||||
[ompi_java_happy=no],
|
||||
[ompi_java_happy=yes])
|
||||
|
||||
# Look for jni.h
|
||||
AS_IF([test "$ompi_java_happy" = "yes"],
|
||||
[ompi_java_CPPFLAGS_save=$CPPFLAGS
|
||||
# silence a stupid Mac warning
|
||||
CPPFLAGS="$CPPFLAGS -DTARGET_RT_MAC_CFM=0"
|
||||
AC_MSG_CHECKING([javac -h])
|
||||
cat > Conftest.java << EOF
|
||||
public final class Conftest {
|
||||
public native void conftest();
|
||||
}
|
||||
EOF
|
||||
AS_IF([$JAVAC -d . -h . Conftest.java > /dev/null 2>&1],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([no])
|
||||
AS_IF([test -n "$JAVAH"],
|
||||
[ompi_javah_happy=yes],
|
||||
[ompi_java_happy=no])])
|
||||
rm -f Conftest.java Conftest.class Conftest.h
|
||||
|
||||
AS_IF([test -n "$with_jdk_headers" && test "$with_jdk_headers" != "yes" && test "$with_jdk_headers" != "no"],
|
||||
[OMPI_JDK_CPPFLAGS="-I$with_jdk_headers"
|
||||
# Some flavors of JDK also require -I<blah>/linux.
|
||||
# See if that's there, and if so, add a -I for that,
|
||||
# too. Ugh.
|
||||
AS_IF([test -d "$with_jdk_headers/linux"],
|
||||
[OMPI_JDK_CPPFLAGS="$OMPI_JDK_CPPFLAGS -I$with_jdk_headers/linux"])
|
||||
# Solaris JDK also require -I<blah>/solaris.
|
||||
# See if that's there, and if so, add a -I for that,
|
||||
# too. Ugh.
|
||||
AS_IF([test -d "$with_jdk_headers/solaris"],
|
||||
[OMPI_JDK_CPPFLAGS="$OMPI_JDK_CPPFLAGS -I$with_jdk_headers/solaris"])
|
||||
# Darwin JDK also require -I<blah>/darwin.
|
||||
# See if that's there, and if so, add a -I for that,
|
||||
# too. Ugh.
|
||||
AS_IF([test -d "$with_jdk_headers/darwin"],
|
||||
[OMPI_JDK_CPPFLAGS="$OMPI_JDK_CPPFLAGS -I$with_jdk_headers/darwin"])
|
||||
|
||||
CPPFLAGS="$CPPFLAGS $OMPI_JDK_CPPFLAGS"])
|
||||
AC_CHECK_HEADER([jni.h], [],
|
||||
[ompi_java_happy=no])
|
||||
CPPFLAGS=$ompi_java_CPPFLAGS_save
|
||||
])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
WANT_MPI_JAVA_SUPPORT=0
|
||||
ompi_java_happy=no
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED([OMPI_WANT_JAVA_BINDINGS], [$WANT_MPI_JAVA_SUPPORT],
|
||||
[do we want java mpi bindings])
|
||||
AM_CONDITIONAL(OMPI_WANT_JAVA_BINDINGS, test "$WANT_MPI_JAVA_SUPPORT" = "1")
|
||||
AC_SUBST(OMPI_JDK_CPPFLAGS)
|
||||
|
||||
# Are we happy?
|
||||
AS_IF([test "$WANT_MPI_JAVA_SUPPORT" = "1"],
|
||||
[AC_MSG_WARN([******************************************************])
|
||||
AC_MSG_WARN([*** Java MPI bindings are provided on a provisional])
|
||||
AC_MSG_WARN([*** basis. They are NOT part of the current or])
|
||||
AC_MSG_WARN([*** proposed MPI standard. Continued inclusion of])
|
||||
AC_MSG_WARN([*** the Java MPI bindings in Open MPI is contingent])
|
||||
AC_MSG_WARN([*** upon user interest and developer support.])
|
||||
AC_MSG_WARN([******************************************************])
|
||||
])
|
||||
# Are we happy?
|
||||
AC_MSG_CHECKING([if Java support available])
|
||||
AS_IF([test "$ompi_java_happy" = "yes"],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([no])
|
||||
AC_MSG_WARN([Java support requested but not found.])
|
||||
AC_MSG_ERROR([Cannot continue])])
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
ompi/mpi/java/Makefile
|
||||
ompi/mpi/java/java/Makefile
|
||||
ompi/mpi/java/c/Makefile
|
||||
])
|
||||
OPAL_VAR_SCOPE_POP
|
||||
])
|
||||
|
||||
dnl OMPI_SETUP_JAVA()
|
||||
dnl ----------------
|
||||
dnl Do everything required to setup the Java compiler.
|
||||
AC_DEFUN([OMPI_SETUP_JAVA],[
|
||||
OPAL_VAR_SCOPE_PUSH([ompi_java_happy ompi_javah_happy])
|
||||
|
||||
ompi_java_happy=no
|
||||
ompi_javah_happy=no
|
||||
|
||||
AC_ARG_WITH(jdk-dir,
|
||||
AC_HELP_STRING([--with-jdk-dir(=DIR)],
|
||||
[Location of the JDK header directory. If you use this option, do not specify --with-jdk-bindir or --with-jdk-headers.]))
|
||||
AC_ARG_WITH(jdk-bindir,
|
||||
AC_HELP_STRING([--with-jdk-bindir(=DIR)],
|
||||
[Location of the JDK bin directory. If you use this option, you must also use --with-jdk-headers (and you must NOT use --with-jdk-dir)]))
|
||||
AC_ARG_WITH(jdk-headers,
|
||||
AC_HELP_STRING([--with-jdk-headers(=DIR)],
|
||||
[Location of the JDK header directory. If you use this option, you must also use --with-jdk-bindir (and you must NOT use --with-jdk-dir)]))
|
||||
|
||||
# Only setup the compiler if we were requested to
|
||||
AS_IF([test "$1" = "yes"],
|
||||
[_OMPI_SETUP_JAVA])
|
||||
|
||||
AM_CONDITIONAL(OMPI_HAVE_JAVAH_SUPPORT, test "$ompi_javah_happy" = "yes")
|
||||
|
||||
OPAL_VAR_SCOPE_POP
|
||||
])
|
||||
|
85
config/ompi_setup_mpi_java.m4
Normal file
85
config/ompi_setup_mpi_java.m4
Normal file
@ -0,0 +1,85 @@
|
||||
dnl -*- shell-script -*-
|
||||
dnl
|
||||
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
dnl University Research and Technology
|
||||
dnl Corporation. All rights reserved.
|
||||
dnl Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
dnl of Tennessee Research Foundation. All rights
|
||||
dnl reserved.
|
||||
dnl Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
|
||||
dnl University of Stuttgart. All rights reserved.
|
||||
dnl Copyright (c) 2004-2006 The Regents of the University of California.
|
||||
dnl All rights reserved.
|
||||
dnl Copyright (c) 2006-2012 Los Alamos National Security, LLC. All rights
|
||||
dnl reserved.
|
||||
dnl Copyright (c) 2007-2012 Oracle and/or its affiliates. All rights reserved.
|
||||
dnl Copyright (c) 2008-2018 Cisco Systems, Inc. All rights reserved
|
||||
dnl Copyright (c) 2015 Research Organization for Information Science
|
||||
dnl and Technology (RIST). All rights reserved.
|
||||
dnl $COPYRIGHT$
|
||||
dnl
|
||||
dnl Additional copyrights may follow
|
||||
dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
dnl OMPI_SETUP_JAVA_BINDINGS()
|
||||
dnl ----------------
|
||||
dnl Do everything required to setup the Java MPI bindings.
|
||||
AC_DEFUN([OMPI_SETUP_JAVA_BINDINGS],[
|
||||
opal_show_subtitle "Java MPI bindings"
|
||||
|
||||
AC_ARG_ENABLE(mpi-java,
|
||||
AC_HELP_STRING([--enable-mpi-java],
|
||||
[enable Java MPI bindings (default: disabled)]))
|
||||
|
||||
# Find the Java compiler and whatnot.
|
||||
# It knows to do very little if $enable_mpi_java!="yes".
|
||||
OMPI_SETUP_JAVA([$enable_mpi_java])
|
||||
|
||||
# Only build the Java bindings if requested
|
||||
AC_MSG_CHECKING([if want Java bindings])
|
||||
if test "$enable_mpi_java" = "yes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
WANT_MPI_JAVA_BINDINGS=1
|
||||
AC_MSG_CHECKING([if shared libraries are enabled])
|
||||
AS_IF([test "$enable_shared" != "yes"],
|
||||
[AC_MSG_RESULT([no])
|
||||
AC_MSG_WARN([Java bindings cannot be built without shared libraries])
|
||||
AC_MSG_WARN([Please reconfigure with --enable-shared])
|
||||
AC_MSG_ERROR([Cannot continue])],
|
||||
[AC_MSG_RESULT([yes])])
|
||||
|
||||
# Mac Java requires this file (i.e., some other Java-related
|
||||
# header file needs this file, so we need to check for
|
||||
# it/include it in our sources when compiling on Mac).
|
||||
AC_CHECK_HEADERS([TargetConditionals.h])
|
||||
|
||||
# dladdr and Dl_info are required to build the full path to
|
||||
# libmpi on OS X 10.11 (a.k.a. El Capitan)
|
||||
AC_CHECK_TYPES([Dl_info], [], [], [[#include <dlfcn.h>]])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
WANT_MPI_JAVA_BINDINGS=0
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED([OMPI_WANT_JAVA_BINDINGS], [$WANT_MPI_JAVA_BINDINGS],
|
||||
[do we want java mpi bindings])
|
||||
AM_CONDITIONAL(OMPI_WANT_JAVA_BINDINGS, test "$WANT_MPI_JAVA_BINDINGS" = "1")
|
||||
|
||||
# Are we happy?
|
||||
AS_IF([test $WANT_MPI_JAVA_BINDINGS -eq 1],
|
||||
[AC_MSG_WARN([******************************************************])
|
||||
AC_MSG_WARN([*** Java MPI bindings are provided on a provisional])
|
||||
AC_MSG_WARN([*** basis. They are NOT part of the current or])
|
||||
AC_MSG_WARN([*** proposed MPI standard. Continued inclusion of])
|
||||
AC_MSG_WARN([*** the Java MPI bindings in Open MPI is contingent])
|
||||
AC_MSG_WARN([*** upon user interest and developer support.])
|
||||
AC_MSG_WARN([******************************************************])
|
||||
])
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
ompi/mpi/java/Makefile
|
||||
ompi/mpi/java/java/Makefile
|
||||
ompi/mpi/java/c/Makefile
|
||||
])
|
||||
])
|
@ -1,247 +0,0 @@
|
||||
dnl -*- shell-script -*-
|
||||
dnl
|
||||
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
dnl University Research and Technology
|
||||
dnl Corporation. All rights reserved.
|
||||
dnl Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
dnl of Tennessee Research Foundation. All rights
|
||||
dnl reserved.
|
||||
dnl Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
|
||||
dnl University of Stuttgart. All rights reserved.
|
||||
dnl Copyright (c) 2004-2006 The Regents of the University of California.
|
||||
dnl All rights reserved.
|
||||
dnl Copyright (c) 2006-2012 Los Alamos National Security, LLC. All rights
|
||||
dnl reserved.
|
||||
dnl Copyright (c) 2007-2012 Oracle and/or its affiliates. All rights reserved.
|
||||
dnl Copyright (c) 2008-2013 Cisco Systems, Inc. All rights reserved.
|
||||
dnl Copyright (c) 2013 Intel, Inc. All rights reserved.
|
||||
dnl Copyright (c) 2015-2018 Research Organization for Information Science
|
||||
dnl and Technology (RIST). All rights reserved.
|
||||
dnl Copyright (c) 2017 FUJITSU LIMITED. All rights reserved.
|
||||
dnl $COPYRIGHT$
|
||||
dnl
|
||||
dnl Additional copyrights may follow
|
||||
dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
# This macro is necessary to get the title to be displayed first. :-)
|
||||
AC_DEFUN([OPAL_SETUP_JAVA_BANNER],[
|
||||
opal_show_subtitle "Java compiler"
|
||||
])
|
||||
|
||||
# OPAL_SETUP_JAVA()
|
||||
# ----------------
|
||||
# Do everything required to setup the Java compiler. Safe to AC_REQUIRE
|
||||
# this macro.
|
||||
AC_DEFUN([OPAL_SETUP_JAVA],[
|
||||
AC_REQUIRE([OPAL_SETUP_JAVA_BANNER])
|
||||
|
||||
OPAL_VAR_SCOPE_PUSH([opal_java_bad opal_javah_happy opal_java_found opal_java_dir opal_java_jnih opal_java_PATH_save opal_java_CPPFLAGS_save])
|
||||
AC_ARG_ENABLE(java,
|
||||
AC_HELP_STRING([--enable-java],
|
||||
[Enable Java-based support in the system - use this option to disable all Java-based compiler tests (default: enabled)]))
|
||||
|
||||
AC_ARG_WITH(jdk-dir,
|
||||
AC_HELP_STRING([--with-jdk-dir(=DIR)],
|
||||
[Location of the JDK header directory. If you use this option, do not specify --with-jdk-bindir or --with-jdk-headers.]))
|
||||
AC_ARG_WITH(jdk-bindir,
|
||||
AC_HELP_STRING([--with-jdk-bindir(=DIR)],
|
||||
[Location of the JDK bin directory. If you use this option, you must also use --with-jdk-headers (and you must NOT use --with-jdk-dir)]))
|
||||
AC_ARG_WITH(jdk-headers,
|
||||
AC_HELP_STRING([--with-jdk-headers(=DIR)],
|
||||
[Location of the JDK header directory. If you use this option, you must also use --with-jdk-bindir (and you must NOT use --with-jdk-dir)]))
|
||||
|
||||
if test "$enable_java" = "no"; then
|
||||
HAVE_JAVA_SUPPORT=0
|
||||
opal_java_happy=no
|
||||
else
|
||||
# Check for bozo case: ensure a directory was specified
|
||||
AS_IF([test "$with_jdk_dir" = "yes" || test "$with_jdk_dir" = "no"],
|
||||
[AC_MSG_WARN([Must specify a directory name for --with-jdk-dir])
|
||||
AC_MSG_ERROR([Cannot continue])])
|
||||
AS_IF([test "$with_jdk_bindir" = "yes" || test "$with_jdk_bindir" = "no"],
|
||||
[AC_MSG_WARN([Must specify a directory name for --with-jdk-bindir])
|
||||
AC_MSG_ERROR([Cannot continue])])
|
||||
AS_IF([test "$with_jdk_headers" = "yes" || test "$with_jdk_headers" = "no"],
|
||||
[AC_MSG_WARN([Must specify a directory name for --with-jdk-headers])
|
||||
AC_MSG_ERROR([Cannot continue])])
|
||||
|
||||
# Check for bozo case: either specify --with-jdk-dir or
|
||||
# (--with-jdk-bindir, --with-jdk-headers) -- not both.
|
||||
opal_java_bad=0
|
||||
AS_IF([test -n "$with_jdk_dir" && \
|
||||
(test -n "$with_jdk_bindir" || test -n "$with_jdk_headers")],
|
||||
[opal_java_bad=1])
|
||||
AS_IF([(test -z "$with_jdk_bindir" && test -n "$with_jdk_headers") || \
|
||||
(test -n "$with_jdk_bindir" && test -z "$with_jdk_headers")],
|
||||
[opal_java_bad=1])
|
||||
AS_IF([test "$opal_java_bad" = "1"],
|
||||
[AC_MSG_WARN([Either specify --with-jdk-dir or both of (--with-jdk_bindir, --with-jdk-headers) -- not both.])
|
||||
AC_MSG_ERROR([Cannot continue])])
|
||||
|
||||
AS_IF([test -n "$with_jdk_dir"],
|
||||
[with_jdk_bindir=$with_jdk_dir/bin
|
||||
with_jdk_headers=$with_jdk_dir/include])
|
||||
|
||||
##################################################################
|
||||
# with_jdk_dir can now be ignored; with_jdk_bindir and
|
||||
# with_jdk_headers will be either empty or have valid values.
|
||||
##################################################################
|
||||
|
||||
# Some java installations are in obscure places. So let's
|
||||
# hard-code a few of the common ones so that users don't have to
|
||||
# specify --with-java-<foo>=LONG_ANNOYING_DIRECTORY.
|
||||
AS_IF([test -z "$with_jdk_bindir"],
|
||||
[ # OS X/macOS
|
||||
opal_java_found=0
|
||||
# The following logic was deliberately decided upon in https://github.com/open-mpi/ompi/pull/5015 specifically to prevent this script and the
|
||||
# rest of Open MPI's build system from getting confused by the somewhat unorthodox Java toolchain layout present on OS X/macOS systems, described
|
||||
# in depth by https://github.com/open-mpi/ompi/pull/5015#issuecomment-379324639, and mishandling OS X/macOS Java toolchain path
|
||||
# detection as a result.
|
||||
AS_IF([test -x /usr/libexec/java_home],
|
||||
[opal_java_dir=`/usr/libexec/java_home`],
|
||||
[opal_java_dir=/System/Library/Frameworks/JavaVM.framework/Versions/Current])
|
||||
AC_MSG_CHECKING([OS X/macOS locations])
|
||||
AS_IF([test -d $opal_java_dir],
|
||||
[AC_MSG_RESULT([found ($opal_java_dir)])
|
||||
opal_java_found=1
|
||||
if test -d "$opal_java_dir/Headers" && test -d "$opal_java_dir/Commands"; then
|
||||
with_jdk_headers=$opal_java_dir/Headers
|
||||
with_jdk_bindir=$opal_java_dir/Commands
|
||||
elif test -d "$opal_java_dir/include" && test -d "$opal_java_dir/bin"; then
|
||||
with_jdk_headers=$opal_java_dir/include
|
||||
with_jdk_bindir=$opal_java_dir/bin
|
||||
else
|
||||
AC_MSG_WARN([No recognized OS X/macOS JDK directory structure found under $opal_java_dir])
|
||||
opal_java_found=0
|
||||
fi],
|
||||
[AC_MSG_RESULT([not found])])
|
||||
|
||||
if test "$opal_java_found" = "0"; then
|
||||
# Various Linux
|
||||
if test -z "$JAVA_HOME"; then
|
||||
opal_java_dir='/usr/lib/jvm/java-*-openjdk-*/include/'
|
||||
else
|
||||
opal_java_dir=$JAVA_HOME/include
|
||||
fi
|
||||
opal_java_jnih=`ls $opal_java_dir/jni.h 2>/dev/null | head -n 1`
|
||||
AC_MSG_CHECKING([Linux locations])
|
||||
AS_IF([test -r "$opal_java_jnih"],
|
||||
[with_jdk_headers=`dirname $opal_java_jnih`
|
||||
OPAL_WHICH([javac], [with_jdk_bindir])
|
||||
AS_IF([test -n "$with_jdk_bindir"],
|
||||
[AC_MSG_RESULT([found ($with_jdk_headers)])
|
||||
opal_java_found=1
|
||||
with_jdk_bindir=`dirname $with_jdk_bindir`],
|
||||
[with_jdk_headers=])],
|
||||
[opal_java_dir='/usr/lib/jvm/default-java/include/'
|
||||
opal_java_jnih=`ls $opal_java_dir/jni.h 2>/dev/null | head -n 1`
|
||||
AS_IF([test -r "$opal_java_jnih"],
|
||||
[with_jdk_headers=`dirname $opal_java_jnih`
|
||||
OPAL_WHICH([javac], [with_jdk_bindir])
|
||||
AS_IF([test -n "$with_jdk_bindir"],
|
||||
[AC_MSG_RESULT([found ($with_jdk_headers)])
|
||||
opal_java_found=1
|
||||
with_jdk_bindir=`dirname $with_jdk_bindir`],
|
||||
[with_jdk_headers=])],
|
||||
[AC_MSG_RESULT([not found])])])
|
||||
fi
|
||||
|
||||
if test "$opal_java_found" = "0"; then
|
||||
# Solaris
|
||||
opal_java_dir=/usr/java
|
||||
AC_MSG_CHECKING([Solaris locations])
|
||||
AS_IF([test -d $opal_java_dir && test -r "$opal_java_dir/include/jni.h"],
|
||||
[AC_MSG_RESULT([found ($opal_java_dir)])
|
||||
with_jdk_headers=$opal_java_dir/include
|
||||
with_jdk_bindir=$opal_java_dir/bin
|
||||
opal_java_found=1],
|
||||
[AC_MSG_RESULT([not found])])
|
||||
fi
|
||||
],
|
||||
[opal_java_found=1])
|
||||
|
||||
if test "$opal_java_found" = "1"; then
|
||||
OPAL_CHECK_WITHDIR([jdk-bindir], [$with_jdk_bindir], [javac])
|
||||
OPAL_CHECK_WITHDIR([jdk-headers], [$with_jdk_headers], [jni.h])
|
||||
|
||||
# Look for various Java-related programs
|
||||
opal_java_happy=no
|
||||
opal_java_PATH_save=$PATH
|
||||
AS_IF([test -n "$with_jdk_bindir" && test "$with_jdk_bindir" != "yes" && test "$with_jdk_bindir" != "no"],
|
||||
[PATH="$with_jdk_bindir:$PATH"])
|
||||
AC_PATH_PROG(JAVAC, javac)
|
||||
AC_PATH_PROG(JAR, jar)
|
||||
AC_PATH_PROG(JAVADOC, javadoc)
|
||||
AC_PATH_PROG(JAVAH, javah)
|
||||
PATH=$opal_java_PATH_save
|
||||
|
||||
# Check to see if we have all 3 programs.
|
||||
AS_IF([test -z "$JAVAC" || test -z "$JAR" || test -z "$JAVADOC"],
|
||||
[opal_java_happy=no
|
||||
HAVE_JAVA_SUPPORT=0],
|
||||
[opal_java_happy=yes
|
||||
HAVE_JAVA_SUPPORT=1])
|
||||
|
||||
# Look for jni.h
|
||||
AS_IF([test "$opal_java_happy" = "yes"],
|
||||
[opal_java_CPPFLAGS_save=$CPPFLAGS
|
||||
# silence a stupid Mac warning
|
||||
CPPFLAGS="$CPPFLAGS -DTARGET_RT_MAC_CFM=0"
|
||||
AC_MSG_CHECKING([javac -h])
|
||||
cat > Conftest.java << EOF
|
||||
public final class Conftest {
|
||||
public native void conftest();
|
||||
}
|
||||
EOF
|
||||
AS_IF([$JAVAC -d . -h . Conftest.java > /dev/null 2>&1],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([no])
|
||||
AS_IF([test -n "$JAVAH"],
|
||||
[opal_javah_happy=yes],
|
||||
[opal_java_happy=no])])
|
||||
rm -f Conftest.java Conftest.class Conftest.h
|
||||
|
||||
|
||||
AS_IF([test -n "$with_jdk_headers" && test "$with_jdk_headers" != "yes" && test "$with_jdk_headers" != "no"],
|
||||
[OPAL_JDK_CPPFLAGS="-I$with_jdk_headers"
|
||||
# Some flavors of JDK also require -I<blah>/linux.
|
||||
# See if that's there, and if so, add a -I for that,
|
||||
# too. Ugh.
|
||||
AS_IF([test -d "$with_jdk_headers/linux"],
|
||||
[OPAL_JDK_CPPFLAGS="$OPAL_JDK_CPPFLAGS -I$with_jdk_headers/linux"])
|
||||
# Solaris JDK also require -I<blah>/solaris.
|
||||
# See if that's there, and if so, add a -I for that,
|
||||
# too. Ugh.
|
||||
AS_IF([test -d "$with_jdk_headers/solaris"],
|
||||
[OPAL_JDK_CPPFLAGS="$OPAL_JDK_CPPFLAGS -I$with_jdk_headers/solaris"])
|
||||
# Darwin JDK also require -I<blah>/darwin.
|
||||
# See if that's there, and if so, add a -I for that,
|
||||
# too. Ugh.
|
||||
AS_IF([test -d "$with_jdk_headers/darwin"],
|
||||
[OPAL_JDK_CPPFLAGS="$OPAL_JDK_CPPFLAGS -I$with_jdk_headers/darwin"])
|
||||
|
||||
CPPFLAGS="$CPPFLAGS $OPAL_JDK_CPPFLAGS"])
|
||||
AC_CHECK_HEADER([jni.h], [],
|
||||
[opal_java_happy=no])
|
||||
CPPFLAGS=$opal_java_CPPFLAGS_save
|
||||
])
|
||||
else
|
||||
opal_java_happy=no;
|
||||
HAVE_JAVA_SUPPORT=no;
|
||||
fi
|
||||
AC_SUBST(OPAL_JDK_CPPFLAGS)
|
||||
fi
|
||||
|
||||
# Are we happy?
|
||||
AC_MSG_CHECKING([Java support available])
|
||||
AS_IF([test "$opal_java_happy" = "no"],
|
||||
[AC_MSG_RESULT([no])],
|
||||
[AC_MSG_RESULT([yes])])
|
||||
|
||||
AC_DEFINE_UNQUOTED([OPAL_HAVE_JAVA_SUPPORT], [$HAVE_JAVA_SUPPORT], [do we have Java support])
|
||||
AM_CONDITIONAL(OPAL_HAVE_JAVA_SUPPORT, test "$opal_java_happy" = "yes")
|
||||
AM_CONDITIONAL(OPAL_HAVE_JAVAH_SUPPORT, test "$opal_javah_happy" = "yes")
|
||||
OPAL_VAR_SCOPE_POP
|
||||
])
|
@ -2,7 +2,7 @@ dnl -*- shell-script -*-
|
||||
dnl
|
||||
dnl Copyright (c) 2016 Los Alamos National Security, LLC. All rights
|
||||
dnl reserved.
|
||||
dnl Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
|
||||
dnl Copyright (c) 2016-2018 Cisco Systems, Inc. All rights reserved
|
||||
dnl Copyright (c) 2016 Research Organization for Information Science
|
||||
dnl and Technology (RIST). All rights reserved.
|
||||
dnl $COPYRIGHT$
|
||||
@ -67,7 +67,7 @@ EOF
|
||||
echo "Build MPI Fortran bindings: no"
|
||||
fi
|
||||
|
||||
if test x$WANT_MPI_JAVA_SUPPORT = x1 ; then
|
||||
if test $WANT_MPI_JAVA_BINDINGS -eq 1 ; then
|
||||
echo "Build MPI Java bindings (experimental): yes"
|
||||
else
|
||||
echo "MPI Build Java bindings (experimental): no"
|
||||
|
@ -1,6 +1,6 @@
|
||||
# -*- makefile -*-
|
||||
#
|
||||
# Copyright (c) 2011-2013 Cisco Systems, Inc. All rights reserved.
|
||||
# Copyright (c) 2011-2018 Cisco Systems, Inc. All rights reserved
|
||||
# Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
||||
# reserved.
|
||||
@ -17,7 +17,7 @@
|
||||
if OMPI_WANT_JAVA_BINDINGS
|
||||
|
||||
# Get the include files that were generated from the .java source files
|
||||
AM_CPPFLAGS = -I$(top_builddir)/ompi/mpi/java/java $(OPAL_JDK_CPPFLAGS) -DOMPI_LIBMPI_NAME=\"$(OMPI_LIBMPI_NAME)\" -DOPAL_DYN_LIB_SUFFIX=\"$(OPAL_DYN_LIB_SUFFIX)\"
|
||||
AM_CPPFLAGS = -I$(top_builddir)/ompi/mpi/java/java $(OMPI_JDK_CPPFLAGS) -DOMPI_LIBMPI_NAME=\"$(OMPI_LIBMPI_NAME)\" -DOPAL_DYN_LIB_SUFFIX=\"$(OPAL_DYN_LIB_SUFFIX)\"
|
||||
|
||||
headers = \
|
||||
mpiJava.h
|
||||
|
@ -1,6 +1,6 @@
|
||||
# -*- makefile -*-
|
||||
#
|
||||
# Copyright (c) 2011-2014 Cisco Systems, Inc. All rights reserved.
|
||||
# Copyright (c) 2011-2018 Cisco Systems, Inc. All rights reserved
|
||||
# Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
||||
# reserved.
|
||||
# Copyright (c) 2017 FUJITSU LIMITED. All rights reserved.
|
||||
@ -138,7 +138,7 @@ ompi__v_JAVADOC_QUIET_0 = -quiet
|
||||
# in. This, along with the fact that the .java files seem to have
|
||||
# circular references, prevents us from using a .foo.bar: generic
|
||||
# Makefile rule. :-(
|
||||
if OPAL_HAVE_JAVAH_SUPPORT
|
||||
if OMPI_HAVE_JAVAH_SUPPORT
|
||||
mpi/MPI.class: $(JAVA_SRC_FILES)
|
||||
$(OMPI_V_JAVAC) CLASSPATH=. ; \
|
||||
export CLASSPATH ; \
|
||||
@ -158,7 +158,7 @@ mpi/MPI.class: $(JAVA_SRC_FILES)
|
||||
$(OMPI_V_JAVAC) CLASSPATH=. ; \
|
||||
export CLASSPATH ; \
|
||||
$(JAVAC) -h . -d . $(top_srcdir)/ompi/mpi/java/java/*.java
|
||||
endif # OPAL_HAVE_JAVAH_SUPPORT
|
||||
endif # OMPI_HAVE_JAVAH_SUPPORT
|
||||
|
||||
# Generate the .jar file from all the class files. List mpi/MPI.class
|
||||
# as a dependency so that it fires the rule above that will generate
|
||||
@ -177,7 +177,7 @@ java_DATA = mpi.jar
|
||||
# List all the header files in BUILT_SOURCES so that Automake's "all"
|
||||
# target will build them. This will also force the building of the
|
||||
# mpi/*.class files (for the jar file).
|
||||
if OPAL_HAVE_JAVAH_SUPPORT
|
||||
if OMPI_HAVE_JAVAH_SUPPORT
|
||||
BUILT_SOURCES = $(JAVA_H) doc
|
||||
else
|
||||
BUILT_SOURCES = mpi/MPI.class doc
|
||||
|
Loading…
Reference in New Issue
Block a user