| <!DOCTYPE html> |
| |
| <html lang="en"> |
| <head> |
| <meta charset="utf-8"/> |
| <meta content="IE=edge" http-equiv="X-UA-Compatible"/> |
| <meta content="width=device-width, initial-scale=1" name="viewport"/> |
| <title>Installing MXNet on Ubuntu — mxnet documentation</title> |
| <link crossorigin="anonymous" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" rel="stylesheet"/> |
| <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet"/> |
| <link href="../_static/basic.css" rel="stylesheet" type="text/css"> |
| <link href="../_static/pygments.css" rel="stylesheet" type="text/css"> |
| <link href="../_static/mxnet.css" rel="stylesheet" type="text/css"/> |
| <script type="text/javascript"> |
| var DOCUMENTATION_OPTIONS = { |
| URL_ROOT: '../', |
| VERSION: '', |
| COLLAPSE_INDEX: false, |
| FILE_SUFFIX: '.html', |
| HAS_SOURCE: true, |
| SOURCELINK_SUFFIX: '' |
| }; |
| </script> |
| <script src="https://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script> |
| <script src="../_static/underscore.js" type="text/javascript"></script> |
| <script src="../_static/searchtools_custom.js" type="text/javascript"></script> |
| <script src="../_static/doctools.js" type="text/javascript"></script> |
| <script src="../_static/selectlang.js" type="text/javascript"></script> |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script> |
| <script type="text/javascript"> jQuery(function() { Search.loadIndex("/searchindex.js"); Search.init();}); </script> |
| <script> |
| (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ |
| (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new |
| Date();a=s.createElement(o), |
| m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
| })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); |
| |
| ga('create', 'UA-96378503-1', 'auto'); |
| ga('send', 'pageview'); |
| |
| </script> |
| <!-- --> |
| <!-- <script type="text/javascript" src="../_static/jquery.js"></script> --> |
| <!-- --> |
| <!-- <script type="text/javascript" src="../_static/underscore.js"></script> --> |
| <!-- --> |
| <!-- <script type="text/javascript" src="../_static/doctools.js"></script> --> |
| <!-- --> |
| <!-- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> --> |
| <!-- --> |
| <link href="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet-icon.png" rel="icon" type="image/png"/> |
| </link></link></head> |
| <body background="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet-background-compressed.jpeg" role="document"> |
| <div class="content-block"><div class="navbar navbar-fixed-top"> |
| <div class="container" id="navContainer"> |
| <div class="innder" id="header-inner"> |
| <h1 id="logo-wrap"> |
| <a href="../" id="logo"><img src="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet_logo.png"/></a> |
| </h1> |
| <nav class="nav-bar" id="main-nav"> |
| <a class="main-nav-link" href="../install/index.html">Install</a> |
| <a class="main-nav-link" href="../tutorials/index.html">Tutorials</a> |
| <span id="dropdown-menu-position-anchor"> |
| <a aria-expanded="true" aria-haspopup="true" class="main-nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button">Gluon <span class="caret"></span></a> |
| <ul class="dropdown-menu navbar-menu" id="package-dropdown-menu"> |
| <li><a class="main-nav-link" href="../gluon/index.html">About</a></li> |
| <li><a class="main-nav-link" href="http://gluon.mxnet.io">Tutorials</a></li> |
| </ul> |
| </span> |
| <span id="dropdown-menu-position-anchor"> |
| <a aria-expanded="true" aria-haspopup="true" class="main-nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button">API <span class="caret"></span></a> |
| <ul class="dropdown-menu navbar-menu" id="package-dropdown-menu"> |
| <li><a class="main-nav-link" href="../api/python/index.html">Python</a></li> |
| <li><a class="main-nav-link" href="../api/scala/index.html">Scala</a></li> |
| <li><a class="main-nav-link" href="../api/r/index.html">R</a></li> |
| <li><a class="main-nav-link" href="../api/julia/index.html">Julia</a></li> |
| <li><a class="main-nav-link" href="../api/c++/index.html">C++</a></li> |
| <li><a class="main-nav-link" href="../api/perl/index.html">Perl</a></li> |
| </ul> |
| </span> |
| <span id="dropdown-menu-position-anchor-docs"> |
| <a aria-expanded="true" aria-haspopup="true" class="main-nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button">Docs <span class="caret"></span></a> |
| <ul class="dropdown-menu navbar-menu" id="package-dropdown-menu-docs"> |
| <li><a class="main-nav-link" href="../faq/index.html">FAQ</a></li> |
| <li><a class="main-nav-link" href="../architecture/index.html">Architecture</a></li> |
| <li><a class="main-nav-link" href="https://github.com/apache/incubator-mxnet/tree/1.0.0/example">Examples</a></li> |
| <li><a class="main-nav-link" href="../model_zoo/index.html">Model Zoo</a></li> |
| </ul> |
| </span> |
| <a class="main-nav-link" href="https://github.com/dmlc/mxnet">Github</a> |
| <span id="dropdown-menu-position-anchor-community"> |
| <a aria-expanded="true" aria-haspopup="true" class="main-nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button">Community <span class="caret"></span></a> |
| <ul class="dropdown-menu navbar-menu" id="package-dropdown-menu-community"> |
| <li><a class="main-nav-link" href="../community/index.html">Community</a></li> |
| <li><a class="main-nav-link" href="../community/contribute.html">Contribute</a></li> |
| <li><a class="main-nav-link" href="../community/powered_by.html">Powered By</a></li> |
| </ul> |
| </span> |
| <a class="main-nav-link" href="http://discuss.mxnet.io">Discuss</a> |
| <span id="dropdown-menu-position-anchor-version" style="position: relative"><a href="#" class="main-nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true">Versions(1.0.0)<span class="caret"></span></a><ul id="package-dropdown-menu" class="dropdown-menu"><li><a class="main-nav-link" href=https://mxnet.incubator.apache.org/>1.0.0</a></li><li><a class="main-nav-link" href=https://mxnet.incubator.apache.org/versions/0.12.1/index.html>0.12.1</a></li><li><a class="main-nav-link" href=https://mxnet.incubator.apache.org/versions/0.12.0/index.html>0.12.0</a></li><li><a class="main-nav-link" href=https://mxnet.incubator.apache.org/versions/0.11.0/index.html>0.11.0</a></li><li><a class="main-nav-link" href=https://mxnet.incubator.apache.org/versions/master/index.html>master</a></li></ul></span></nav> |
| <script> function getRootPath(){ return "../" } </script> |
| <div class="burgerIcon dropdown"> |
| <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button">☰</a> |
| <ul class="dropdown-menu" id="burgerMenu"> |
| <li><a href="../install/index.html">Install</a></li> |
| <li><a class="main-nav-link" href="../tutorials/index.html">Tutorials</a></li> |
| <li class="dropdown-submenu"> |
| <a href="#" tabindex="-1">Community</a> |
| <ul class="dropdown-menu"> |
| <li><a href="../community/index.html" tabindex="-1">Community</a></li> |
| <li><a href="../community/contribute.html" tabindex="-1">Contribute</a></li> |
| <li><a href="../community/powered_by.html" tabindex="-1">Powered By</a></li> |
| </ul> |
| </li> |
| <li class="dropdown-submenu"> |
| <a href="#" tabindex="-1">API</a> |
| <ul class="dropdown-menu"> |
| <li><a href="../api/python/index.html" tabindex="-1">Python</a> |
| </li> |
| <li><a href="../api/scala/index.html" tabindex="-1">Scala</a> |
| </li> |
| <li><a href="../api/r/index.html" tabindex="-1">R</a> |
| </li> |
| <li><a href="../api/julia/index.html" tabindex="-1">Julia</a> |
| </li> |
| <li><a href="../api/c++/index.html" tabindex="-1">C++</a> |
| </li> |
| <li><a href="../api/perl/index.html" tabindex="-1">Perl</a> |
| </li> |
| </ul> |
| </li> |
| <li class="dropdown-submenu"> |
| <a href="#" tabindex="-1">Docs</a> |
| <ul class="dropdown-menu"> |
| <li><a href="../tutorials/index.html" tabindex="-1">Tutorials</a></li> |
| <li><a href="../faq/index.html" tabindex="-1">FAQ</a></li> |
| <li><a href="../architecture/index.html" tabindex="-1">Architecture</a></li> |
| <li><a href="https://github.com/apache/incubator-mxnet/tree/1.0.0/example" tabindex="-1">Examples</a></li> |
| <li><a href="../model_zoo/index.html" tabindex="-1">Model Zoo</a></li> |
| </ul> |
| </li> |
| <li><a href="../architecture/index.html">Architecture</a></li> |
| <li><a class="main-nav-link" href="https://github.com/dmlc/mxnet">Github</a></li> |
| <li id="dropdown-menu-position-anchor-version-mobile" class="dropdown-submenu" style="position: relative"><a href="#" tabindex="-1">Versions(1.0.0)</a><ul class="dropdown-menu"><li><a tabindex="-1" href=https://mxnet.incubator.apache.org/>1.0.0</a></li><li><a tabindex="-1" href=https://mxnet.incubator.apache.org/versions/0.12.1/index.html>0.12.1</a></li><li><a tabindex="-1" href=https://mxnet.incubator.apache.org/versions/0.12.0/index.html>0.12.0</a></li><li><a tabindex="-1" href=https://mxnet.incubator.apache.org/versions/0.11.0/index.html>0.11.0</a></li><li><a tabindex="-1" href=https://mxnet.incubator.apache.org/versions/master/index.html>master</a></li></ul></li></ul> |
| </div> |
| <div class="plusIcon dropdown"> |
| <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button"><span aria-hidden="true" class="glyphicon glyphicon-plus"></span></a> |
| <ul class="dropdown-menu dropdown-menu-right" id="plusMenu"></ul> |
| </div> |
| <div id="search-input-wrap"> |
| <form action="../search.html" autocomplete="off" class="" method="get" role="search"> |
| <div class="form-group inner-addon left-addon"> |
| <i class="glyphicon glyphicon-search"></i> |
| <input class="form-control" name="q" placeholder="Search" type="text"/> |
| </div> |
| <input name="check_keywords" type="hidden" value="yes"> |
| <input name="area" type="hidden" value="default"/> |
| </input></form> |
| <div id="search-preview"></div> |
| </div> |
| <div id="searchIcon"> |
| <span aria-hidden="true" class="glyphicon glyphicon-search"></span> |
| </div> |
| <!-- <div id="lang-select-wrap"> --> |
| <!-- <label id="lang-select-label"> --> |
| <!-- <\!-- <i class="fa fa-globe"></i> -\-> --> |
| <!-- <span></span> --> |
| <!-- </label> --> |
| <!-- <select id="lang-select"> --> |
| <!-- <option value="en">Eng</option> --> |
| <!-- <option value="zh">中文</option> --> |
| <!-- </select> --> |
| <!-- </div> --> |
| <!-- <a id="mobile-nav-toggle"> |
| <span class="mobile-nav-toggle-bar"></span> |
| <span class="mobile-nav-toggle-bar"></span> |
| <span class="mobile-nav-toggle-bar"></span> |
| </a> --> |
| </div> |
| </div> |
| </div> |
| <script type="text/javascript"> |
| $('body').css('background', 'white'); |
| </script> |
| <div class="container"> |
| <div class="row"> |
| <div aria-label="main navigation" class="sphinxsidebar leftsidebar" role="navigation"> |
| <div class="sphinxsidebarwrapper"> |
| <ul> |
| <li class="toctree-l1"><a class="reference internal" href="../api/python/index.html">Python Documents</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../api/r/index.html">R Documents</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../api/julia/index.html">Julia Documents</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../api/c++/index.html">C++ Documents</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../api/scala/index.html">Scala Documents</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../api/perl/index.html">Perl Documents</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../faq/index.html">HowTo Documents</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../architecture/index.html">System Documents</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../tutorials/index.html">Tutorials</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../community/index.html">Community</a></li> |
| </ul> |
| </div> |
| </div> |
| <div class="content"> |
| <div class="page-tracker"></div> |
| <div class="section" id="installing-mxnet-on-ubuntu"> |
| <span id="installing-mxnet-on-ubuntu"></span><h1>Installing MXNet on Ubuntu<a class="headerlink" href="#installing-mxnet-on-ubuntu" title="Permalink to this headline">¶</a></h1> |
| <p><strong>NOTE:</strong> For MXNet with Python installation, please refer to the <a class="reference external" href="https://mxnet.incubator.apache.org/get_started/install.html">new install guide</a>.</p> |
| <p>MXNet currently supports Python, R, Julia, Scala, and Perl. For users of R on Ubuntu operating systems, MXNet provides a set of Git Bash scripts that installs all of the required MXNet dependencies and the MXNet library.</p> |
| <p>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 <code class="docutils literal"><span class="pre">~/mxnet</span></code>.</p> |
| <div class="section" id="prepare-environment-for-gpu-installation"> |
| <span id="prepare-environment-for-gpu-installation"></span><h2>Prepare environment for GPU Installation<a class="headerlink" href="#prepare-environment-for-gpu-installation" title="Permalink to this headline">¶</a></h2> |
| <p>If you plan to build with GPU, you need to set up the environment for CUDA and CUDNN.</p> |
| <p>First, download and install <a class="reference external" href="https://developer.nvidia.com/cuda-toolkit">CUDA 8 toolkit</a>.</p> |
| <p>Then download <a class="reference external" href="https://developer.nvidia.com/cudnn">cudnn 6</a>.</p> |
| <p>Unzip the file and change to the cudnn root directory. Move the header and libraries to your local CUDA Toolkit folder:</p> |
| <div class="highlight-bash"><div class="highlight"><pre><span></span> tar xvzf cudnn-8.0-linux-x64-v6.0.tgz |
| sudo cp -P cuda/include/cudnn.h /usr/local/cuda/include |
| sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda/lib64 |
| sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn* |
| sudo ldconfig |
| </pre></div> |
| </div> |
| <p>Finally, add configurations to config.mk file:</p> |
| <div class="highlight-bash"><div class="highlight"><pre><span></span> cp make/config.mk . |
| </pre></div> |
| </div> |
| </div> |
| <div class="section" id="quick-installation"> |
| <span id="quick-installation"></span><h2>Quick Installation<a class="headerlink" href="#quick-installation" title="Permalink to this headline">¶</a></h2> |
| <div class="section" id="install-mxnet-for-r"> |
| <span id="install-mxnet-for-r"></span><h3>Install MXNet for R<a class="headerlink" href="#install-mxnet-for-r" title="Permalink to this headline">¶</a></h3> |
| <p>MXNet requires R-version to be 3.2.0 and above. If you are running an earlier version of R, run below commands to update your R version, before running the installation script.</p> |
| <div class="highlight-bash"><div class="highlight"><pre><span></span> sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9 |
| sudo add-apt-repository ppa:marutter/rdev |
| |
| sudo apt-get update |
| sudo apt-get upgrade |
| sudo apt-get install r-base r-base-dev |
| </pre></div> |
| </div> |
| <p>To install MXNet for R:</p> |
| <div class="highlight-bash"><div class="highlight"><pre><span></span> <span class="c1"># Clone mxnet repository. In terminal, run the commands WITHOUT "sudo"</span> |
| git clone https://github.com/dmlc/mxnet.git ~/mxnet --recursive |
| |
| <span class="nb">cd</span> ~/mxnet |
| cp make/config.mk . |
| <span class="c1"># If building with GPU, add configurations to config.mk file:</span> |
| <span class="nb">echo</span> <span class="s2">"USE_CUDA=1"</span> >>config.mk |
| <span class="nb">echo</span> <span class="s2">"USE_CUDA_PATH=/usr/local/cuda"</span> >>config.mk |
| <span class="nb">echo</span> <span class="s2">"USE_CUDNN=1"</span> >>config.mk |
| |
| <span class="nb">cd</span> ~/mxnet/setup-utils |
| bash install-mxnet-ubuntu-r.sh |
| </pre></div> |
| </div> |
| <p>The installation script to install MXNet for R can be found <a class="reference external" href="https://raw.githubusercontent.com/dmlc/mxnet/master/setup-utils/install-mxnet-ubuntu-r.sh">here</a>.</p> |
| </div> |
| </div> |
| <div class="section" id="standard-installation"> |
| <span id="standard-installation"></span><h2>Standard installation<a class="headerlink" href="#standard-installation" title="Permalink to this headline">¶</a></h2> |
| <p>Installing MXNet is a two-step process:</p> |
| <ol class="simple"> |
| <li>Build the shared library from the MXNet C++ source code.</li> |
| <li>Install the supported language-specific packages for MXNet.</li> |
| </ol> |
| <p><strong>Note:</strong> To change the compilation options for your build, edit the <code class="docutils literal"><span class="pre">make/config.mk</span></code> file and submit a build request with the <code class="docutils literal"><span class="pre">make</span></code> command.</p> |
| <div class="section" id="build-the-shared-library"> |
| <span id="build-the-shared-library"></span><h3>Build the Shared Library<a class="headerlink" href="#build-the-shared-library" title="Permalink to this headline">¶</a></h3> |
| <p>On Ubuntu versions 13.10 or later, you need the following dependencies:</p> |
| <p><strong>Step 1</strong> Install build tools and git.</p> |
| <div class="highlight-bash"><div class="highlight"><pre><span></span> sudo apt-get update |
| sudo apt-get install -y build-essential git |
| </pre></div> |
| </div> |
| <p><strong>Step 2</strong> Install OpenBLAS.</p> |
| <p><em>MXNet</em> uses <a class="reference external" href="https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms">BLAS</a> library for accelerated numerical computations on CPU machine. There are several flavors of BLAS libraries - <a class="reference external" href="http://www.openblas.net/">OpenBLAS</a>, <a class="reference external" href="http://math-atlas.sourceforge.net/">ATLAS</a> and <a class="reference external" href="https://software.intel.com/en-us/intel-mkl">MKL</a>. In this step we install OpenBLAS. You can choose to install ATLAS or MKL.</p> |
| <div class="highlight-bash"><div class="highlight"><pre><span></span> sudo apt-get install -y libopenblas-dev |
| </pre></div> |
| </div> |
| <p><strong>Step 3</strong> Install OpenCV.</p> |
| <p><em>MXNet</em> uses <a class="reference external" href="http://opencv.org/">OpenCV</a> for efficient image loading and augmentation operations.</p> |
| <div class="highlight-bash"><div class="highlight"><pre><span></span> sudo apt-get install -y libopencv-dev |
| </pre></div> |
| </div> |
| <p><strong>Step 4</strong> Download MXNet sources and build MXNet core shared library.</p> |
| <p>If building on CPU:</p> |
| <div class="highlight-bash"><div class="highlight"><pre><span></span> git clone --recursive https://github.com/apache/incubator-mxnet.git mxnet --branch 1.0.0 |
| <span class="nb">cd</span> mxnet |
| make -j <span class="k">$(</span>nproc<span class="k">)</span> <span class="nv">USE_OPENCV</span><span class="o">=</span><span class="m">1</span> <span class="nv">USE_BLAS</span><span class="o">=</span>openblas |
| </pre></div> |
| </div> |
| <p>If building on GPU:</p> |
| <div class="highlight-bash"><div class="highlight"><pre><span></span> git clone --recursive https://github.com/apache/incubator-mxnet.git mxnet --branch 1.0.0 |
| <span class="nb">cd</span> mxnet |
| make -j <span class="k">$(</span>nproc<span class="k">)</span> <span class="nv">USE_OPENCV</span><span class="o">=</span><span class="m">1</span> <span class="nv">USE_BLAS</span><span class="o">=</span>openblas <span class="nv">USE_CUDA</span><span class="o">=</span><span class="m">1</span> <span class="nv">USE_CUDA_PATH</span><span class="o">=</span>/usr/local/cuda <span class="nv">USE_CUDNN</span><span class="o">=</span><span class="m">1</span> |
| </pre></div> |
| </div> |
| <p><em>Note</em> - USE_OPENCV and USE_BLAS are make file flags to set compilation options to use OpenCV and BLAS library. You can explore and use more compilation options in <code class="docutils literal"><span class="pre">make/config.mk</span></code>.</p> |
| <p>Executing these commands creates a library called <code class="docutils literal"><span class="pre">libmxnet.so</span></code>.</p> |
| <p>Next, we install <code class="docutils literal"><span class="pre">graphviz</span></code> library that we use for visualizing network graphs you build on MXNet. We will also install <a class="reference external" href="http://jupyter.readthedocs.io/">Jupyter Notebook</a> used for running MXNet tutorials and examples.</p> |
| <div class="highlight-bash"><div class="highlight"><pre><span></span> sudo apt-get install -y python-pip |
| sudo pip install graphviz |
| sudo pip install Jupyter |
| </pre></div> |
| </div> |
| <p><p> </p> |
| </p> |
| <p>We have installed MXNet core library. Next, we will install MXNet interface package for programming language of your choice:</p> |
| <ul class="simple"> |
| <li><a class="reference external" href="#install-the-mxnet-package-for-r">R</a></li> |
| <li><a class="reference external" href="#install-the-mxnet-package-for-julia">Julia</a></li> |
| <li><a class="reference external" href="#install-the-mxnet-package-for-scala">Scala</a></li> |
| <li><a class="reference external" href="#install-the-mxnet-package-for-perl">Perl</a></li> |
| </ul> |
| </div> |
| <div class="section" id="install-the-mxnet-package-for-r"> |
| <span id="install-the-mxnet-package-for-r"></span><h3>Install the MXNet Package for R<a class="headerlink" href="#install-the-mxnet-package-for-r" title="Permalink to this headline">¶</a></h3> |
| <p>Run the following commands to install the MXNet dependencies and build the MXNet R package.</p> |
| <div class="highlight-bash"><div class="highlight"><pre><span></span> Rscript -e <span class="s2">"install.packages('devtools', repo = 'https://cran.rstudio.com')"</span> |
| </pre></div> |
| </div> |
| <div class="highlight-bash"><div class="highlight"><pre><span></span> <span class="nb">cd</span> R-package |
| Rscript -e <span class="s2">"library(devtools); library(methods); options(repos=c(CRAN='https://cran.rstudio.com')); install_deps(dependencies = TRUE)"</span> |
| <span class="nb">cd</span> .. |
| make rpkg |
| </pre></div> |
| </div> |
| <p><strong>Note:</strong> R-package is a folder in the MXNet source.</p> |
| <p>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:</p> |
| <div class="highlight-bash"><div class="highlight"><pre><span></span> R CMD INSTALL mxnet_current_r.tar.gz |
| </pre></div> |
| </div> |
| </div> |
| <div class="section" id="install-the-mxnet-package-for-julia"> |
| <span id="install-the-mxnet-package-for-julia"></span><h3>Install the MXNet Package for Julia<a class="headerlink" href="#install-the-mxnet-package-for-julia" title="Permalink to this headline">¶</a></h3> |
| <p>The MXNet package for Julia is hosted in a separate repository, MXNet.jl, which is available on <a class="reference external" href="https://github.com/dmlc/MXNet.jl">GitHub</a>. To use Julia binding it with an existing libmxnet installation, set the <code class="docutils literal"><span class="pre">MXNET_HOME</span></code> environment variable by running the following command:</p> |
| <div class="highlight-bash"><div class="highlight"><pre><span></span> <span class="nb">export</span> <span class="nv">MXNET_HOME</span><span class="o">=</span>/<path to>/libmxnet |
| </pre></div> |
| </div> |
| <p>The path to the existing libmxnet installation should be the root directory of libmxnet. In other words, you should be able to find the <code class="docutils literal"><span class="pre">libmxnet.so</span></code> file at <code class="docutils literal"><span class="pre">$MXNET_HOME/lib</span></code>. For example, if the root directory of libmxnet is <code class="docutils literal"><span class="pre">~</span></code>, you would run the following command:</p> |
| <div class="highlight-bash"><div class="highlight"><pre><span></span> <span class="nb">export</span> <span class="nv">MXNET_HOME</span><span class="o">=</span>/~/libmxnet |
| </pre></div> |
| </div> |
| <p>You might want to add this command to your <code class="docutils literal"><span class="pre">~/.bashrc</span></code> file. If you do, you can install the Julia package in the Julia console using the following command:</p> |
| <div class="highlight-julia"><div class="highlight"><pre><span></span> <span class="n">Pkg</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="s">"MXNet"</span><span class="p">)</span> |
| </pre></div> |
| </div> |
| <p>For more details about installing and using MXNet with Julia, see the <a class="reference external" href="http://dmlc.ml/MXNet.jl/latest/user-guide/install/">MXNet Julia documentation</a>.</p> |
| </div> |
| <div class="section" id="install-the-mxnet-package-for-scala"> |
| <span id="install-the-mxnet-package-for-scala"></span><h3>Install the MXNet Package for Scala<a class="headerlink" href="#install-the-mxnet-package-for-scala" title="Permalink to this headline">¶</a></h3> |
| <p>There are two ways to install the MXNet package for Scala:</p> |
| <ul class="simple"> |
| <li>Use the prebuilt binary package</li> |
| <li>Build the library from source code</li> |
| </ul> |
| <div class="section" id="use-the-prebuilt-binary-package"> |
| <span id="use-the-prebuilt-binary-package"></span><h4>Use the Prebuilt Binary Package<a class="headerlink" href="#use-the-prebuilt-binary-package" title="Permalink to this headline">¶</a></h4> |
| <p>For Linux users, MXNet provides prebuilt binary packages that support computers with either GPU or CPU processors. To download and build these packages using <code class="docutils literal"><span class="pre">Maven</span></code>, change the <code class="docutils literal"><span class="pre">artifactId</span></code> in the following Maven dependency to match your architecture:</p> |
| <div class="highlight-HTML"><div class="highlight"><pre><span></span><span class="p"><</span><span class="nt">dependency</span><span class="p">></span> |
| <span class="p"><</span><span class="nt">groupId</span><span class="p">></span>ml.dmlc.mxnet<span class="p"></</span><span class="nt">groupId</span><span class="p">></span> |
| <span class="p"><</span><span class="nt">artifactId</span><span class="p">></span>mxnet-full_<span class="p"><</span><span class="nt">system</span> <span class="na">architecture</span><span class="p">></</span><span class="nt">artifactId</span><span class="p">></span> |
| <span class="p"><</span><span class="nt">version</span><span class="p">></span>0.1.1<span class="p"></</span><span class="nt">version</span><span class="p">></span> |
| <span class="p"></</span><span class="nt">dependency</span><span class="p">></span> |
| </pre></div> |
| </div> |
| <p>For example, to download and build the 64-bit CPU-only version for Linux, use:</p> |
| <div class="highlight-HTML"><div class="highlight"><pre><span></span><span class="p"><</span><span class="nt">dependency</span><span class="p">></span> |
| <span class="p"><</span><span class="nt">groupId</span><span class="p">></span>ml.dmlc.mxnet<span class="p"></</span><span class="nt">groupId</span><span class="p">></span> |
| <span class="p"><</span><span class="nt">artifactId</span><span class="p">></span>mxnet-full_2.10-linux-x86_64-cpu<span class="p"></</span><span class="nt">artifactId</span><span class="p">></span> |
| <span class="p"><</span><span class="nt">version</span><span class="p">></span>0.1.1<span class="p"></</span><span class="nt">version</span><span class="p">></span> |
| <span class="p"></</span><span class="nt">dependency</span><span class="p">></span> |
| </pre></div> |
| </div> |
| <p>If your native environment differs slightly from the assembly package, for example, if you use the openblas package instead of the atlas package, it’s better to use the mxnet-core package and put the compiled Java native library in your load path:</p> |
| <div class="highlight-HTML"><div class="highlight"><pre><span></span><span class="p"><</span><span class="nt">dependency</span><span class="p">></span> |
| <span class="p"><</span><span class="nt">groupId</span><span class="p">></span>ml.dmlc.mxnet<span class="p"></</span><span class="nt">groupId</span><span class="p">></span> |
| <span class="p"><</span><span class="nt">artifactId</span><span class="p">></span>mxnet-core_2.10<span class="p"></</span><span class="nt">artifactId</span><span class="p">></span> |
| <span class="p"><</span><span class="nt">version</span><span class="p">></span>0.1.1<span class="p"></</span><span class="nt">version</span><span class="p">></span> |
| <span class="p"></</span><span class="nt">dependency</span><span class="p">></span> |
| </pre></div> |
| </div> |
| </div> |
| <div class="section" id="build-the-library-from-source-code"> |
| <span id="build-the-library-from-source-code"></span><h4>Build the Library from Source Code<a class="headerlink" href="#build-the-library-from-source-code" title="Permalink to this headline">¶</a></h4> |
| <p>Before you build MXNet for Scala from source code, you must complete <a class="reference external" href="#build-the-shared-library">building the shared library</a>. After you build the shared library, run the following command from the MXNet source root directory to build the MXNet Scala package:</p> |
| <div class="highlight-bash"><div class="highlight"><pre><span></span> make scalapkg |
| </pre></div> |
| </div> |
| <p>This command creates the JAR files for the assembly, core, and example modules. It also creates the native library in the <code class="docutils literal"><span class="pre">native/{your-architecture}/target</span> <span class="pre">directory</span></code>, which you can use to cooperate with the core module.</p> |
| <p>To install the MXNet Scala package into your local Maven repository, run the following command from the MXNet source root directory:</p> |
| <div class="highlight-bash"><div class="highlight"><pre><span></span> make scalainstall |
| </pre></div> |
| </div> |
| </div> |
| </div> |
| <div class="section" id="install-the-mxnet-package-for-perl"> |
| <span id="install-the-mxnet-package-for-perl"></span><h3>Install the MXNet Package for Perl<a class="headerlink" href="#install-the-mxnet-package-for-perl" title="Permalink to this headline">¶</a></h3> |
| <p>Before you build MXNet for Perl from source code, you must complete <a class="reference external" href="#build-the-shared-library">building the shared library</a>. After you build the shared library, run the following command from the MXNet source root directory to build the MXNet Perl package:</p> |
| <div class="highlight-bash"><div class="highlight"><pre><span></span> sudo apt-get install libmouse-perl pdl cpanminus swig libgraphviz-perl |
| cpanm -q -L <span class="s2">"</span><span class="si">${</span><span class="nv">HOME</span><span class="si">}</span><span class="s2">/perl5"</span> Function::Parameters Hash::Ordered |
| |
| <span class="nv">MXNET_HOME</span><span class="o">=</span><span class="si">${</span><span class="nv">PWD</span><span class="si">}</span> |
| <span class="nb">export</span> <span class="nv">LD_LIBRARY_PATH</span><span class="o">=</span><span class="si">${</span><span class="nv">MXNET_HOME</span><span class="si">}</span>/lib |
| <span class="nb">export</span> <span class="nv">PERL5LIB</span><span class="o">=</span><span class="si">${</span><span class="nv">HOME</span><span class="si">}</span>/perl5/lib/perl5 |
| |
| <span class="nb">cd</span> <span class="si">${</span><span class="nv">MXNET_HOME</span><span class="si">}</span>/perl-package/AI-MXNetCAPI/ |
| perl Makefile.PL <span class="nv">INSTALL_BASE</span><span class="o">=</span><span class="si">${</span><span class="nv">HOME</span><span class="si">}</span>/perl5 |
| make install |
| |
| <span class="nb">cd</span> <span class="si">${</span><span class="nv">MXNET_HOME</span><span class="si">}</span>/perl-package/AI-NNVMCAPI/ |
| perl Makefile.PL <span class="nv">INSTALL_BASE</span><span class="o">=</span><span class="si">${</span><span class="nv">HOME</span><span class="si">}</span>/perl5 |
| make install |
| |
| <span class="nb">cd</span> <span class="si">${</span><span class="nv">MXNET_HOME</span><span class="si">}</span>/perl-package/AI-MXNet/ |
| perl Makefile.PL <span class="nv">INSTALL_BASE</span><span class="o">=</span><span class="si">${</span><span class="nv">HOME</span><span class="si">}</span>/perl5 |
| make install |
| </pre></div> |
| </div> |
| <p>**Note - ** You are more than welcome to contribute easy installation scripts for other operating systems and programming languages, see <a class="reference external" href="https://mxnet.incubator.apache.org/community/index.html">community page</a> for contributors guidelines.</p> |
| </div> |
| </div> |
| <div class="section" id="next-steps"> |
| <span id="next-steps"></span><h2>Next Steps<a class="headerlink" href="#next-steps" title="Permalink to this headline">¶</a></h2> |
| <div class="toctree-wrapper compound"> |
| <ul> |
| <li class="toctree-l1"><a class="reference external" href="https://mxnet.incubator.apache.org/tutorials/index.html">Tutorials</a></li> |
| <li class="toctree-l1"><a class="reference external" href="https://mxnet.incubator.apache.org/how_to/index.html">How To</a></li> |
| <li class="toctree-l1"><a class="reference external" href="https://mxnet.incubator.apache.org/architecture/index.html">Architecture</a></li> |
| </ul> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div aria-label="main navigation" class="sphinxsidebar rightsidebar" role="navigation"> |
| <div class="sphinxsidebarwrapper"> |
| <h3><a href="../index.html">Table Of Contents</a></h3> |
| <ul> |
| <li><a class="reference internal" href="#">Installing MXNet on Ubuntu</a><ul> |
| <li><a class="reference internal" href="#prepare-environment-for-gpu-installation">Prepare environment for GPU Installation</a></li> |
| <li><a class="reference internal" href="#quick-installation">Quick Installation</a><ul> |
| <li><a class="reference internal" href="#install-mxnet-for-r">Install MXNet for R</a></li> |
| </ul> |
| </li> |
| <li><a class="reference internal" href="#standard-installation">Standard installation</a><ul> |
| <li><a class="reference internal" href="#build-the-shared-library">Build the Shared Library</a></li> |
| <li><a class="reference internal" href="#install-the-mxnet-package-for-r">Install the MXNet Package for R</a></li> |
| <li><a class="reference internal" href="#install-the-mxnet-package-for-julia">Install the MXNet Package for Julia</a></li> |
| <li><a class="reference internal" href="#install-the-mxnet-package-for-scala">Install the MXNet Package for Scala</a><ul> |
| <li><a class="reference internal" href="#use-the-prebuilt-binary-package">Use the Prebuilt Binary Package</a></li> |
| <li><a class="reference internal" href="#build-the-library-from-source-code">Build the Library from Source Code</a></li> |
| </ul> |
| </li> |
| <li><a class="reference internal" href="#install-the-mxnet-package-for-perl">Install the MXNet Package for Perl</a></li> |
| </ul> |
| </li> |
| <li><a class="reference internal" href="#next-steps">Next Steps</a></li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </div><div class="footer"> |
| <div class="section-disclaimer"> |
| <div class="container"> |
| <div> |
| <img height="60" src="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/apache_incubator_logo.png"/> |
| <p> |
| Apache MXNet is an effort undergoing incubation at The Apache Software Foundation (ASF), <strong>sponsored by the <i>Apache Incubator</i></strong>. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF. |
| </p> |
| <p> |
| "Copyright © 2017, The Apache Software Foundation |
| Apache MXNet, MXNet, Apache, the Apache feather, and the Apache MXNet project logo are either registered trademarks or trademarks of the Apache Software Foundation." |
| </p> |
| </div> |
| </div> |
| </div> |
| </div> <!-- pagename != index --> |
| </div> |
| <script crossorigin="anonymous" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> |
| <script src="../_static/js/sidebar.js" type="text/javascript"></script> |
| <script src="../_static/js/search.js" type="text/javascript"></script> |
| <script src="../_static/js/navbar.js" type="text/javascript"></script> |
| <script src="../_static/js/clipboard.min.js" type="text/javascript"></script> |
| <script src="../_static/js/copycode.js" type="text/javascript"></script> |
| <script src="../_static/js/page.js" type="text/javascript"></script> |
| <script type="text/javascript"> |
| $('body').ready(function () { |
| $('body').css('visibility', 'visible'); |
| }); |
| </script> |
| </body> |
| </html> |