Skip to content

Commit a109064

Browse files
committed
[GR-21666] [GR-22271] GCC libraries added for Darwin, use gfotran even in the Labs LLVM Toolchain Makeconf version, update the CHANGELOG.
PullRequest: fastr/2409
2 parents 122f8c4 + d624be0 commit a109064

File tree

12 files changed

+110
-203
lines changed

12 files changed

+110
-203
lines changed

CHANGELOG.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,33 @@
22

33
New features:
44

5-
* `graphics` and `grDevices` packages are now enabled by incorporating the `JavaGD` package. Supported image formats: PDF, PNG, JPEG, BMP. Use `--R.UseInternalGridGraphics=false` to activate this feature.
6-
* SVG support will be added in the future
7-
* Display lists are fully implemented, which, e.g., makes Shiny work better in FastR
8-
* Java API for implementing custom graphics devices based on `JavaGD`
9-
* print stacktraces (aka traceback()) for errors coming from c-code when FastR running in llvm mode
5+
* Preview of improved graphical support.
6+
* Use `--R.UseInternalGridGraphics=false` to activate this feature.
7+
* `graphics` and `grDevices` packages are implemented by incorporating the `JavaGD` package.
8+
* The standard `grid` package works out of the box as well as `lattice` and `ggplot2`.
9+
* Supported image formats: PDF, PNG, JPEG, BMP.
10+
* SVG support will be added in the future.
11+
* Display lists are fully implemented, which, e.g., makes Shiny work better in FastR.
12+
* Custom FastR `grid` package implementation, which is currently the default, will be deprecated and removed in future releases.
13+
* FastR ships with GCC runtime libraries on all supported systems (Linux and MacOS).
14+
* GFortran is not a requirement anymore to run FastR, but it is still required to install R packages with Fortran code
15+
* The GFortran runtime libraries versions are 4.8.5 on Linux and 8.3.0 on MacOS. When compiling additional R packages with Fortran code, one must use GFortran of the same or higher version.
16+
* GFortran is used as the default Fortran compiler even in the "LLVM" toolchain configuration.
17+
* R packages that contain Fortran code will not be runnable on
18+
the FastR's LLVM backend (`--R.BackEnd=llvm`). However, the default backend is
19+
the "native" (`--R.BackEnd=native`). One can also choose to run only specific packages
20+
via the LLVM backend (`--R.BackEndLLVM=mypackage`).
21+
* Users can switch back to F2C, which can produce libraries runnable on the LLVM backend,
22+
by editing variable `FC` in `{FASTR_HOME}/etc/Makeconf`.
23+
* print stacktraces (in `traceback()`) for errors coming from C/C++ code when FastR is running in the LLVM mode (`--R.BackEnd=llvm`) and errors coming from other languages, e.g., GraalPython.
24+
* `@` can be also used to access members of polyglot values originating from other languages. This was previously possible only with `$`, now both operators work.
1025

1126
Bug fixes:
1227

1328
* `dyn.load` did not work with relative paths
1429
* missing warnings on integer overflow #136
1530
* the f2c script fixed to handle extra dotted file extensions #143
31+
* `iconv` honors the `from` and `asRaw` parameters. Fixes, e.g.: `iconv('foo²²', 'UTF8', 'latin1')`
1632

1733
# 20.0.0
1834

ci.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ overlay : '0a85b559a8872d5255507d626ff8c8b8d32fa497' }
1+
{ overlay : 'f9c4d02eceb7505244a0e1869290ac70bf88e8f6' }

