editor_options | ||||
---|---|---|---|---|
|
https://github.com/r-devel/rcwg/blob/main/working_documents/install_r_macos.md
I worked through Heather's notes during the RProject Sprint, on Sept 1st 2023, with assistance from George Stagg.
-
In Install Prerequisites section, point 7, it appears we do still need to install subversion, but
install.libs("subversion", dep = FALSE)
didn't work for me (at least then runningwhich svn
in the terminal didn't find it). So I installed it via brew instead:brew install svn
which appears to have worked fine.HT: I also had Subversion installed from Homebrew. I tried uninstalling it (
brew uninstall subversion
) and installing withinstall.libs
and it worked fine (runningwhich svn
returned/opt/R/arm64/bin/svn
as expected). So possible a local issue, will add installation via Homebrew as a troubleshooting workaround. -
In Build R section, George reckons that the build directory looks strange. He would have
export TOP_SRCDIR="$HOME/R-devel/svn" svn checkout https://svn.r-project.org/R/trunk/ "$TOP_SRCDIR"
and
export BUILDDIR="$HOME/R-devel/build" mkdir -p "$BUILDDIR" cd "$BUILDDIR"
This way, build directory and source are both within the
R-devel
folderbuild
rather thanbin/R
since building R will createbin/R
HT: Agree the current directories are not ideal - they were to match what we currently have in the dev guide for Linux: https://contributor.r-project.org/rdevguide/GetStart.html#linux. But we had a similar discussion when working on the R Dev Container and came up with
/workspaces/r-dev-env/build
/workspaces/r-dev-env/svn
with the idea that if you had multiple builds of R you could have them nested under those directories. Will poll R Contributors to help decide what is best.(gone with second option for now)
-
In Build R, point 3 for Apple Silicon only, in line before
EOF
, need to add CPPFLAGS to link to the headers for liblzma:CPPFLAGS="-isystem $LOCAL/include -I/opt/R/arm64/include"
(This will take precedence over the CPPFLAGS in previous chunk, which is what we want)
HT: Fine, added.
-
Why RSwitch and not
rig
?HT: simplest tool for this purpose - enables switching while people can carry on installing R as they have done before. But not needed if people are already using rig, so have added some comments about this.
-
Getting stuck with gfortran. It's installed in
/opt/gfortran/bin/gfortran
and the configure flag is set toFC="/opt/gfortran/bin/gfortran -mtune=native"
butmake
seems to be looking for/opt/R/arm64/gfortran/bin/gfortran
Issues with
gfortran
Getting error when runningmake
related to gfortran and nlme:/opt/R/arm64/gfortran/bin/gfortran: No such file or directory
Not sure why
nlme
is looking for gfortran there, rather than/opt/gfortran/bin/gfortran
. Have tried adding this to PATH withexport PATH="/opt/gfortran/bin:$PATH"
and then removing theFC
flag fromconfig.site
(it's not needed once gfortran is in the PATH).Try a symlink:
mkdir -p /opt/R/arm64/gfortran/bin ln -s /opt/gfortran/bin/gfortran /opt/R/arm64/gfortran/bin/gfortran
This works but it's hacky. To undo this,
rm /opt/R/arm64/gfortran/bin/gfortran
An alternative for gfortran, since the problem is when
nlme
is to not do step 1 of Build R, i.e. do not download recommended packages, then will also need additional config flag (need to check this)--without-recommended-packages
HT: Fixed by updating LDFLAGS. Not sure if this applies to Intel too.
-
Need to install java or turn it off!
"$TOP_SRCDIR/configure" --enable-R-framework --disable-java
I've gone with turning it off, but would probably be better to install!
HT:
--disable-java
just disables the check for Java, we could add this option but it's not essential (keep instructions as simple as possible). I'm not sure if we need Java to work with base R and recommended packages only. If we do, need to add instructions based on https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Java-_0028macOS_0029 (Java cannot be installed withinstall.lib
.) But instructions easier to maintain if we can manage without.
After make check
, if still in build
directory, need to run bin/R
to start newly build
HT: Fixed by adding
make install
step.