From f182e84f1afbd931fde9237e2508cf929312f43d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=BChnel?= Date: Thu, 19 Mar 2020 14:20:33 +0100 Subject: [PATCH] Docker build toolchain working --- containers/buildbot-mlir-nvidia/Dockerfile | 21 +++++++++++++++++++++ containers/buildbot-mlir-nvidia/test.sh | 9 +++++++++ 2 files changed, 30 insertions(+) create mode 100644 containers/buildbot-mlir-nvidia/Dockerfile create mode 100755 containers/buildbot-mlir-nvidia/test.sh diff --git a/containers/buildbot-mlir-nvidia/Dockerfile b/containers/buildbot-mlir-nvidia/Dockerfile new file mode 100644 index 0000000..bb27100 --- /dev/null +++ b/containers/buildbot-mlir-nvidia/Dockerfile @@ -0,0 +1,21 @@ +FROM nvidia/cuda:10.2-base + +# install build tools +# set -eux;\ +RUN apt-get update; \ + apt-get install -y cmake clang-8 lld-8 ninja-build python-psutil git wget gnupg;\ + update-alternatives --install /usr/bin/clang clang /usr/bin/clang-8 100 ;\ + update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-8 100 ;\ + update-alternatives --install /usr/bin/lld lld /usr/bin/lld-8 100 + +# just for testing +RUN mkdir /tests ;\ + cd /tests ;\ + git clone --depth 1 https://github.com/llvm/llvm-project + +# install cuda +# avoid popups for keyboard configurations +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y cuda + +COPY test.sh /tests +CMD /tests/test.sh \ No newline at end of file diff --git a/containers/buildbot-mlir-nvidia/test.sh b/containers/buildbot-mlir-nvidia/test.sh new file mode 100755 index 0000000..2e4b883 --- /dev/null +++ b/containers/buildbot-mlir-nvidia/test.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -eux + +cd /tests/llvm-project +mkdir -p build +cd build +cmake -G Ninja ../llvm -DLLVM_BUILD_EXAMPLES=ON -DLLVM_ENABLE_CXX1Y=Y -DLLVM_TARGETS_TO_BUILD="host;NVPTX" -DLLVM_ENABLE_PROJECTS=mlir -DMLIR_CUDA_RUNNER_ENABLED=1 -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc + +cmake --build . --target check-mlir