From fd50953387886f06dbf2cf6df7c546c9fb2d495f Mon Sep 17 00:00:00 2001 From: Mick Jordan <mick.jordan@oracle.com> Date: Tue, 10 Mar 2015 09:18:05 -0700 Subject: [PATCH] support FastR subprocesses --- com.oracle.truffle.r.native/Makefile | 5 ++- com.oracle.truffle.r.native/run/Makefile | 41 ++++++++++++++++++++++ com.oracle.truffle.r.native/run/R.sh | 23 ++++++++++++ com.oracle.truffle.r.native/run/Rscript.sh | 15 ++++++++ 4 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 com.oracle.truffle.r.native/run/Makefile create mode 100644 com.oracle.truffle.r.native/run/R.sh create mode 100755 com.oracle.truffle.r.native/run/Rscript.sh diff --git a/com.oracle.truffle.r.native/Makefile b/com.oracle.truffle.r.native/Makefile index f75b707169..68ffc952e2 100644 --- a/com.oracle.truffle.r.native/Makefile +++ b/com.oracle.truffle.r.native/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -29,8 +29,11 @@ all: $(MAKE) -C builtinlibs $(MAKE) -C fficall $(MAKE) -C library + $(MAKE) -C run clean: $(MAKE) -C builtinlibs clean $(MAKE) -C fficall clean $(MAKE) -C library clean + $(MAKE) -C run clean + \ No newline at end of file diff --git a/com.oracle.truffle.r.native/run/Makefile b/com.oracle.truffle.r.native/run/Makefile new file mode 100644 index 0000000000..150dd89423 --- /dev/null +++ b/com.oracle.truffle.r.native/run/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +.PHONY: bindir all rcmd + +FASTR_BINDIR = $(TOPDIR)/../bin + +all: bindir rcmd + +bindir: + mkdir -p $(FASTR_BINDIR) + +rcmd: $(FASTR_BINDIR)/R + +$(FASTR_BINDIR)/R: R.sh Rscript.sh + cp R.sh $(FASTR_BINDIR)/R + cp Rscript.sh $(FASTR_BINDIR)/Rscript + chmod +x $(FASTR_BINDIR)/R + touch $(FASTR_BINDIR)/INSTALL + +clean: diff --git a/com.oracle.truffle.r.native/run/R.sh b/com.oracle.truffle.r.native/run/R.sh new file mode 100644 index 0000000000..330eb49b3a --- /dev/null +++ b/com.oracle.truffle.r.native/run/R.sh @@ -0,0 +1,23 @@ +# +# 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) 1995-2012, The R Core Team +# Copyright (c) 2003, The R Foundation +# Copyright (c) 2015, Oracle and/or its affiliates +# +# All rights reserved. +# + +# Fledgling R command to startup FastR +# Currently all R CMD calls are forwarded to GnuR +# +GNUR=`which R` + +case ${1} in + CMD) + exec $GNUR "$@";; + *) + exec mx R "$@";; + esac diff --git a/com.oracle.truffle.r.native/run/Rscript.sh b/com.oracle.truffle.r.native/run/Rscript.sh new file mode 100755 index 0000000000..75da099b81 --- /dev/null +++ b/com.oracle.truffle.r.native/run/Rscript.sh @@ -0,0 +1,15 @@ +# +# 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) 1995-2012, The R Core Team +# Copyright (c) 2003, The R Foundation +# Copyright (c) 2015, Oracle and/or its affiliates +# +# All rights reserved. +# + +# Fledgling Rscript command to startup FastR + +mx Rscript "$@" -- GitLab