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 2019/02/26 03:00:16 UTC
[GitHub] GengxinXu opened a new issue #14254: MXNET library failing in R
GengxinXu opened a new issue #14254: MXNET library failing in R
URL: https://github.com/apache/incubator-mxnet/issues/14254
I want to install the MXNet package for R.
Firstly, I paste the following command in Mac terminal to install Homebrew:
```
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
```
And then, I insert the Homebrew directory at the top of the PATH environment variable:
```
export PATH=/usr/local/bin:/usr/local/sbin:$PATH`
```
Next, I install OpenCV and OpenBLAS.
```
brew install opencv
brew install openblas
```
In order to check the successful installation. I paste the commands again and it shows:
```
(base) sfdeMacBook-Pro:~ xgx$ brew install opencv
Warning: opencv 4.0.1 is already installed and up-to-date
To reinstall 4.0.1, run `brew reinstall opencv`
(base) sfdeMacBook-Pro:~ xgx$ brew install openblas
Warning: openblas 0.3.5 is already installed and up-to-date
To reinstall 0.3.5, run `brew reinstall openblas`
```
Secondly, I install the latest version of R from CRAN:
```
cran <- getOption("repos")
cran["dmlc"] <- "https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/"
options(repos = cran)
install.packages("mxnet")
```
And it shows:
```
trying URL 'https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/bin/macosx/el-capitan/contrib/3.5/mxnet_1.3.0.tgz
The downloaded binary packages are in ... (I omit the location here)
```
However, when I paste `library(mxnet)`, it shows:
```
Error: package or namespace load failed for ‘mxnet’:
.onLoad failed in loadNamespace() for 'mxnet', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object /Library/Frameworks/R.framework/Versions/3.5/Resources/library/mxnet/libs/libmxnet.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/mxnet/libs/libmxnet.so, 10): Library not loaded: /usr/local/opt/opencv/lib/libopencv_stitching.3.4.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/mxnet/libs/libmxnet.so
Reason: image not found
```
So I add a soft link to the OpenCV installation:
```
ln -sf /usr/local/opt/opencv/lib/libopencv_stitching.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_stitching.3.4.dylib
```
For the other "\**.dylib" (** is the file name) files, I also add links:
```
ln -sf /usr/local/opt/opencv/lib/libopencv_**.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_**.3.4.dylib
```
In addition, to ensure MXNet R package runs with the version of OpenBLAS installed, I create a symbolic link as follows:
```
ln -sf /usr/local/opt/openblas/lib/libopenblasp-r0.3.* /usr/local/opt/openblas/lib/libopenblasp-r0.3.1.dylib
```
Now, when I paste `library(mxnet)`, it shows:
```
library(mxnet)
Error: package or namespace load failed for ‘mxnet’:
.onLoad failed in loadNamespace() for 'mxnet', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/mxnet/libs/libmxnet.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/mxnet/libs/libmxnet.so, 10): Symbol not found: __ZN2cv5errorEiRKNS_6StringEPKcS4_i
Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/mxnet/libs/libmxnet.so
Expected in: /usr/local/opt/opencv/lib/libopencv_core.3.4.dylib
in /Library/Frameworks/R.framework/Versions/3.5/Resources/library/mxnet/libs/libmxnet.so
```
## Description
I cannot library the MXNet package in R.
## Environment info
```
`sessionInfo()`
R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS 10.14.1
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] Rcpp_0.12.18 plyr_1.8.4 pillar_1.3.0 compiler_3.5.1 RColorBrewer_1.1-2 influenceR_0.1.0 bindr_0.1.1
[8] viridis_0.5.1 tools_3.5.1 digest_0.6.17 jsonlite_1.5 viridisLite_0.3.0 gtable_0.2.0 tibble_1.4.2
[15] rgexf_0.15.3 pkgconfig_2.0.2 rlang_0.2.2 igraph_1.2.2 rstudioapi_0.8 bindrcpp_0.2.2 gridExtra_2.3
[22] downloader_0.4 DiagrammeR_1.0.0 dplyr_0.7.6 stringr_1.3.1 htmlwidgets_1.3 hms_0.4.2 grid_3.5.1
[29] tidyselect_0.2.4 glue_1.3.0 R6_2.2.2 Rook_1.1-1 XML_3.98-1.16 readr_1.1.1 purrr_0.2.5
[36] tidyr_0.8.1 ggplot2_3.0.0 magrittr_1.5 scales_1.0.0 htmltools_0.3.6 assertthat_0.2.0 colorspace_1.3-2
[43] brew_1.0-6 stringi_1.2.4 visNetwork_2.0.5 lazyeval_0.2.1 munsell_0.5.0 crayon_1.3.4
```
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services