在 Docker 镜像中切换 R 使用的 BLAS 库
我正在用 R 开发一个 Web 应用程序。它应该在 Docker 容器中运行。由于我使用 affy 包的 RMA 方法,因此我必须使用 0.3.3 之前版本的 libopenblas 或另一个 BLAS 库(请参阅 https://support.bioconductor.org/p/117119/)。
目前我正在尝试使用 atlas 而不是 openblas。我的 Docker 映像基于 rocker/shiny 映像 (https://hub.docker.com/ r/摇杆/闪亮)。以下内容用作标准 BLAS 包:
R version 4.0.5 (2021-03-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.4 LTS
Matrix products: default
BLAS/LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.8.so
我在 Dockerfile 中使用了 update-alternatives 脚本来更改默认的 BLAS 包:
update-alternatives --install /usr/lib/x86_64-linux-gnu/libopenblas.so libopenblas.so-x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/atlas/libblas.so 150
我还尝试了路径的不同变体,例如更新 libopenblas.so.3< /code> 或
libblas.so
或 libblas.so.3
。 docker 镜像的可执行文件是通过 CMD ["Rscript", "run.R"] 定义的。
不幸的是,所使用的 BLAS 库从未改变。 sessionInfo()
的输出保持如上指定。
I am developing a web application in R. It is supposed to run in a Docker container. Since I use the RMA method of the affy package, I have to use either libopenblas in a version earlier than 0.3.3, or another BLAS library (see https://support.bioconductor.org/p/117119/).
Currently I am trying to use atlas instead of openblas. My Docker image is based on the rocker/shiny image (https://hub.docker.com/r/rocker/shiny). The following is used as the standard BLAS package:
R version 4.0.5 (2021-03-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.4 LTS
Matrix products: default
BLAS/LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.8.so
I used the update-alternatives script in the Dockerfile in order to change the default BLAS package:
update-alternatives --install /usr/lib/x86_64-linux-gnu/libopenblas.so libopenblas.so-x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/atlas/libblas.so 150
I also tried different variations of the paths, e.g. updating for libopenblas.so.3
or libblas.so
or libblas.so.3
.
The executable of the docker image is defined via CMD ["Rscript", "run.R"]
.
Unfortunately, the used BLAS library is never changed. The output of sessionInfo()
remains as specified above.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题出在基础镜像上。只能使用 rocker/r-base 映像更改 BLAS 包。
The problem was the base image. Changing the BLAS package is only possible using the rocker/r-base image.