Skip to content

Commit

Permalink
[Docker] Fix the docker build by bumping CMake version in Dockerfile (t…
Browse files Browse the repository at this point in the history
…aichi-dev#2348)

* Build CMake from source than relying on the default version shipped with Ubuntu LTS.

* Add a missing ENV VAR TI_IN_DOCKER.
  • Loading branch information
rexwangcc authored May 16, 2021
1 parent 07de54f commit 590078c
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ RUN apt-get update && \
python3-pip \
libtinfo-dev \
clang-8 \
cmake \
wget \
git \
libx11-dev \
Expand All @@ -22,14 +21,27 @@ RUN apt-get update && \
libglu1-mesa-dev \
freeglut3-dev \
mesa-common-dev \
libtinfo5
libtinfo5 \
build-essential \
libssl-dev

# Install Taichi's Python dependencies
RUN python3 -m pip install --user setuptools astor pybind11 pylint sourceinspect
RUN python3 -m pip install --user pytest pytest-rerunfailures pytest-xdist yapf
RUN python3 -m pip install --user numpy GitPython coverage colorama autograd

# Install the latest version of CMAKE v3.20.2 from source
RUN apt purge --auto-remove cmake
RUN wget https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2.tar.gz
RUN tar -zxvf cmake-3.20.2.tar.gz
RUN cd cmake-3.20.2
WORKDIR /cmake-3.20.2
RUN ./bootstrap
RUN make -j 8
RUN make install

# Intall LLVM 10
WORKDIR /
ENV CC=/usr/bin/clang-8
ENV CXX=/usr/bin/clang++-8
RUN wget https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/llvm-10.0.0.src.tar.xz
Expand All @@ -56,5 +68,7 @@ ENV TAICHI_REPO_DIR="/taichi-dev/taichi/"
ENV PYTHONPATH="$TAICHI_REPO_DIR/python:$PYTHONPATH"
ENV LANG="C.UTF-8"

# Add Docker specific ENV
ENV TI_IN_DOCKER=true
WORKDIR /taichi-dev/taichi
CMD /bin/bash

0 comments on commit 590078c

Please sign in to comment.