1
0
Fork 0

Docker build toolchain working

This commit is contained in:
Christian Kühnel 2020-03-19 14:20:33 +01:00
parent 5f2b26d44c
commit f182e84f1a
2 changed files with 30 additions and 0 deletions

View file

@ -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

View file

@ -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