com.oracle.truffle.r.native/gnur/Makefile.libs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ ifdef FASTR_RELEASE
4848
ifeq ($(OSNAME), Linux)
4949
FASTR_CAPTURE_DEPENDENCIES ?= pcre z gfortran quadmath gcc_s
5050
else ifeq ($(OSNAME), Darwin)
51-
FASTR_CAPTURE_DEPENDENCIES ?= pcre z
51+
FASTR_CAPTURE_DEPENDENCIES ?= pcre z gfortran quadmath gcc_s
5252
else
5353
$(error OS $(OSNAME) is not supported)
5454
endif
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
H
22
,s/CC[[:space:]]=\(.*\)/CC = $(LABS_LLVM_CC)/g
3-
,s/FC[[:space:]]=\(.*\)/FC = $(FASTR_NATIVE_DIR)\/run\/fastr_tools\/f2c-wrapper\1/g
3+
,s/FC[[:space:]]=\(.*\)/FC = $(FASTR_NATIVE_DIR)\/run\/fastr_tools\/f2c-wrapper $(FASTR_NATIVE_DIR)\/run\/fastr_tools\/safe-forward-gfortran/g
44
w
55
q

com.oracle.truffle.r.native/run/fastr_etc/Darwin/Makeconf.llvm

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2019, 2019, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -78,12 +78,25 @@ ECHO_N =
7878
ECHO_T =
7979
F_VISIBILITY =
8080
## FC is the compiler used for all Fortran as from R 3.6.0
81-
## FastR Note: the tool 'f2c-wrapper' tries to use f2c (bundled with FastR) and
82-
## if it fails it delegates to the fortran compiler given as the argument.
83-
## If gfortran is installed in a non-standard location on your system,
84-
## replace the second path pointing to "safe-forward-gfortran" with the correct
85-
## path to the gfortran executable on your system.
86-
FC = "$(R_HOME)/bin/f2c-wrapper" "$(R_HOME)/bin/safe-forward-gfortran"
81+
##
82+
## If gfortran is installed in a non-standard location, which is not on $PATH,
83+
## replace the "$(R_HOME)/bin/safe-forward-gfortran" with the path to gfortran
84+
## on your system.
85+
##
86+
## FastR uses gfortran even for the LLVM toolchain compilation, which implies
87+
## that R packages that contain Fortran code will not be runnable on the
88+
## FastR's LLVM backend (--R.BackEnd=llvm). However, the default backend is
89+
## the "native" (--R.BackEnd=native) and one can choose to run only specific
90+
## packages via the LLVM backend (--R.BackEndLLVM=mypackage).
91+
##
92+
## FastR also provides tool 'f2c-wrapper' (disabled by default), which tries to
93+
## use f2c (bundled with FastR) and if it fails it delegates to the Fortran compiler
94+
## given as the first argument to 'f2c-wrapper'. If the F2C compilation succeeds
95+
## for all Fortran files in an R package, then the resulting library will contain
96+
## LLVM bitcode and will be runnable via FastR's LLVM backend.
97+
FC = "$(R_HOME)/bin/safe-forward-gfortran"
98+
## To use f2c uncomment the following line
99+
# FC = "$(R_HOME)/bin/f2c-wrapper" "$(FC)"
87100
FCFLAGS = -O2 $(LTO)
88101
## additional libs needed when linking with $(FC), e.g. on some Oracle compilers
89102
FCLIBS_XTRA =

com.oracle.truffle.r.native/run/fastr_etc/Darwin/Makeconf.native

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2019, 2019, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -78,7 +78,10 @@ ECHO_N =
7878
ECHO_T =
7979
F_VISIBILITY =
8080
## FC is the compiler used for all Fortran as from R 3.6.0
81-
## FastR Note: the wrapper tries to use f2c, if it fails it uses the tool given as the first argument
81+
##
82+
## If gfortran is installed in a non-standard location, which is not on $PATH,
83+
## replace the "$(R_HOME)/bin/safe-forward-gfortran" with the path to gfortran
84+
## on your system.
8285
FC = "$(R_HOME)/bin/safe-forward-gfortran"
8386
FCFLAGS = -O2 $(LTO)
8487
## additional libs needed when linking with $(FC), e.g. on some Oracle compilers

