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

ubuntu 18.04 R-package #13586

Closed
hatinder opened this issue Dec 8, 2018 · 6 comments
Closed

ubuntu 18.04 R-package #13586

hatinder opened this issue Dec 8, 2018 · 6 comments

Comments

@hatinder
Copy link

hatinder commented Dec 8, 2018

Note: Providing complete information in the most concise form is the best way to get help. This issue template serves as the checklist for essential information to most of the technical issues and bug reports. For non-technical issues and feature requests, feel free to present the information in what you believe is the best form.

For Q & A and discussion, please start a discussion thread at https://discuss.mxnet.io

Description

I manage to build mxnet on ubuntu but I cant install Rpackage. Here is my build command.
Folder where i call the command : apache-mxnet-src-1.3.0-incubating/build/Release$
cmake -j -DUSE_CUDA=0 -DUSE_MKLDNN=1 ../../
Subsequently I tried following command

src/apache-mxnet-src-1.3.0-incubating$
sudo make rpkg

Error message below.
**
Makefile:176: "USE_LAPACK disabled because libraries were not found"
mkdir -p R-package/inst
mkdir -p R-package/inst/libs
cp src/io/image_recordio.h R-package/src
cp -rf lib/libmxnet.so R-package/inst/libs
mkdir -p R-package/inst/include
cp -rf include/* R-package/inst/include
cp -rf 3rdparty/dmlc-core/include/* R-package/inst/include/
cp -rf 3rdparty/tvm/nnvm/include/* R-package/inst/include
Rscript -e "if(!require(devtools)){install.packages('devtools', repo = 'https://cloud.r-project.org/')}"
Loading required package: devtools
Rscript -e "library(devtools); library(methods); options(repos=c(CRAN='https://cloud.r-project.org/')); install_deps(pkg='R-package', dependencies = TRUE)"
Error: Could not find package root.
Execution halted
Makefile:568: recipe for target 'rpkg' failed
make: *** [rpkg] Error 1

**

Environment info (Required)

Ubuntu 18.04

@jeremiedb
Copy link
Contributor

Makefile:176: "USE_LAPACK disabled because libraries were not found"
Had you installed a blas and lapack libraries? : sudo apt-get install -y libopenblas-dev liblapack-dev

Are you using R version >= 3.4.4? You can look at https://mxnet.apache.org/install/index.html?platform=Linux&language=R&processor=CPU for further details.

Please note that there seems that have a recent bug that should be fixed by #13590. But if you build from version 1.3.0, you should be fine.

@hatinder
Copy link
Author

hatinder commented Dec 9, 2018

Hi ,
I am using source version 1.3.0 if you check the command prompt above. libraries are already installed and correct version.
liblapack-dev is already the newest version (3.7.1-4ubuntu1).
libopenblas-dev is already the newest version (0.2.20+ds-4).
This line is just a warning.
**
Makefile:176: "USE_LAPACK disabled because libraries were not found"
**
Actual issue is following
**
Rscript -e "library(devtools); library(methods); options(repos=c(CRAN='https://cloud.r-project.org/')); install_deps(pkg='R-package', dependencies = TRUE)"
Error: Could not find package root.
Execution halted
Makefile:568: recipe for target 'rpkg' failed
make: *** [rpkg] Error 1
**

@jeremiedb
Copy link
Contributor

I was wondering about your R version (rather than MXNet version), could you print what is returned by: R.version() in a R session?

The root error message seems to point to the R-package directory not containing the appropriate files for building the package. Can you check that R-package directory contains both a DESCRIPTION and NAMESPACE file? If there's no NAMESPACE, modify the Makefile (located in root directory: src/apache-mxnet-src-1.3.0-incubating) to add the following:

echo "import(Rcpp)" > R-package/NAMESPACE
echo "import(methods)" >> R-package/NAMESPACE

Just before the line that caused the error (Rscript -e "library(devtools); library(methods); options(repos=c(CRAN='https://cloud.r-project.org/')); install_deps(pkg='R-package', dependencies = TRUE)").

@hatinder
Copy link
Author

Hi ,
Thanks for getting back to me. here is my R.Version() output.

R.Version()
$platform
[1] "x86_64-pc-linux-gnu"

$arch
[1] "x86_64"

$os
[1] "linux-gnu"

$system
[1] "x86_64, linux-gnu"

$status
[1] ""

$major
[1] "3"

$minor
[1] "5.1"

$year
[1] "2018"

$month
[1] "07"

$day
[1] "02"

$svn rev
[1] "74947"

$language
[1] "R"

$version.string
[1] "R version 3.5.1 (2018-07-02)"

$nickname
[1] "Feather Spray"

I copied the lines as you advised, please see the results below:
~/src/apache-mxnet-src-1.3.0-incubating$ make rpkg
Makefile:176: "USE_LAPACK disabled because libraries were not found"
mkdir -p R-package/inst
mkdir -p R-package/inst/libs
cp src/io/image_recordio.h R-package/src
cp -rf lib/libmxnet.so R-package/inst/libs
mkdir -p R-package/inst/include
cp -rf include/* R-package/inst/include
cp -rf 3rdparty/dmlc-core/include/* R-package/inst/include/
cp -rf 3rdparty/tvm/nnvm/include/* R-package/inst/include
Rscript -e "if(!require(devtools)){install.packages('devtools', repo = 'https://cloud.r-project.org/')}"
Loading required package: devtools
echo "import(Rcpp)" > R-package/NAMESPACE
echo "import(methods)" >> R-package/NAMESPACE
Rscript -e "library(devtools); library(methods); options(repos=c(CRAN='https://cloud.r-project.org/')); install_deps(pkg='R-package', dependencies = TRUE)"
Error: Could not find package root.
Execution halted
Makefile:568: recipe for target 'rpkg' failed
make: *** [rpkg] Error 1

@jeremiedb
Copy link
Contributor

There has been some changes in the makefile since mxnet 1.3.0, maybe that's the root cause.
Could you try to build from the current master (v 1.5.0?) and provide the actual sequence of commands used? I'm puzzled as I just did build the R library on Ubuntu this week from master and it went well except for this small fix #13590 for which a PR is pending.

@hatinder
Copy link
Author

Phew! Finally I manage to get the package built on my virtualbox, still need to get this to my laptop( build crashes on the laptop or probably memory is not enough). I did it from the current master cant find tag 1.5.0 , dont know if its internal for you. Anyway here are the steps I took to get this working.

**
cd incubator-mxnet
mkdir build
mkdir build/Release
cmake -DUSE_CUDA=0 -DUSE_OPENCV=1 -DUSE_BLAS=open -DUSE_LAPACK=1 ../../
make -j$(nproc)
cd ../../docs/install/
./install_mxnet_ubuntu_python.sh
./install_mxnet_ubuntu_r.sh
It failed on the master at first run with following error.

cp: cannot overwrite non-directory 'R-package/inst/include/dmlc' with directory '3rdparty/dmlc-core/include/dmlc'
Makefile:583: recipe for target 'rpkg' failed
But after I applied the changes in the fix #13590 it worked here is the last line.

DONE (mxnet)
Done! MXNet for R installation is complete. Go ahead and explore MXNet with R :-)
**

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants