在 Docker 镜像中切换 R 使用的 BLAS 库

发布于 2025-01-10 17:19:03 字数 1149 浏览 4 评论 0原文

我正在用 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.solibblas.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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我偏爱纯白色 2025-01-17 17:19:03

问题出在基础镜像上。只能使用 rocker/r-base 映像更改 BLAS 包。

The problem was the base image. Changing the BLAS package is only possible using the rocker/r-base image.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文