Skip to content
Snippets Groups Projects
Commit 45464d22 authored by stepan's avatar stepan
Browse files

Make sure rJava installation is as user-friendly as possible

parent 8e7a89a3
No related branches found
No related tags found
No related merge requests found
......@@ -39,7 +39,7 @@ logfiles : [
"com.oracle.truffle.r.native/gnur/tests/log/all.diff"
"com.oracle.truffle.r.test.native/embedded/*.output"
"com.oracle.truffle.r.test.native/embedded/src/*.output"
"*-tests/*.Rout"
"*-tests/**/*.Rout"
]
# This is needed by all (Linux) builds but is specific to the module system employed
......
......@@ -21,7 +21,10 @@
eval(expression({
excludedPkgs <- c("rJava")
excludedPkgsMsgs <- c("CRAN rJava is not supported on FastR, but you can download and install rJava compatible replacement package from https://github.com/oracle/fastr/master/com.oracle.truffle.r.pkgs/rJava")
excludedPkgsMsgs <- c(paste0(
"CRAN rJava is not supported on FastR, but you can download and install rJava compatible replacement package ",
"from https://github.com/oracle/fastr/master/com.oracle.truffle.r.pkgs/rJava.\n",
" Install it using 'R --jvm CMD INSTALL {fastr}/com.oracle.truffle.r.pkgs/rJava' and make sure that 'which R' points to FastR. "))
fastRPkgFilter <- function (av) {
# The following statement will assign the url of the FastR clone of rJava, when ready (possibly on GitHub).
......
......@@ -90,6 +90,7 @@ $(FASTR_BIN_DIR)/R: Makefile R.sh Rscript.sh Rscript_exec.sh Rclasspath.sh
cp $(GNUR_HOME_BINARY)/etc/javaconf $(FASTR_ETC_DIR)/javaconf
cp $(GNUR_HOME_BINARY)/etc/repositories $(FASTR_ETC_DIR)/repositories
cp $(GNUR_HOME_BINARY)/etc/ldpaths $(FASTR_ETC_DIR)/ldpaths
# the ed script adds -DFASTR to compiler options and removes JAVA related variables
ed Makeconf.etc < edMakeconf.etc
echo $(DEFAULT_CRAN_MIRROR) > $(FASTR_ETC_DIR)/DEFAULT_CRAN_MIRROR
......
/^CFLAGS/s/$/ -DFASTR/
/^CXXFLAGS/s/$/ -DFASTR/
/^CPPFLAGS/s/$/ -DFASTR/
g/JAVA_HOME =/d
/LIBINTL=/
d
/LIBR =/
......
JAVA_SRC=$(wildcard java/*.java)
JFLAGS=-source 1.6 -target 1.6
JAVAC=javac
JAVAC=${JAVA_HOME}/bin/javac
all: $(SHLIB)
$(SHLIB): java
......@@ -8,7 +8,7 @@ $(SHLIB): java
.PHONY: all java
java: $(JAVA_SRC)
$(JAVAC) $(JFLAGS) $(JAVA_SRC)
$(JAVAC) $(JFLAGS) $(JAVA_SRC) || (echo "ERROR: compilation failed, do you have properly configured JAVA_HOME environment variable?"; exit 1)
rm -rfv ../inst/java
mkdir -p ../inst/java
mv java/*.class ../inst/java
##
# This material is distributed under the GNU General Public License
# Version 2. You may review the terms of this license at
# http://www.gnu.org/licenses/gpl-2.0.html
#
# Copyright (c) 2006, Simon Urbanek
# Copyright (c) 2018, Oracle and/or its affiliates
#
# All rights reserved.
##
JAVA_SRC=$(wildcard *.java)
JFLAGS=-source 1.6 -target 1.6
JAVAC=javac
JAVA=java
JAVADOC=javadoc
JAVADOCFLAGS=-author -version -breakiterator -link http://java.sun.com/j2se/1.4.2/docs/api
all: compile test
compile: $(JAVA_SRC)
$(JAVAC) $(JFLAGS) $(JAVA_SRC)
test_RJavaTools: compile
$(JAVA) RJavaTools_Test
test_RJavaArrayTools: compile
$(JAVA) RJavaArrayTools_Test
test_ArrayWrapper:
$(JAVA) ArrayWrapper_Test
test_RectangularArrayBuilder:
$(JAVA) RectangularArrayBuilder_Test
test: compile test_RJavaTools test_RJavaArrayTools test_ArrayWrapper test_RectangularArrayBuilder
javadoc:
$(JAVADOC) $(JAVADOCFLAGS) -d javadoc $(JAVA_SRC)
clean:
rm -rfv *.class *~
.PHONY: all clean
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment