在MAC上为R安装MXnet

时间:2019-02-18 11:31:32

标签: r macos mxnet

我看到以前曾有人问过这个问题,但是似乎没有一种解决方案对我有用。

我正在尝试在Mac OS Mojave 10.14.3版本R上安装mxnet。但是我无法使其正常工作。

我按照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): Library not loaded: /usr/local/opt/openblas/lib/libopenblasp-r0.3.1.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/mxnet/libs/libmxnet.so
  Reason: image not found 

我尝试使用以下方式为openBlas添加软链接:

ln -sf /usr/local/opt/openblas/lib/libopenblasp-r0.3.* /usr/local/opt/openblas/lib/libopenblasp-r0.3.1.dylib

但是没有用。当我在R中运行sessioninfo()时,这是我得到的输出:

> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS  10.14.3

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_IE.UTF-8/en_IE.UTF-8/en_IE.UTF-8/C/en_IE.UTF-8/en_IE.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods  
[7] base     

other attached packages:
[1] usethis_1.4.0  devtools_2.0.1

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.0         tidyr_0.8.1        prettyunits_1.0.2 
 [4] ps_1.1.0           visNetwork_2.0.5   assertthat_0.2.0  
 [7] rprojroot_1.3-2    digest_0.6.18      R6_2.3.0          
[10] plyr_1.8.4         backports_1.1.2    ggplot2_3.0.0     
[13] pillar_1.3.1       rlang_0.3.1        lazyeval_0.2.1    
[16] rstudioapi_0.8     callr_3.0.0        DiagrammeR_1.0.0  
[19] desc_1.2.0         downloader_0.4     readr_1.3.1       
[22] stringr_1.3.1      htmlwidgets_1.3    igraph_1.2.2      
[25] munsell_0.5.0      compiler_3.5.1     influenceR_0.1.0  
[28] rgexf_0.15.3       pkgconfig_2.0.2    base64enc_0.1-3   
[31] pkgbuild_1.0.2     htmltools_0.3.6    tidyselect_0.2.4  
[34] tibble_2.0.1       gridExtra_2.3      XML_3.98-1.16     
[37] viridisLite_0.3.0  crayon_1.3.4       dplyr_0.7.6       
[40] withr_2.1.2        grid_3.5.1         jsonlite_1.6      
[43] gtable_0.2.0       magrittr_1.5       scales_1.0.0      
[46] cli_1.0.1          stringi_1.2.4      fs_1.2.6          
[49] remotes_2.0.2      viridis_0.5.1      testthat_2.0.1    
[52] bindrcpp_0.2.2     brew_1.0-6         RColorBrewer_1.1-2
[55] tools_3.5.1        glue_1.3.0         purrr_0.2.5       
[58] hms_0.4.2          Rook_1.1-1         processx_3.2.0    
[61] pkgload_1.0.2      yaml_2.2.0         colorspace_1.3-2  
[64] sessioninfo_1.1.1  memoise_1.1.0      bindr_0.1.1  

关于如何解决此问题的任何建议?

0 个答案:

没有答案