From bc81ddca3b9f76a64451ba45a039119244e0f9c9 Mon Sep 17 00:00:00 2001 From: Greg Lin Date: Mon, 19 Aug 2024 17:57:51 -0500 Subject: [PATCH 1/2] Fix BLAS portability issues with Ubuntu 20.04 R builds --- builder/Dockerfile.ubuntu-2004 | 2 +- builder/Dockerfile.ubuntu-2404 | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/builder/Dockerfile.ubuntu-2004 b/builder/Dockerfile.ubuntu-2004 index bbade7a..69c248f 100644 --- a/builder/Dockerfile.ubuntu-2004 +++ b/builder/Dockerfile.ubuntu-2004 @@ -6,7 +6,7 @@ RUN set -x \ && sed -i "s|# deb-src|deb-src|g" /etc/apt/sources.list \ && export DEBIAN_FRONTEND=noninteractive \ && apt-get update \ - && apt-get install -y curl libopenblas-dev libcurl4-openssl-dev libicu-dev liblapack-dev libpcre2-dev wget python3-pip \ + && apt-get install -y curl libopenblas0-pthread libcurl4-openssl-dev libicu-dev liblapack-dev libpcre2-dev wget python3-pip \ && apt-get build-dep -y r-base RUN pip3 install awscli diff --git a/builder/Dockerfile.ubuntu-2404 b/builder/Dockerfile.ubuntu-2404 index d5bbdf8..446d7e8 100644 --- a/builder/Dockerfile.ubuntu-2404 +++ b/builder/Dockerfile.ubuntu-2404 @@ -6,6 +6,13 @@ RUN set -x \ && sed -i "s|Types: deb|Types: deb deb-src|g" /etc/apt/sources.list.d/ubuntu.sources \ && export DEBIAN_FRONTEND=noninteractive \ && apt update \ + # For BLAS/LAPACK, select the library-only OpenBLAS package that gets included in the + # the libopenblas-dev package by default. Usually this is OpenBLAS with pthreads. + # + # Note that libopenblas-dev must NOT be installed to ensure that R links to BLAS in a + # portable way, via the generic libblas.so provided by the libblas-dev package. + # This gets installed through the r-base build dependencies. If both libblas-dev and + # libopenblas-dev are present, R will prefer linking to OpenBLAS. && apt install -y curl libcurl4-openssl-dev libicu-dev libopenblas0-pthread libpcre2-dev libpcre3-dev unzip wget \ && apt build-dep -y r-base From 51c710b727cb5c5de687605e9693c3bf7264cf21 Mon Sep 17 00:00:00 2001 From: Greg Lin Date: Wed, 21 Aug 2024 13:38:22 -0500 Subject: [PATCH 2/2] Use more specific libopenblas0-pthread package in Debian 12 image --- builder/Dockerfile.debian-12 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/Dockerfile.debian-12 b/builder/Dockerfile.debian-12 index f5f4d2b..89846b7 100644 --- a/builder/Dockerfile.debian-12 +++ b/builder/Dockerfile.debian-12 @@ -7,7 +7,7 @@ RUN set -x \ && echo 'deb-src http://deb.debian.org/debian bookworm main' >> /etc/apt/sources.list \ && apt-get update \ && apt-get install -y curl gcc libcurl4-openssl-dev libicu-dev \ - libopenblas0 libpcre2-dev make unzip wget \ + libopenblas0-pthread libpcre2-dev make unzip wget \ && apt-get build-dep -y r-base # Install AWS CLI