com.oracle.truffle.r.native/run/fastr_etc/Linux/Makeconf.llvm

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2019, 2019, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -78,12 +78,25 @@ ECHO_N = -n
7878
ECHO_T =
7979
F_VISIBILITY = -fvisibility=hidden
8080
## FC is the compiler used for all Fortran as from R 3.6.0
81-
## FastR Note: the tool 'f2c-wrapper' tries to use f2c (bundled with FastR) and
82-
## if it fails it delegates to the fortran compiler given as the argument.
83-
## If gfortran is installed in a non-standard location on your system,
84-
## replace the second path pointing to "safe-forward-gfortran" with the correct
85-
## path to the gfortran executable on your system.
86-
FC = "$(R_HOME)/bin/f2c-wrapper" "$(R_HOME)/bin/safe-forward-gfortran"
81+
##
82+
## If gfortran is installed in a non-standard location, which is not on $PATH,
83+
## replace the "$(R_HOME)/bin/safe-forward-gfortran" with the path to gfortran
84+
## on your system.
85+
##
86+
## FastR uses gfortran even for the LLVM toolchain compilation, which implies
87+
## that R packages that contain Fortran code will not be runnable on the
88+
## FastR's LLVM backend (--R.BackEnd=llvm). However, the default backend is
89+
## the "native" (--R.BackEnd=native) and one can choose to run only specific
90+
## packages via the LLVM backend (--R.BackEndLLVM=mypackage).
91+
##
92+
## FastR also provides tool 'f2c-wrapper' (disabled by default), which tries to
93+
## use f2c (bundled with FastR) and if it fails it delegates to the Fortran compiler
94+
## given as the first argument to 'f2c-wrapper'. If the F2C compilation succeeds
95+
## for all Fortran files in an R package, then the resulting library will contain
96+
## LLVM bitcode and will be runnable via FastR's LLVM backend.
97+
FC = "$(R_HOME)/bin/safe-forward-gfortran"
98+
## To use f2c uncomment the following line
99+
# FC = "$(R_HOME)/bin/f2c-wrapper" "$(FC)"
87100
FCFLAGS = -O2 $(LTO)
88101
## additional libs needed when linking with $(FC), e.g. on some Oracle compilers
89102
FCLIBS_XTRA =

com.oracle.truffle.r.native/run/fastr_etc/Linux/Makeconf.native

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2019, 2019, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -78,7 +78,10 @@ ECHO_N = -n
7878
ECHO_T =
7979
F_VISIBILITY = -fvisibility=hidden
8080
## FC is the compiler used for all Fortran as from R 3.6.0
81-
## FastR Note: the wrapper tries to use f2c, if it fails it uses the tool given as the first argument
81+
##
82+
## If gfortran is installed in a non-standard location, which is not on $PATH,
83+
## replace the "$(R_HOME)/bin/safe-forward-gfortran" with the path to gfortran
84+
## on your system.
8285
FC = "$(R_HOME)/bin/safe-forward-gfortran"
8386
FCFLAGS = -O2 $(LTO)
8487
## additional libs needed when linking with $(FC), e.g. on some Oracle compilers

com.oracle.truffle.r.native/run/fastr_tools/configure_fastr

Lines changed: 25 additions & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -35,39 +35,20 @@ while [ -h "$source" ] ; do
3535
source="$dir/$source"
3636
fi
3737
done
38+
r_bin="$( cd -P "$( dirname "$source" )" && pwd )"
39+
FASTR_HOME_DIR="$( dirname "$r_bin" )"
3840

3941
function printHelp {
40-
if [[ "$OSTYPE" == "darwin"* ]]; then
41-
echo "Checks presence of FastR dependencies and configures the paths in dynamic libraries accordingly."
42-
echo "usage: configure_fastr [--help] [--macos-no-homebrew] [--gcc-lib-path <path>]"
43-
else
44-
echo "Checks presence of FastR dependencies."
45-
echo "usage: configure_fastr [--help]"
46-
fi
47-
48-
if [[ "$OSTYPE" == "darwin"* ]]; then
49-
echo ""
50-
echo "optional arguments:"
51-
echo " --gcc-lib-path <path> Use the <path> to locate the required gfortran libraries."
52-
echo " --macos-no-homebrew Allows the script to proceed even if the target system does not have homebrew"
53-
fi
42+
echo "Checks FastR requirements and creates personal library directory (R_LIBS_USER)."
43+
echo "usage: configure_fastr [--help]"
5444
}
5545

