Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing dmlc/base.h problem when installing R package #144

Closed
mick001 opened this issue Jul 5, 2016 · 13 comments

Comments

@mick001
Copy link

commented Jul 5, 2016

Hi, I am trying to install mxnet package for R on Ubuntu 16.04 LTS. However I am running into an issue.

These are the steps I took:

  1. Type in the terminal:

sudo apt-get install -y build-essential git libatlas-base-dev libopencv-dev git clone --recursive https://github.com/dmlc/mxnet cd mxnet; make -j$(nproc)

  1. Then build and install the R package

R CMD BUILD R-package/ R CMD INSTALL mxnet_0.7.tar.gz

But when running install I get the following error

* installing to library ‘/home/mich/R/x86_64-pc-linux-gnu-library/3.2’
* installing *source* package ‘mxnet’ ...
** libs
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include  -I"/home/mich/R/x86_64-pc-linux-gnu-library/3.2/Rcpp/include"   -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c executor.cc -o executor.o
In file included from executor.cc:9:0:
./base.h:12:23: fatal error: dmlc/base.h: No such file or directory
compilation terminated.
/usr/lib/R/etc/Makeconf:141: recipe for target 'executor.o' failed
make: *** [executor.o] Error 1
ERROR: compilation failed for package ‘mxnet’
* removing ‘/home/mich/R/x86_64-pc-linux-gnu-library/3.2/mxnet’

Am I missing something?
Thanks





@mick001 mick001 changed the title Missing dmlc/base.h Missing dmlc/base.h problem when installing R package Jul 5, 2016

@tqchen

This comment has been minimized.

Copy link
Member

commented Jul 6, 2016

@thirdwing

This comment has been minimized.

Copy link
Member

commented Jul 7, 2016

I think you missed make rpkg.

@harryprince

This comment has been minimized.

Copy link

commented Jul 11, 2016

@thirdwing It works for me at Ubuntu 14.04

@harryprince

This comment has been minimized.

Copy link

commented Jul 11, 2016

the official R installation tutorial is outdated with the download website bug.
However, the right way to install is (My environment host OS is Ubuntu 14.04, I recommend you using the Docker way)

git clone --recursive https://github.com/dmlc/mxnet
cd mxnet; make -j$(nproc)
make rpkg

if you don't install roxygen2, you need to run

install.packages("roxygen2")

and then run

make rpkg

which will give you a great mxnet package:mxnet_0.7.tar.gz.

Now, you can run

R CMD INSTALL mxnet_0.7.tar.gz

you will see

** R
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (mxnet)
@thirdwing

This comment has been minimized.

Copy link
Member

commented Jul 11, 2016

The instruction is correct. These lines below are used to install all the dependencies including roxygen2.

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)"
@mick001

This comment has been minimized.

Copy link
Author

commented Jul 11, 2016

@thirdwing ops, my bad, it worked! Thank you for your help!

@thengl

This comment has been minimized.

Copy link

commented Nov 9, 2016

I'm getting the following error:

make rpkg
Rscript -e "require(roxygen2); roxygen2::roxygenise(\"R-package\")"
/usr/local/lib/R/bin/exec/R: error while loading shared libraries: libRblas.so: cannot open shared object file: No such file or directory
Makefile:250: recipe for target 'roxygen' failed
make: *** [roxygen] Error 127

I've managed yesterday to install mxnet on one ubunut 16.4 system, now having more difficulties. Package installation is definitively a cumbersome (might have to turn back to h2o on the end) considering all dependencies etc.

@thirdwing

This comment has been minimized.

Copy link
Member

commented Nov 9, 2016

The error message you provide means there is an error in your R
installation. Nothing related to mxnnet.

Please check your R installation, especially the blas installation.

Best wishes,

KK

On 11/09/2016 06:43 AM, Tomislav Hengl wrote:

I'm getting the following error:

|make rpkg Rscript -e "require(roxygen2);
roxygen2::roxygenise("R-package")" /usr/local/lib/R/bin/exec/R:
error while loading shared libraries: libRblas.so: cannot open shared
object file: No such file or directory Makefile:250: recipe for target
'roxygen' failed make: *** [roxygen] Error 127 |

I've managed yesterday to install mxnet on one ubunut 16.4 system, now
having more difficulties. Package installation is definitively a
cumbersome (might have to turn back to h2o on the end) considering all
dependencies etc.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#144 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABebVd00RlNGz_uXjDblVWP6iVQgvLLlks5q8bHUgaJpZM4JFf1Y.

@thengl

This comment has been minimized.

Copy link

commented Nov 9, 2016

I am using MRO installation for ubuntu, but it could be that something went wrong. I have just re-installed MRO, and now I get problems with im2rec when I run:

git clone --recursive https://github.com/dmlc/mxnet
cd mxnet; make -j4

I get:

collect2: error: ld returned 1 exit status
Makefile:227: recipe for target 'bin/im2rec' failed
make: *** [bin/im2rec] Error 1

I have installed CUDA and all other libraries required.

@thirdwing

This comment has been minimized.

Copy link
Member

commented Nov 10, 2016

I think you met the error in opencv part.

Can you disable opencv for now?

@thengl

This comment has been minimized.

Copy link

commented Nov 11, 2016

OK, I have managed to install it (and yes looks like I had an old R installation somewhere hidden). My first problem was that my Rscript looked for some older installation (which had broken links to libraries):

locate Rscript
/home/src/R-3.2.3/bin/Rscript
/home/src/R-3.2.3/doc/Rscript.1
/home/src/R-3.2.3/src/gnuwin32/front-ends/Rscript.exe.manifest
/home/src/R-3.2.3/src/gnuwin32/front-ends/Rscript64.exe.manifest
/home/src/R-3.2.3/src/library/utils/man/Rscript.Rd
/home/src/R-3.2.3/src/unix/Rscript
/home/src/R-3.2.3/src/unix/Rscript.c
/usr/bin/Rscript
/usr/lib64/microsoft-r/3.3/lib64/R/bin/Rscript
/usr/lib64/microsoft-r/3.3/share/man/man1/Rscript.1
/usr/local/bin/Rscript
/usr/local/lib/R/bin/Rscript
/usr/local/share/man/man1/Rscript.1

and that is why the make rpkg did not want to run (error from above). Need to clean up my server obviously.

Finally, I've run your rpkg function code by code:

:~/MXNet/mxnet$ mkdir -p R-package/inst
:~/MXNet/mxnet$ mkdir -p R-package/inst/libs
:~/MXNet/mxnet$ cp -rf lib/libmxnet.so R-package/inst/libs
:~/MXNet/mxnet$ mkdir -p R-package/inst/include
:~/MXNet/mxnet$ cp -rf include/* R-package/inst/include
:~/MXNet/mxnet$ cp -rf dmlc-core/include/* R-package/inst/include/
:~/MXNet/mxnet$ R CMD build --no-build-vignettes R-package

and the installation was finally successful. Now I only have to test whether it is automatically parallelized to all cores... Thank you very much for your help and for your package!

@thirdwing

This comment has been minimized.

Copy link
Member

commented Nov 11, 2016

It should run in parallel if you open the openmp support when compiling.

@thengl

This comment has been minimized.

Copy link

commented Nov 12, 2016

RE "if you open the openmp support when compiling" I am not sure how to do that from R. I assume that having the USE_OPENMP = 1 in the config.mk would do the trick? I also use ranger package for my data analysis, but this runs automatically in parallel (very efficient). OK will test and come back if I have more questions. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.