microsoft / microsoft-r-open

Microsoft R Open Source
212 stars 69 forks source link

Improved instructions for installation from source on Linux? (or alternately a non-root installation script) #55

Closed molecules closed 5 years ago

molecules commented 6 years ago

Since I am a non-root user, I can't use the provided installation scripts, I have been trying to install Microsoft-R-Open from source.

Are there more instructions for building Microsoft-R-Open from source that are more detailed than the following README.md file? It seems to help, but I'm still not sure what to do with the vendor directory and how I'm supposed to install the curl or the RODBC packages in the "additionalPackages" directory.

Microsoft R Open
================
This is the repository containing the source code for the open source components of Microsoft R Open.

Directory Structure


/additionalPackages -> GPLv2 licensed R packages not part of the R source
/patch -> Patches made to the R source code when building Microsoft R Open
/source -> CRAN R source code
/vendor -> Libraries needed to build Microsoft R Open

Building


Please see the R Installation and Administration Guide for instructions on building the R source. Patches can be applied using GNU Patch.

The additional Microsoft authored packages can be built and installed using R CMD INSTALL after the R source has been built.

I've tried to build it from source. Below are the details. I left out the "dead ends" and only include what seemed to work, except that I have also included the errors I am getting for "curl" and "RODBC":

wget https://mran.blob.core.windows.net/install/mro/3.4.3/microsoft-r-open-MRO-3.4.3.tar.gz
tar xvf microsoft-r-open-MRO-3.4.3.tar.gz
cd microsoft-r-open-MRO-3.4.3/
patch -p0 < patch/relocatable-r.patch
cd source/

./configure --without-recommended-packages  --enable-R-shlib
make

export PATH=/path/to/microsoft-r-open/microsoft-r-open-MRO-3.4.3/bin:$PATH

R
> install.packages('foreach')
>q()

cd ../additionalPackages
R CMD INSTALL RUnit
R CMD INSTALL R6
R CMD INSTALL doParallel
R CMD INSTALL checkpoint

cd deployr-rserve/

cd Rserve
chmod a+x configure
cd ..
R CMD INSTALL Rserve
cd ..
R CMD INSTALL png
R CMD INSTALL jsonlite
R CMD INSTALL RevoIOQ

R
> install.packages('rpart')
> q()

R CMD INSTALL RevoMods
R CMD INSTALL RevoUtils

R CMD INSTALL RODBC
* installing to library ‘/path/to/microsoft-r-open/microsoft-r-open-MRO-3.4.3/lib64/R/library’
* installing *source* package ‘RODBC’ ...
file ‘build/vignette.rds’ is missing
files ‘tests/DB2.Rout.save’, ‘tests/Oracle.Rout.save’, ‘tests/SQLServer.Rout.save’, ‘tests/access.Rout.save’, ‘tests/excel.Rout.save’, ‘tests/mimer.Rout.save’, ‘tests/mysql-win.Rout.save’ have the wrong MD5 checksums
ERROR: 'configure' exists but is not executable -- see the 'R Installation and Administration Manual'
* removing ‘/path/to/microsoft-r-open/microsoft-r-open-MRO-3.4.3/lib64/R/library/RODBC’

configure: error: "ODBC headers sql.h and sqlext.h not found"
ERROR: configuration failed for package ‘RODBC’

R 
>install.packages('curl')
>q()

R CMD INSTALL curl
Error in (function() { :
  Failed to find 'tools/option_table.txt' from:/path/to/microsoft-r-open/microsoft-r-open-MRO-3.4.3-src/additionalPackages/curl
Error : unable to load R code in package ‘curl’
ERROR: lazy loading failed for package ‘curl’
* removing ‘/path/to/microsoft-r-open/microsoft-r-open-MRO-3.4.3/lib64/R/library/curl’
* restoring previous ‘/path/to/microsoft-r-open/microsoft-r-open-MRO-3.4.3/lib64/R/library/curl’
molecules commented 6 years ago

By the way, I really do appreciate all of the work you put into microsoft-r-open. I forgot to mention that when I opened this issue. Thanks!

StevenCHowell commented 6 years ago

@molecules As a workaround, or holdover, you can easily install MRO using Anaconda (if you also want a base Python installation) or miniconda (if you want to install what you need as you go). Neither of these require admin privileges. After getting either installed, you would want to install the r-essentials package using the command

$conda install r-essentials

The biggest downside to this is you will get R version 3.4.3 which means checkpoint will use 2017-09-01 as the snapshotDate. I tried setting the checkpoint to a more recent date without success. I had to directly download some packages from CRAN by specifying the mirror.

> install.packages('skpr', repos='https://cran.case.edu')