56-
GCC_LIB_PATH=""
57-
NO_BREW=0
5846
while [[ $# -gt 0 ]]; do
5947
case $1 in
6048
--help)
6149
printHelp
6250
exit 0
6351
;;
64-
--gcc-lib-path)
65-
shift
66-
GCC_LIB_PATH=$1
67-
;;
68-
--macos-no-homebrew)
69-
NO_BREW=1
70-
;;
7152
*)
7253
>&2 echo "Unknown option '$1'"
7354
printHelp
@@ -94,160 +75,42 @@ done
9475
fi
9576
if [[ $res != 0 ]]; then
9677
echo "The basic configuration of FastR failed."
97-
echo "To learn more:"
98-
echo " run this script with '--help'"
99-
echo " visit https://www.graalvm.org/docs/reference-manual/languages/r"
78+
echo "To learn more visit https://www.graalvm.org/docs/reference-manual/languages/r"
10079
exit 1
10180
else
10281
echo "The basic configuration of FastR was successfull."
10382
echo ""
10483
echo "Note: if you intend to install R packages you may need additional dependencies."
105-
echo "The following packages should cover the most commonly used R packages:"
84+
echo "The following packages should cover depenedencies of the most commonly used R packages:"
10685
echo " On Debian based systems: apt-get install build-essential gfortran libxml2 libc++-dev"
10786
echo " On Oracle Linux: yum groupinstall 'Development Tools' && yum install gcc-gfortran"
10887
fi
10988
elif [[ "$OSTYPE" == "darwin"* ]]; then
110-
111-
if which brew; then
112-
GCC_DARWIN_HOME=/usr/local/Cellar/[email protected]/4.9.4_1/lib/gcc/4.9
113-
114-
if [ -d "$GCC_DARWIN_HOME" ] ; then
115-
echo "gcc 4.9 installation found."
116-
117-
cd -P "$( dirname "$source" )/../lib"
118-
# correct paths on Mac OSX
119-
GFORTRAN_LIBRARIES="libgfortran.3.dylib libquadmath.0.dylib libgomp.1.dylib libgcc_s.1.dylib"
120-
TARGET_LIBRARIES="`find ../library/* | grep "\(\.dylib\|\.so\)$"` `find * | grep "\(\.dylib\|\.so\)$"`"
121-
for GFORTRAN_LIB in $GFORTRAN_LIBRARIES
122-
do
123-
LIB_LOCATION="${GCC_DARWIN_HOME}/${GFORTRAN_LIB}"
124-
for TARGET_LIB in $TARGET_LIBRARIES
125-
do
126-
# don't look at symlinks
127-
if [ ! -L "${TARGET_LIB}" ] ; then
128-
# grep for the current path of this gfortran library in this library's linking info
129-
CURRENT_LIB_NAME=`otool -L ${TARGET_LIB} | grep -o "\t.*${GFORTRAN_LIB}"`
130-
if [ ! -z "$CURRENT_LIB_NAME" ] ; then
131-
if [ "$CURRENT_LIB_NAME" != "$LIB_LOCATION" ] ; then
132-
# change to the new location
133-
echo "changing path to ${GFORTRAN_LIB} in ${TARGET_LIB} to $LIB_LOCATION"
134-
install_name_tool -change $CURRENT_LIB_NAME $LIB_LOCATION ${TARGET_LIB}
135-
fi
136-
fi
137-
fi
138-
done
139-
done
140-
else
141-
echo "No Homebrew gcc 4.9 installation found."
142-
echo "Please ensure that you have gcc installed on your system using the homebrew command:"
143-
echo " brew install [email protected]"
144-
145-
HOMEBREW_PREFIX_OUT=`brew config | grep HOMEBREW_PREFIX`
146-
HOMEBREW_PREFIX=${HOMEBREW_PREFIX_OUT##*: }
147-
if [[ "$HOMEBREW_PREFIX" != "/usr/local" ]]; then
148-
echo "Your Homebrew uses other than the default installation directory prefix (i.e. /usr/local)."\
149-
"Since FastR assumes the default prefix, use the following command to create a symbolic link to your Homebrew installations:"
150-
echo " sudo ln -s $HOMEBREW_PREFIX/Cellar /usr/local/Cellar"
151-
fi
152-
153-
exit 1
154-
fi
155-
else # not "which brew"
156-
if [ $NO_BREW = 0 ]; then
157-
echo "FastR depends on GFortran 3 runtime libraries."
158-
echo "It appears that this system does not use the homebrew package manager."
159-
echo "We suggest to use homebrew and install the necessary dependencies with:"
160-
echo " brew install [email protected]"
161-
echo "If you want to use another installation of GFortran 3 libraries, re-run this script with '--macos-no-homebrew'."
162-
exit 2
163-
fi
164-
165-
cd -P "$( dirname "$source" )/../lib"
166-
# correct paths on Mac OSX
167-
GFORTRAN_LIBRARIES="libgfortran.3.dylib libquadmath.0.dylib libgomp.1.dylib libgcc_s.1.dylib"
168-
# This allows determining if all libraries were found after the main loop
169-
GFORTRAN_LIBRARIES_CHECK="libgfortran libquadmath libgomp libgcc_s"
170-
GFORTRAN_LOCATIONS="$GCC_LIB_PATH /opt/local/lib /opt/local/lib/libgcc /usr/local/gfortran/lib"
171-
TARGET_LIBRARIES="`find ../library/* | grep "\(\.dylib\|\.so\)$"` `find * | grep "\(\.dylib\|\.so\)$"`"
172-
FOUND=""
173-
FOUND_FULL=""
174-
LAST_FOUND=""
175-
for GFORTRAN_LIB in $GFORTRAN_LIBRARIES
176-
do
177-
# Remove the 'dylib' extension
178-
GFORTRAN_LIB_BASE=${GFORTRAN_LIB%.*}
179-
# Remove the number extension
180-
GFORTRAN_LIB_BASE=${GFORTRAN_LIB_BASE%.*}
181-
if [ "$LAST_FOUND" = "$GFORTRAN_LIB_BASE" ] ; then
182-
# A previous version of the current library has already been found
183-
echo "skipping $GFORTRAN_LIB"
184-
continue;
185-
fi
186-
for LOCATION in $GFORTRAN_LOCATIONS
187-
do
188-
if test -f "${LOCATION}/${GFORTRAN_LIB}"; then
189-
LIB_LOCATION="${LOCATION}/${GFORTRAN_LIB}"
190-
FOUND="$FOUND $GFORTRAN_LIB_BASE"
191-
LAST_FOUND=$GFORTRAN_LIB_BASE
192-
echo "${GFORTRAN_LIB} found at ${LIB_LOCATION}"
193-
for TARGET_LIB in $TARGET_LIBRARIES
194-
do
195-
# don't look at symlinks
196-
if [ ! -L "${TARGET_LIB}" ] ; then
197-
# grep for the current path of this gfortran library in this library's linking info
198-
CURRENT_LIB_NAME=`otool -L ${TARGET_LIB} | grep -o "\t.*${GFORTRAN_LIB_BASE}[^ ]*"`
199-
if [ ! -z "$CURRENT_LIB_NAME" ] ; then
200-
if [ "$CURRENT_LIB_NAME" != "$LIB_LOCATION" ] ; then
201-
# change to the new location
202-
echo "changing path to ${GFORTRAN_LIB} in ${TARGET_LIB} to $LIB_LOCATION"
203-
FOUND_FULL="${FOUND_FULL}\n ${LIB_LOCATION}"
204-
install_name_tool -change $CURRENT_LIB_NAME $LIB_LOCATION ${TARGET_LIB}
205-
fi
206-
fi
207-
fi
208-
done
209-
break
210-
fi
211-
done
212-
done
213-
214-
if [ "$FOUND" != " $GFORTRAN_LIBRARIES_CHECK" ] ; then
215-
echo "From expected libraries '$GFORTRAN_LIBRARIES_CHECK' found only '$FOUND'."
216-
echo "Please ensure that you have GFortran 3 installed on your system."
217-
echo "We suggest to use homebrew and install the necessary dependencies with:"
218-
echo " brew install [email protected]"
219-
echo "If the GFortran 3 runtime libraries are installed in a non-standard location, you can specify that location using the '--gcc-lib-path' parameter."
220-
exit 1
221-
else
222-
echo "Succesfully updated FastR installation to use the GFortran 3 system libraries."
223-
FASTR_HOME=$(cd ..; pwd -P )
224-
echo "The fortran compiler flags in $FASTR_HOME/etc/Makeconf (variable FLIBS) were not updated and must be adjusted manually!"
225-
fi
226-
fi # which brew
89+
echo "The basic configuration of FastR was successfull."
90+
echo ""
91+
echo "Note: if you intend to install R packages you may need additional dependencies."
92+
echo "The most common dependency is GFortran, which must be of version 8.3.0 or later."
93+
echo "See https://gcc.gnu.org/wiki/GFortranBinaries."
94+
echo "If the 'gfortran' binary is not on the system path, you need to configure the full path to it in $FASTR_HOME_DIR/etc/Makeconf (variable FC)"
22795
else
22896
echo "Unknown operating system."
22997
echo "FastR may still work."
230-
echo "Make sure that GCC including gfortran and OpenMP is installed on your system."
98+
echo "Make sure that OpenMP runtime library (libgomp.so.1) is installed on your system."
99+
echo "If you intend to install R packages you may need additional dependencies."
100+
echo "The most common dependency is GFortran."
231101
fi
232102

233-
if [[ $CONFIGURE_ETC = 1 ]]; then
234-
export GRAALVM_VERSION=`grep -o 'GRAALVM_VERSION=.*' "../../../../release" | cut -d= -f2`
235-
cd ../etc
236-
echo "Running the configure script..."
237-
./configure --with-x=no --with-aqua=no --enable-memory-profiling FFLAGS=-O2 $CONFIGURE_ARGS > configure.log 2>&1
238-
res=$?
239-
if [[ $res != 0 ]]; then
240-
echo "The configuration step failed."
241-
echo "The log was saved into ${PWD}/configure.log"
242-
echo "FastR may still work, but compilation of some R packages may fail"
243-
exit 1
244-
fi
245-
ed Makeconf < edMakeconf.etc > /dev/null 2>/dev/null
246103
export R_DEFAULT_PACKAGES=base
247-
R_LIBS_USER=`"../bin/R" --slave -e 'cat(path.expand(Sys.getenv("R_LIBS_USER")))'`
248-
echo "Creating user specific library directory: $R_LIBS_USER"
249-
mkdir -p "$R_LIBS_USER"
250-
echo "DONE"
104+
R_LIBS_USER=`"$FASTR_HOME_DIR/bin/R" --slave -e 'cat(path.expand(Sys.getenv("R_LIBS_USER")))'`
105+
if [ ! -d "$R_LIBS_USER" ]; then
106+
echo
107+
read -p "Default personal library directory ($R_LIBS_USER) does exist. Do you wish to create it? (Yy/Nn) " -n 1 -r
108+
echo
109+
if [[ $REPLY =~ ^[Yy]$ ]]; then
110+
echo "Creating personal library directory: $R_LIBS_USER"
111+
mkdir -p "$R_LIBS_USER"
112+
fi
251113
fi
252114

115+
echo "DONE"
253116
)

0 commit comments

Comments
 (0)