You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2020/08/28 17:55:16 UTC

[GitHub] [incubator-mxnet] hetong007 edited a comment on issue #18985: unable to build r packge

hetong007 edited a comment on issue #18985:
URL: https://github.com/apache/incubator-mxnet/issues/18985#issuecomment-682419310


   I did the following on my Ubuntu to install the CPU-version MXNet, could you please help to follow and verify:
   
   First, clone MXNet by `git clone --recursive https://github.com/apache/incubator-mxnet.git -b 1.6.0`.
   
   Then, Compile with `cmake`:
   
   ```sh
   cd $MXNET_ROOT # go into your cloned repo
   mkdir build && cd build
   cmake -DUSE_CUDA=OFF ..
   make -j16
   ```
   
   I believe you have been here already. So the R part is the following.
   
   I have to modify two files first, please see the diff info below:
   
   ```diff
   diff --git a/Makefile b/Makefile
   index 4746cc434..0ec177232 100644
   --- a/Makefile
   +++ b/Makefile
   @@ -707,6 +707,7 @@ rpkg:
           R CMD INSTALL R-package
           Rscript -e "require(mxnet); mxnet:::mxnet.export('R-package'); warnings()"
           rm R-package/NAMESPACE
   +       touch R-package/NAMESPACE
           Rscript -e "devtools::document('R-package');warnings()"
           R CMD INSTALL R-package
   
   diff --git a/R-package/R/zzz.R b/R-package/R/zzz.R
   index a4f03ace0..1a421f1d4 100644
   --- a/R-package/R/zzz.R
   +++ b/R-package/R/zzz.R
   @@ -34,6 +34,7 @@ NULL
    .onLoad <- function(libname, pkgname) {
      # Require methods for older versions of R
      require(methods)
   +  require(Rcpp)
      tryCatch(library.dynam("libmxnet", pkgname, libname, local=FALSE), error = function(e) { print('Loading local: inst/libs/libmxnet.so'); dyn.load("R-package/inst/libs/libmxnet.so", local=FALSE) })
      tryCatch(library.dynam("mxnet", pkgname, libname), error = function(e) { print('Loading local: src/mxnet.so'); dyn.load("R-package/src/mxnet.so") })
      loadModule("mxnet", TRUE)
   ```
   
   Finally, under your $MXNET_ROOT, run `make rpkg`.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org