Skip to content

Commit

Permalink
R-3.6.1 build: fix interoperation w. rstudio
Browse files Browse the repository at this point in the history
Rstudio sets an own environment for its bin/rsession.
Unfortunately it sets the LD_LIBRARY_PATH only for
'the detected R binary-rootdir'/lib/R/lib.

Since the geospatial goodies required by 'sf' are installed
under pkg/Rxyz/lib the rpath set in the sf module isn't
sufficient.

The patchelf addition fixes this. In the next build it could
also be done with compile time flags.

Doing it this way keeps the option to run rstudio with
other R versions (e.g. source /pkg/R-3.5/profile; rstudio).
  • Loading branch information
thomas committed Oct 9, 2019
1 parent 3a5d541 commit d698352
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions R-3.6.1-0.build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,14 @@ cat <<- RCODEXXX | Rscript -
}
RCODEXXX

# rstudios rsession does a lot of magic to detect the true R binary, thus bypassing
# our friendly 'hints' from the wrapper.
# tell lib/R/library/sf/libs/sf.so about lib -- yes it's the beloved sf package again!
# the original rpath is only set to /pkg/R-3.6.1-0/lib/R/lib, add /pkg/R-3.6.1-0/lib.

patchelf --set-rpath $PREFIX/lib/R/lib:$PREFIX/lib \
$PREFIX/lib/R/library/sf/libs/sf.so

exit

# NOTES:
Expand Down

0 comments on commit d698352

Please sign in to comment.