Skip to content

Commit cf8b421

Browse files
committed
[GR-13573] Script configure_fastr also generates files Renviron and ldpaths.
PullRequest: fastr/1918
2 parents d25a713 + cf5d783 commit cf8b421

File tree

8 files changed

+2473
-2003
lines changed

8 files changed

+2473
-2003
lines changed

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,22 @@ New features:
44

55
* new JUL-like logging infrastructure backed by Truffle
66
* FastR options backed by Truffle now. New command-line format - i.e. bin/r --R.PerformanceWarning="true". Also configurable via org.graal.polyglot.Context.Builder.
7+
* script configure_fastr also regenerates etc/Renviron and etc/ldpaths
8+
* FastR vectors are not writeable from other languages
9+
* in order to update FastR vectors from other languages:
10+
retrieve reference to the subset assign function `` `[<-` `` and execute it.
11+
Note that it will return the new vector with the updated values.
12+
13+
Added missing R builtins and C API
14+
15+
* `polyroot`
16+
* dummy implementation of `pcre_config`
717

818
Bug fixes:
919

10-
* when using GNU-R graphics (-UseInternalGridGraphics) FastR would still override the graphics package R functions
20+
* when using GNU-R graphics (--R.UseInternalGridGraphics=false) FastR would still override the graphics package R functions
1121
* cannot install RcppParallel #52
22+
* visibility propagation in `tryCatch`
1223

