Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[R] Script installation for R #3803

Merged
merged 15 commits into from
Nov 23, 2016
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,4 @@ List of Contributors
* [Yuance Li](https://github.com/liyuance)
* [Sandeep Krishnamurthy] (https://github.com/sandeep-krishnamurthy)
* [Andre Moeller] (https://github.com/andremoeller)
* [Miguel Gonzalez-Fierro](https://github.com/miguelgfierro)
16 changes: 12 additions & 4 deletions docs/get_started/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ For users of Python on Amazon Linux and Ubuntu operating systems, MXNet provides

### Quick Installation on Ubuntu

We provide simple installation scripts for setting up MXNet for Python on Ubuntu 12+ machine. We will install MXNet in your home folder ```~/MXNet```.
We provide several installation scripts for setting up MXNet for Python and R on Ubuntu 12+ machine. We will install MXNet in your home folder ```~/MXNet```.


 
Expand All @@ -93,14 +93,22 @@ git clone https://github.com/dmlc/mxnet.git ~/MXNet/mxnet --recursive

# Install MXNet dependencies
cd ~/MXNet/mxnet/setup-utils
bash install-mxnet-ubuntu.sh
bash install-mxnet-ubuntu-python.sh

# We have added MXNet Python package path in your ~/.bashrc.
# Run below command to refresh environment variables.
$ source ~/.bashrc
```

You can view the installation script we just used to install MXNet for Python [here](https://raw.githubusercontent.com/dmlc/mxnet/master/setup-utils/install-mxnet-ubuntu.sh).
You can view the installation script we just used to install MXNet for Python [here](https://raw.githubusercontent.com/dmlc/mxnet/master/setup-utils/install-mxnet-ubuntu-python.sh).

To install MXNet for R:

```bash
cd ~/MXNet/mxnet/setup-utils
bash install-mxnet-ubuntu-r.sh
```
The installation script to install MXNet for R can be found [here](https://raw.githubusercontent.com/dmlc/mxnet/master/setup-utils/install-mxnet-ubuntu-r.sh).

 

Expand Down Expand Up @@ -357,7 +365,7 @@ make rpkg
These commands create the MXNet R package as a tar.gz file that you can install as an R package. To install the R package, run the following command:

```bash
R CMD INSTALL mxnet_0.5.tar.gz
R CMD INSTALL mxnet_0.7.tar.gz
```

Note: Use your MXNet version number.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
######################################################################
set -e

echo "Installing build-essential, libatlas-base-dev, libopencv-dev..."
MXNET_HOME="$(dirname "$PWD")"
echo "MXNet root folder: $MXNET_HOME"

echo "Installing build-essential, libatlas-base-dev, libopencv-dev..."
sudo apt-get update
sudo apt-get install -y build-essential libatlas-base-dev libopencv-dev

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plz revert this

echo "Installing MXNet core. This can take few minutes..."
cd ~/MXNet/mxnet/
echo "Building MXNet core. This can take few minutes..."
cd $MXNET_HOME
make -j$(nproc)

echo "Installing Numpy..."
Expand All @@ -24,6 +26,6 @@ echo "Installing Python package for MXNet..."
cd python; sudo python setup.py install

echo "Adding MXNet path to your ~/.bashrc file"
echo "export PYTHONPATH=~/MXNet/mxnet/python" >> ~/.bashrc
echo "export PYTHONPATH=$MXNET_HOME/python:PYTHONPATH" >> ~/.bashrc

echo "Done! MXNet for Python installation is complete. Go ahead and explore MXNet with Python :-)"
29 changes: 29 additions & 0 deletions setup-utils/install-mxnet-ubuntu-r.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
######################################################################
# This script installs MXNet for R along with all required dependencies on a Ubuntu Machine.
# We recommend to install Microsoft RServer together with Intel MKL library for optimal performance
# More information can be found here:
# https://blogs.technet.microsoft.com/machinelearning/2016/09/15/building-deep-neural-networks-in-the-cloud-with-azure-gpu-vms-mxnet-and-microsoft-r-server/
# Tested on Ubuntu 14.0+ distro.
# This script assumes that R is already installed in the system
######################################################################
set -e

MXNET_HOME="$(dirname "$PWD")"
echo "MXNet root folder: $MXNET_HOME"

echo "Building MXNet core. This can take few minutes..."
cd $MXNET_HOME
make -j$(nproc)

echo "Installing R dependencies. This can take few minutes..."
sudo Rscript -e "install.packages('devtools', repo = 'https://cran.rstudio.com')"
sudo Rscript -e "install.packages(c('Rcpp', 'DiagrammeR', 'data.table', 'jsonlite', 'magrittr', 'stringr', 'roxygen2'), repos = 'https://cran.rstudio.com')"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest you change this line into these lines below. We use devtools, because it will install all dependencies automatically. There might be more dependencies in the future.

Rscript -e "install.packages('devtools', repo = 'https://cran.rstudio.com')"
cd R-package
Rscript -e "library(devtools); library(methods); options(repos=c(CRAN='https://cran.rstudio.com')); install_deps(dependencies = TRUE)"
cd ..


echo "Compiling R package. This can take few minutes..."
make rpkg

echo "Installing R package..."
sudo R CMD INSTALL mxnet_0.7.tar.gz

echo "Done! MXNet for R installation is complete. Go ahead and explore MXNet with R :-)"