diff --git a/docs/get_started/setup.md b/docs/get_started/setup.md index b4ebaccc8a6a..70eebc33dc23 100644 --- a/docs/get_started/setup.md +++ b/docs/get_started/setup.md @@ -81,7 +81,7 @@ To contribute easy installation scripts for other operating systems and programm ### Quick Installation on Ubuntu -The simple installation scripts set up MXNet for Python on computers running Ubuntu 12 or later. The scripts install MXNet in your home folder ```~/mxnet```. +The simple installation scripts set up MXNet for Python and R on computers running Ubuntu 12 or later. The scripts install MXNet in your home folder ```~/mxnet```. To clone the MXNet source code repository to your computer, use ```git```. ```bash @@ -97,19 +97,31 @@ It takes around 5 minutes to complete the installation. # Clone mxnet repository. In terminal, run the commands WITHOUT "sudo" git clone https://github.com/dmlc/mxnet.git ~/mxnet --recursive + # Install MXNet for Python with all required dependencies cd ~/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 the following command to refresh environment variables. $ source ~/.bashrc ``` -You can view the installation script [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). + +# Install MXNet for R with all required dependencies + +To install MXNet for R: + +```bash +cd ~/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). If you are unable to install MXNet with the Bash script, see the following detailed installation instructions. + ### Quick Installation on Amazon Linux The simple installation scripts set up MXNet for Python on computers running Amazon Linux. The scripts install MXNet in your home folder ```~/mxnet```. @@ -435,7 +447,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, use your MXNet version number: ```bash -R CMD INSTALL mxnet_0.5.tar.gz +R CMD INSTALL mxnet_0.7.tar.gz ``` ##### Installing MXNet on a Computer with a GPU Processor diff --git a/setup-utils/install-mxnet-amz-linux.sh b/setup-utils/install-mxnet-amz-linux.sh index 113772dd718f..df029a5d22c5 100644 --- a/setup-utils/install-mxnet-amz-linux.sh +++ b/setup-utils/install-mxnet-amz-linux.sh @@ -39,7 +39,8 @@ sudo make PREFIX=/usr/local install export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH # Install MXNet Core without CUDA -cd ~/mxnet +MXNET_HOME="~/mxnet/" +cd $MXNET_HOME cp make/config.mk . echo "USE_CUDA=0" >>config.mk echo "USE_CUDNN=0" >>config.mk @@ -53,7 +54,7 @@ cd python sudo python setup.py install # Add MXNet path to ~/.bashrc file -echo "export PYTHONPATH=~/mxnet/python:$PYTHONPATH" >> ~/.bashrc +echo "export PYTHONPATH=$MXNET_HOME/python:$PYTHONPATH" >> ~/.bashrc source ~/.bashrc echo "Done! MXNet for Python installation is complete. Go ahead and explore MXNet with Python :-)" \ No newline at end of file diff --git a/setup-utils/install-mxnet-ubuntu.sh b/setup-utils/install-mxnet-ubuntu-python.sh similarity index 76% rename from setup-utils/install-mxnet-ubuntu.sh rename to setup-utils/install-mxnet-ubuntu-python.sh index addb2e9a84ad..227e28750554 100644 --- a/setup-utils/install-mxnet-ubuntu.sh +++ b/setup-utils/install-mxnet-ubuntu-python.sh @@ -5,14 +5,16 @@ ###################################################################### set -e -echo "Installing build-essential, libatlas-base-dev, libopencv-dev..." +MXNET_HOME="~/mxnet/" +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 -echo "Installing MXNet core. This can take few minutes..." -cd ~/mxnet/ -sudo make -j$(nproc) +echo "Building MXNet core. This can take few minutes..." +cd $MXNET_HOME +make -j$(nproc) echo "Installing Numpy..." sudo apt-get install python-numpy @@ -24,7 +26,7 @@ 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/python:$PYTHONPATH" >> ~/.bashrc +echo "export PYTHONPATH=$MXNET_HOME/python:PYTHONPATH" >> ~/.bashrc source ~/.bashrc -echo "Done! MXNet for Python installation is complete. Go ahead and explore MXNet with Python :-)" \ No newline at end of file +echo "Done! MXNet for Python installation is complete. Go ahead and explore MXNet with Python :-)" diff --git a/setup-utils/install-mxnet-ubuntu-r.sh b/setup-utils/install-mxnet-ubuntu-r.sh new file mode 100644 index 000000000000..2f4e1a36383c --- /dev/null +++ b/setup-utils/install-mxnet-ubuntu-r.sh @@ -0,0 +1,31 @@ +#!/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="~/mxnet/" +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..." +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 :-)"