1324
# 1.0 RC 12
1425

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
### Default etc/Renviron file provided with FastR configured for generic MacOS
2+
###
3+
### ${R_HOME}/etc/Renviron
4+
###
5+
### Record R system environment variables.
6+
7+
R_PLATFORM=${R_PLATFORM-'x86_64-apple-darwin18.2.0'}
8+
## Default printer paper size: first record if user set R_PAPERSIZE
9+
R_PAPERSIZE_USER=${R_PAPERSIZE}
10+
R_PAPERSIZE=${R_PAPERSIZE-'a4'}
11+
## Default print command
12+
R_PRINTCMD=${R_PRINTCMD-'lpr'}
13+
# for Rd2pdf, reference manual
14+
R_RD4PDF=${R_RD4PDF-'times,inconsolata,hyper'}
15+
## used for options("texi2dvi")
16+
R_TEXI2DVICMD=${R_TEXI2DVICMD-${TEXI2DVI-'/usr/bin/texi2dvi'}}
17+
## used by INSTALL, untar() and installing grDevices
18+
R_GZIPCMD=${R_GZIPCMD-'/usr/bin/gzip'}
19+
## Default zip/unzip commands
20+
R_UNZIPCMD=${R_UNZIPCMD-'/usr/bin/unzip'}
21+
R_ZIPCMD=${R_ZIPCMD-'/usr/bin/zip'}
22+
R_BZIPCMD=${R_BZIPCMD-'/usr/bin/bzip2'}
23+
## Default browser
24+
R_BROWSER=${R_BROWSER-'/usr/bin/open'}
25+
## Default editor
26+
EDITOR=${EDITOR-${VISUAL-vi}}
27+
## Default pager
28+
PAGER=${PAGER-'/usr/bin/less'}
29+
## Default PDF viewer
30+
R_PDFVIEWER=${R_PDFVIEWER-'/usr/bin/open'}
31+
## Used by libtool
32+
LN_S='ln -s'
33+
MAKE=${MAKE-'make'}
34+
## Prefer a POSIX-compliant sed on e.g. Solaris
35+
SED=${SED-'/usr/bin/sed'}
36+
## Prefer a tar that can automagically read compressed archives
37+
## Used in R CMD INSTALL for binary packages
38+
TAR=${TAR-'/usr/bin/tar'}
39+
40+
## System and compiler types.
41+
R_SYSTEM_ABI='osx,gcc,gxx,gfortran,?'
42+
43+
R_LIBS_USER=${R_LIBS_USER-'~/R/x86_64-apple-darwin18.2.0-library/3.5'}
44+
#R_LIBS_USER=${R_LIBS_USER-'~/Library/R/3.5/library'}
45+
46+
### Local Variables: ***
47+
### mode: sh ***
48+
### sh-indentation: 2 ***
49+
### End: ***
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
### Default etc/Renviron file provided with FastR configured for generic Linux
2+
###
3+
### ${R_HOME}/etc/Renviron
4+
###
5+
### Record R system environment variables.
6+
7+
R_PLATFORM=${R_PLATFORM-'x86_64-pc-linux-gnu'}
8+
## Default printer paper size: first record if user set R_PAPERSIZE
9+
R_PAPERSIZE_USER=${R_PAPERSIZE}
10+
R_PAPERSIZE=${R_PAPERSIZE-'a4'}
11+
## Default print command
12+
R_PRINTCMD=${R_PRINTCMD-'lpr'}
13+
# for Rd2pdf, reference manual
14+
R_RD4PDF=${R_RD4PDF-'times,inconsolata,hyper'}
15+
## used for options("texi2dvi")
16+
R_TEXI2DVICMD=${R_TEXI2DVICMD-${TEXI2DVI-'texi2dvi'}}
17+
## used by INSTALL, untar() and installing grDevices
18+
R_GZIPCMD=${R_GZIPCMD-'/bin/gzip'}
19+
## Default zip/unzip commands
20+
R_UNZIPCMD=${R_UNZIPCMD-'/usr/bin/unzip'}
21+
R_ZIPCMD=${R_ZIPCMD-'/usr/bin/zip'}
22+
R_BZIPCMD=${R_BZIPCMD-'/bin/bzip2'}
23+
## Default browser
24+
R_BROWSER=${R_BROWSER-'/usr/bin/firefox'}
25+
## Default editor
26+
EDITOR=${EDITOR-${VISUAL-vi}}
27+
## Default pager
28+
PAGER=${PAGER-'/usr/bin/less'}
29+
## Default PDF viewer
30+
R_PDFVIEWER=${R_PDFVIEWER-'/usr/bin/xdg-open'}
31+
## Used by libtool
32+
LN_S='ln -s'
33+
MAKE=${MAKE-'make'}
34+
## Prefer a POSIX-compliant sed on e.g. Solaris
35+
SED=${SED-'/bin/sed'}
36+
## Prefer a tar that can automagically read compressed archives
37+
## Used in R CMD INSTALL for binary packages
38+
TAR=${TAR-'/bin/tar'}
39+
40+
## System and compiler types.
41+
R_SYSTEM_ABI='linux,gcc,gxx,gfortran,?'
42+
43+
R_LIBS_USER=${R_LIBS_USER-'~/R/x86_64-pc-linux-gnu-library/3.5'}
44+
45+
### Local Variables: ***
46+
### mode: sh ***
47+
### sh-indentation: 2 ***
48+
### End: ***

