1 # Make an image that has the dependencies for building GROMACS with clang.
2 # Note when specifying TOOL_VERSION that clang 6.0 packages use the minor version
3 # in the name, while 7 and 8 do not.
9 apt_version=$TOOL_VERSION && \
10 if [ "$TOOL_VERSION" -lt "7" ] ; then apt_version="$apt_version.0"; fi && \
11 apt-get -y -q=2 --no-install-suggests --no-install-recommends install \
13 software-properties-common \
15 wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
16 apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-$apt_version main" && \
17 apt-get -qq update && \
18 apt-get -qqy --no-install-suggests --no-install-recommends install \
19 clang++-$apt_version \
20 clang-tools-$apt_version \
22 if [ "$apt_version" != "$TOOL_VERSION" ] ; then \
23 ln -s /usr/bin/clang-$apt_version /usr/bin/clang-$TOOL_VERSION; \
24 ln -s /usr/bin/clang++-$apt_version /usr/bin/clang++-$TOOL_VERSION; \
25 ln -s /usr/bin/clang-format-$apt_version /usr/bin/clang-format-$TOOL_VERSION; \
26 ln -s /usr/bin/clang-tidy-$apt_version /usr/bin/clang-tidy-$TOOL_VERSION; fi && \
27 rm -rf /var/lib/apt/lists/* && \
28 rm -rf /var/cache/apt/archives/*