作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我通过 CRAN 在我的 Mac 上安装了 R .我也通过 homebrew 安装了 openblas .我可以按如下方式在 BLAS 实现之间切换:
引用 blas(我认为是 netlib):
ln -sf /Library/Frameworks/R.framework/Resources/lib/libRblas.0.dylib /Library/Frameworks/R.framework/Resources/lib/libRblas.dylib
ln -sf /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Versions/Current/libBLAS.dylib /Library/Frameworks/R.framework/Resources/lib/libRblas.dylib
brew link openblas --force
ln -sf /usr/local/lib/libopenblas.dylib /Library/Frameworks/R.framework/Resources/lib/libRblas.dylib
/Developer/NVIDIA/
并将其中一些链接到
/usr/local/cuda
.我在
~/.profile
中设置了我的 cuda 环境变量:
export PATH="/usr/local/cuda/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/cuda/lib:$LD_LIBRARY_PATH"
export CUDA_ROOT="/usr/local/cuda/bin"
export CUDA_HOME="/usr/local/cuda"
export NVBLAS_CONFIG_FILE="/Users/me/nvblas.conf"
NVBLAS_CPU_BLAS_LIB /usr/local/lib/libopenblas.dylib
NVBLAS_GPU_LIST ALL0
NVBLAS_TILE_DIM 2048
NVBLAS_AUTOPIN_MEM_ENABLED
nvblas.dylib
返回
libopenblas.dylib
对于不包含在
nvblas.dylib
中的 BLAS 函数.
nvblas.dylib
:
ln -sf /usr/local/cuda/lib/libnvblas.dylib /Library/Frameworks/R.framework/Resources/lib/libRblas.dylib
libRlapack.dylib
找不到它要查找的所有 BLAS 函数:
me:~ me$ R
[NVBLAS] Using devices :0
[NVBLAS] Config parsed
R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin13.4.0 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/Library/Frameworks/R.framework/Versions/3.1/Resources/library/stats/libs/stats.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.1/Resources/library/stats/libs/stats.so, 6): Symbol not found: _dasum_
Referenced from: /Library/Frameworks/R.framework/Versions/3.1/Resources/lib/libRlapack.dylib
Expected in: /Library/Frameworks/R.framework/Versions/3.1/Resources/lib/libRblas.dylib
in /Library/Frameworks/R.framework/Versions/3.1/Resources/lib/libRlapack.dylib
During startup - Warning message:
package ‘stats’ in options("defaultPackages") was not found
libnvblas.dylib
没有正确回退到
libopenblas.dylib
.
libnvblas.dylib
在(netlib、vecLib、openblas)。谁能帮我解决这个错误?还有什么我需要添加到我的路径或链接中才能获得
libnvblas.dylib
在 Mac 上正确使用 R 吗?
Symbol not found: _dasum_
Referenced from: /Library/Frameworks/R.framework/Versions/3.1/Resources/lib/libRlapack.dylib
Expected in: /Library/Frameworks/R.framework/Versions/3.1/Resources/lib/libRblas.dylib
_dasum_
打开blas。
otool -L /Library/Frameworks/R.framework/Resources/lib/libRblas.dylib
/Library/Frameworks/R.framework/Resources/lib/libRblas.dylib:
@rpath/libnvblas.6.5.dylib (compatibility version 0.0.0, current version 6.5.14)
@rpath/libcublas.6.5.dylib (compatibility version 0.0.0, current version 6.5.14)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 635.21.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
最佳答案
我和你有同样的问题。在 OSX 下覆盖库而不是替换 R.framework 中的库为我解决了这个问题:
$ DYLD_FORCE_FLAT_NAMESPACE=y DYLD_INSERT_LIBRARIES=/Developer/NVIDIA/CUDA-7.0/lib/libnvblas.7.0.dylib R
关于R 和 nvblas.dynlib(在 Mac 上),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28179093/
TLDR; for the ones that wants to avoid reading the whole story: Is there a way to interface RcppArma
我已经使用 NVBLAS 编译了 jBLAS,解决方案有点老套,因为配置脚本没有正确找到库。我像这样手动编辑了 jBLAS 的 configure.out 文件,以包含 NVBLAS 库。 BUILD
我通过 CRAN 在我的 Mac 上安装了 R .我也通过 homebrew 安装了 openblas .我可以按如下方式在 BLAS 实现之间切换: 引用 blas(我认为是 netlib): ln
我是一名优秀的程序员,十分优秀!