com.oracle.truffle.r.native/run/Makefile

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ BIN_FILES := $(wildcard $(GNUR_HOME_BINARY)/bin/*)
4848

4949
DOC_FILES := $(wildcard $(GNUR_HOME_BINARY)/doc/*)
5050

51-
# Not all of these work unchanged
52-
ETC_FILES := $(addprefix $(GNUR_HOME_BINARY)/etc/,javaconf ldpaths Renviron repositories)
53-
5451
SHARE_FILES := $(addprefix $(GNUR_HOME_BINARY)/share/,R Rd make java encodings)
5552

5653
LLVM_TOOLS := $(wildcard $(FASTR_NATIVE_DIR)/llvm_tools/llvm-*)
@@ -64,13 +61,13 @@ rundirs:
6461
mkdir -p $(FASTR_BIN_DIR)/execRextras
6562
mkdir -p $(FASTR_ETC_DIR)
6663
mkdir -p $(FASTR_SHARE_DIR)
67-
64+
6865
rcmds: $(FASTR_BIN_DIR)/R
6966

7067
$(FASTR_BIN_DIR)/R: Makefile R.sh Rscript.sh Rscript_exec.sh Rclasspath.sh
7168
cp -r $(BIN_FILES) $(FASTR_BIN_DIR)
72-
73-
# overide bin/R
69+
70+
# overide bin/R
7471
cp R.sh $(FASTR_BIN_DIR)/exec/R
7572
# override bin/Rscript
7673
cp Rscript_exec.sh $(FASTR_BIN_DIR)/execRextras/Rscript
@@ -82,18 +79,22 @@ $(FASTR_BIN_DIR)/R: Makefile R.sh Rscript.sh Rscript_exec.sh Rclasspath.sh
8279
(sed -e 's!^\(R_HOME_DIR=\)\(.*\)!\1"$(FASTR_R_HOME)"!' | \
8380
sed -e 's/ -h.--help./ --r-help\)/' | \
8481
sed -e 's! exec sh "$${R_HOME}/bin/Rcmd" "$${@}" ;;! FASTR_INTERNAL_ARGS=`echo "$${FASTR_INTERNAL_ARGS} $${args}" | $${SED} -e 's/^[[:space:]]*//' | $${SED} -e 's/[[:blank:]]*$$//'` exec sh "$${R_HOME}/bin/Rcmd" "$${@}" ;;!') < $(R_SCRIPT) > $(FASTR_BIN_DIR)/R
85-
chmod +x $(FASTR_BIN_DIR)/R
82+
chmod +x $(FASTR_BIN_DIR)/R
8683
touch $(FASTR_ETC_DIR)/ldpaths
87-
sed -e "s|\(R_LIBS_USER=.*-'\)\(.*\)'}|\1$(FASTR_R_HOME)/library'}|" < $(GNUR_HOME_BINARY)/etc/Renviron > $(FASTR_ETC_DIR)/Renviron
84+
sed -e "s|\(R_LIBS_USER=.*-'\)\(.*\)'}|\1$(FASTR_R_HOME)/library'}|" < $(shell uname)/Renviron > $(FASTR_ETC_DIR)/Renviron
85+
mkdir -p $(FASTR_ETC_DIR)/src/include
86+
cp config.h.in $(FASTR_ETC_DIR)/src/include
87+
cp $(GNUR_HOME_BINARY)/etc/Renviron.in $(FASTR_ETC_DIR)/Renviron.in
88+
cp $(GNUR_HOME_BINARY)/etc/ldpaths.in $(FASTR_ETC_DIR)/ldpaths.in
8889
cp $(GNUR_HOME_BINARY)/etc/Makeconf Makeconf.etc
8990
cp $(GNUR_HOME_BINARY)/etc/javaconf $(FASTR_ETC_DIR)/javaconf
9091
cp $(GNUR_HOME_BINARY)/etc/repositories $(FASTR_ETC_DIR)/repositories
9192
cp $(GNUR_HOME_BINARY)/etc/ldpaths $(FASTR_ETC_DIR)/ldpaths
9293
# the ed script adds -DFASTR to compiler options and removes JAVA related variables
9394
ed Makeconf.etc < edMakeconf.etc
94-
95+
9596
echo $(DEFAULT_CRAN_MIRROR) > $(FASTR_ETC_DIR)/DEFAULT_CRAN_MIRROR
96-
97+
9798
ifeq ($(FASTR_RFFI),llvm)
9899
ed Makeconf.etc < edMakeconf.etc.llvm
99100
cp $(LLVM_TOOLS) $(FASTR_BIN_DIR)
@@ -102,7 +103,7 @@ endif
102103

103104
## deploy helper script that can build native-image of FastR and update the launchers in GraalVM
104105
cp install_r_native_image $(FASTR_BIN_DIR)
105-
## prepare the configuration artefacts for the manual FastR configuration in GraalVM
106+
## prepare the configuration artefacts for the manual FastR configuration in GraalVM
106107
cp configure_fastr $(FASTR_BIN_DIR)
107108
chmod +x $(FASTR_BIN_DIR)/configure_fastr
108109
cp configure.ac $(FASTR_ETC_DIR)

0 commit comments

Comments
 (0)