With windows I ship cygwin tools for tar and gzip and associated DLLs so there is some similarity between extractions by the wrapper scripts. + +Under Linux using perl I drop R into current directory +and set these two things: + + $ENV{R_HOME} = "$Rlocation"; + $ENV{LD_LIBRARY_PATH} = "$Rlocation/lib"; + +If there is a library tar ball as mentioned above, the following +is done: + + # do we have prebuilt libraries? + my $renviron; + if(-f "RLIBS.tar.gz") { + system("tar -zxvf RLIBS.tar.gz"); + $ENV{HOME} = $location; + $renviron = "$location/.Renviron"; + open(RLIB,">$renviron") or die "Can not create <$renviron>:$!\n"; + print RLIB "R_LIBS_USER=$location/RR/library\n"; + close(RLIB); + } + +Once that is done, the following starts R: + + $cmdtorun = "$Rlocation/bin/Rscript --no-save ./$scripts $realarg"; + print "about to execute <<$cmdtorun>>\n"; + $res = system("$cmdtorun");