Skip to content

Commit

Permalink
Dockerfile: Properly build cvxopt on arm64
Browse files Browse the repository at this point in the history
This Augur dependency has pre-built binaries for amd64, but does not for
arm64. Building requires additional system deps and a special
environment variable when built via `pip install`.
  • Loading branch information
victorlin committed Dec 6, 2022
1 parent b431b54 commit d0a8bfe
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,27 @@ RUN curl -fsSL https://github.com/lh3/minimap2/releases/download/v2.24/minimap2-

# 3. Install programs via pip

# Build cvxopt on linux/arm64
# cvxopt, an Augur dependency, does not have pre-built binaries for linux/arm64.
#
# First, add system deps for building¹:
# - libopenblas-dev: Contains optimized versions of BLAS and LAPACK.
# - libsuitesparse-dev: Contains SuiteSparse.
#
# Then, "install" (build) separately since the process requires a special
# environment variable².
#
# ¹ https://cvxopt.org/install/#building-and-installing-from-source
# ² https://github.com/cvxopt/cvxopt/issues/125#issuecomment-407396491
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
apt-get update && apt-get install -y --no-install-recommends \
libopenblas-dev \
libsuitesparse-dev \
&& CVXOPT_SUITESPARSE_INC_DIR=/usr/include/suitesparse \
pip3 install cvxopt \
; \
fi

# Install envdir, which is used by pathogen builds
RUN pip3 install envdir==1.0.1

Expand Down

0 comments on commit d0a8bfe

Please sign in to comment.