当我试图安装某些需要libRblas.so
的软件包(libRblas.so
)时,AFAIK指的是OpenBLAS,我得到了一个错误,没有找到它:
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/jay/R/x86_64-pc-linux-gnu-library/4.2/fracdiff/libs/fracdiff.so':
libRblas.so: cannot open shared object file: No such file or directory
Calls: <Anonymous> ... asNamespace -> loadNamespace -> library.dynam -> dyn.load
Execution halted
然而,sessionInfo()
表示,R实际上找到了它。
> sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so
我从这条线那里了解到,“可能.构建了另一个版本的R,它位于打包版本之前的. $PATH中”,这很可能是这样的;我以前的R版本4.2.0
是一个自编的版本,我通过再次下载源代码和./configure
- make uninstall
删除了它。不过,这个是通过sudo apt install r-base-core
安装的。可能现在某处有一片混乱。不幸的是,引用的线程被不同地解决了,我现在正在寻找各自的结论。
以下是更多信息:
whereis R
给出
~$ whereis R
R: /usr/bin/R /usr/lib/R /usr/lib64/R /etc/R /usr/local/lib/R /usr/share/R /usr/share/man/man1/R.1.gz
在错误消息中的各个文件中,使用sudo find ~ -name '<file>'
找到了fracdiff.so
,而没有找到libRblas.so
。
~/R/x86_64-pc-linux-gnu-library/4.2/fracdiff/libs/fracdiff.so
我已经试过了
~$ sudo apt install libopenblas-dev
但很明显它已经安装好了。
libopenblas-dev is already the newest version (0.3.20+ds-1).
遵循这、libRlapack.so
和libRblas.so
的建议,在我的系统中显然不存在,而另一个建议只是给出:
~$ sudo update-alternatives --config libblas.so
update-alternatives: error: no alternatives for libblas.so
发布于 2022-07-13 12:50:07
libRblas.so
永远不应该有“需求”。简而言之,R允许您使用它发送的BLAS和LAPACK (子集)资源进行构建,然后您将得到这个libRblas.so
。或者您可以使用系统BLAS和LAPACK库,我负责的Debian (因此也是Ubuntu)包可能已经使用了近20年,它允许您切换BLAS安装(Atlas、OpenBLAS、MKL,回到当时的Goto,.)。
作为一个演示,我刚刚推出了一个适合的基于r2u的Ubuntu22.04码头容器,因为它结合了R预制作(使用我的r-base-core
包和外部BLAS链接)以及(太棒了!)能够将所有CRAN作为Ubuntu二进制文件(更多信息请参见r2u )。简言之:
edd@rob:~$ docker run --rm -ti --security-opt seccomp=unconfined eddelbuettel/r2u:jammy
root@818091e49861:/# export PS1="root@r2u_docker:\w# "
root@r2u_docker:/# echo "192.168.1.114 dirk.eddelbuettel.com" >> /etc/hosts
root@r2u_docker:/# install.r imputeTS ## one command !!
Install system packages as root...
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Ign https://dirk.eddelbuettel.com/cranapt jammy InRelease
Hit https://dirk.eddelbuettel.com/cranapt jammy Release
Hit http://archive.ubuntu.com/ubuntu jammy InRelease
Hit http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit http://security.ubuntu.com/ubuntu jammy-security InRelease
Get:1 https://ppa.launchpadcontent.net/marutter/rrutter4.0/ubuntu jammy InRelease [17.5 kB]
Fetched 17.5 kB in 0s (0 B/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Get:1 https://dirk.eddelbuettel.com/cranapt jammy/main amd64 r-cran-bitops amd64 1.0-7-1.ca2204.1 [25.5 kB]
Get:2 https://dirk.eddelbuettel.com/cranapt jammy/main amd64 r-cran-glue amd64 1.6.2-1.ca2204.1 [143 kB]
[... cutting here to satisfy SO quote limit ...]
Setting up r-cran-forecast (8.16-1.ca2204.1) ...
Setting up r-cran-imputets (3.2-1.ca2204.1) ...
root@r2u_docker:/#
在此之后,我们确实可以启动R并加载它:
root@r2u_docker:/# R
R version 4.2.1 (2022-06-23) -- "Funny-Looking Kid"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (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.
> library(imputeTS)
Registered S3 method overwritten by 'quantmod':
method from
as.zoo.data.frame zoo
>
它使用外部BLAS/LAPACK“按设计”:
root@r2u_docker:/# dpkg -l | grep -i "blas\|lapack" | cut -c-90
ii libblas-dev:amd64 3.10.0-2ubuntu1 amd64 Basi
ii libblas3:amd64 3.10.0-2ubuntu1 amd64 Basi
ii liblapack-dev:amd64 3.10.0-2ubuntu1 amd64 Libr
ii liblapack3:amd64 3.10.0-2ubuntu1 amd64 Libr
root@r2u_docker:/#
因此,我认为这可能是由您可能在本地编译了R,加上imputeTS
没有很好地处理这个问题(应该,它可能是一个bug)的组合造成的。但我希望这也能说明这件事也容易得多。
如果您有更详细的后续问题,请来到r-sig-debian
列表,这是友好,没有感觉和低音量。
PS表示完全,容器的sessionInfo()
在一个新的会话:
> sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices datasets utils methods base
loaded via a namespace (and not attached):
[1] compiler_4.2.1 bspm_0.3.9
>
在一个动画的gif中,PPS 'live‘演示是在这条推特 (推特上,因为你不能在这里附加gifs超过2mb )。
https://stackoverflow.com/questions/72966093
复制相似问题