[skip e2e] optimize openblas compile in pod (#19202)

Signed-off-by: Yusheng.Ma <Yusheng.Ma@zilliz.com>

Signed-off-by: Yusheng.Ma <Yusheng.Ma@zilliz.com>
This commit is contained in:
presburger 2022-09-14 21:28:35 +08:00 committed by GitHub
parent 39814e0bbf
commit 179ea77e6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,15 +7,16 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends wget ca-certificates gnupg2 && \
apt-get update && apt-get install -y --no-install-recommends g++ gcc gfortran git make && \
apt-get update && apt-get install -y --no-install-recommends g++ gcc gfortran git make liblapack-dev && \
apt-get remove --purge -y && \
rm -rf /var/lib/apt/lists/* && \
wget https://github.com/xianyi/OpenBLAS/archive/v0.3.21.tar.gz && \
tar zxvf v0.3.21.tar.gz && cd OpenBLAS-0.3.21 && \
make NO_STATIC=1 NO_LAPACK=1 NO_LAPACKE=1 NO_CBLAS=1 NO_AFFINITY=1 USE_OPENMP=1 \
CFLAGS="-O3 -fPIC" TARGET=CORE2 DYNAMIC_ARCH=1 \
NUM_THREADS=64 MAJOR_VERSION=3 libs shared &&\
make -j4 PREFIX=/usr NO_STATIC=1 install && \
TARGET=HASWELL DYNAMIC_ARCH=1 \
NUM_THREADS=64 MAJOR_VERSION=3 libs shared && \
make PREFIX=/usr/local NUM_THREADS=64 MAJOR_VERSION=3 install && \
rm -f /usr/local/include/cblas.h /usr/local/include/lapack* && \
cd .. && rm -rf OpenBLAS-0.3.21 && rm v0.3.21.tar.gz
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib"