ankkhedia commented on a change in pull request #11805: [MXNET-641] fix R 
windows install docs
URL: https://github.com/apache/incubator-mxnet/pull/11805#discussion_r204512013
 
 

 ##########
 File path: docs/install/windows_setup.md
 ##########
 @@ -114,81 +114,138 @@ For CPU-only package:
   install.packages("mxnet")
 ```
 
-For GPU-enabled package:
+#### Building MXNet from Source Code(CPU)
+1. Clone the MXNet github repo.
 
-```r
-  cran <- getOption("repos")
-  cran["dmlc"] <- 
"https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/GPU";
-  options(repos = cran)
-  install.packages("mxnet")
+```sh
+git clone --recursive https://github.com/dmlc/mxnet
 ```
 
-#### Building MXNet from Source Code
+The `--recursive` is to clone all the submodules used by MXNet. You will be 
editing the ```"/mxnet/R-package"``` folder.
+2. Download prebuilt GPU-enabled MXNet libraries for Windows from [Windows 
release](https://github.com/yajiedesign/mxnet/releases). You will need 
`mxnet_x64_vc14_cpu.7z` and `prebuildbase_win10_x64_vc14.7z` where X stands for 
your CUDA toolkit version
+3. Create a folder called ```R-package/inst/libs/x64```. MXNet supports only 
64-bit operating systems, so you need the x64 folder.
+4. Copy the following shared libraries (.dll files) into the 
```R-package/inst/libs/x64``` folder:
+```
+libgcc_s_seh-1.dll
+libgfortran-3.dll
+libmxnet.dll
+libmxnet.lib
+libopenblas.dll
+libquadmath-0.dll
+mxnet.dll
+unzip.exe
+unzip32.dll
+vcomp140.dll
+wget.exe
+```
+These dlls can be found in `prebuildbase_win10_x64_vc14/3rdparty`, 
`mxnet_x64_vc14_cpu/build`, `mxnet_x64_vc14_cpu/lib`.
 
-Run the following commands to install the MXNet dependencies and build the 
MXNet R package.
+5. Copy the header files from `dmlc`, `mxnet`, `mxshadow` and `nnvm` from 
mxnet_x64_vc14_cpu/include and mxnet_x64_vc14_cpu/nvnm/include into 
`./R-package/inst/include`. It should look like:
 
-```r
-  Rscript -e "install.packages('devtools', repo = 
'https://cloud.r-project.org/')"
 ```
+./R-package/inst
+└── include
+    ├── dmlc
+    ├── mxnet
+    ├── mshadow
+    └── nnvm 
+    
+```
+6. Make sure that R is added to your ```PATH``` in the environment variables. 
Running the ```where R``` command at the command prompt should return the 
location.
+7. Also make sure that Rtools in installed and added to your ```PATH``` in the 
environment variables.
+8. Temporary patch - im2rec currently results in crashes during the build. 
Remove the im2rec.h and im2rec.cc files in R-package/src/ from cloned 
repository and comment out the two im2rec lines in R-package/src/mxnet.cc.
+9. Now open the Windows CMD with admin rights and change the directory to the 
`mxnet` folder(cloned repository). Then use the following commands
+to build R package:
 
-```bash
-  cd R-package
-  Rscript -e "library(devtools); library(methods); 
options(repos=c(CRAN='https://cloud.r-project.org/')); 
install_deps(dependencies = TRUE)"
-  cd ..
-  make rpkg
+```bat
+echo import(Rcpp) > R-package\NAMESPACE
+echo import(methods) >> R-package\NAMESPACE
+Rscript -e "install.packages('devtools', repos = 
'https://cloud.r-project.org')"
+cd R-package
+Rscript -e "library(devtools); library(methods); 
options(repos=c(CRAN='https://cloud.r-project.org')); install_deps(dependencies 
= TRUE)"
+cd ..
+
+R CMD INSTALL --no-multiarch R-package
+
+Rscript -e "require(mxnet); mxnet:::mxnet.export('R-package')"
+rm R-package/NAMESPACE
+Rscript -e "require(devtools); install_version('roxygen2', version = '5.0.1', 
repos = 'https://cloud.r-project.org/', quiet = TRUE)"
+Rscript -e "require(roxygen2); roxygen2::roxygenise('R-package')"
+
+R CMD INSTALL --build --no-multiarch R-package
 ```
 
+
 ### Installing MXNet on a Computer with a GPU Processor
+To install MXNet on a computer with a GPU processor, choose from two options:
+
+* Use the prebuilt binary package
+* Build the library from source code
+
+However, few dependencies remains same for both options.  You will need the 
following:
 
-To install MXNet R package on a computer with a GPU processor, you need the 
following:
+* Install Microsoft Visual Studio 2017 (required by CUDA)
 
-* Microsoft Visual Studio 2013
+* Install  [NVidia CUDA Toolkit](https://developer.nvidia.com/cuda-toolkit)
 
-* The NVidia CUDA Toolkit
+* Download and install [CuDNN 7](https://developer.nvidia.com/cudnn) (to 
provide a Deep Neural Network library)
 
-* The MXNet package
+Note: A pre-requisite to above softwares is 
[Nvidia-drivers](http://www.nvidia.com/Download/index.aspx?lang=en-us) which we 
assume is installed.
 
 Review comment:
   Usually it comes pre-installed with Windows system, however this needs to be 
an additional step in Windows Server images on ec2. So, added as note

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to