diff --git a/docker/Dockerfile.llvm-project b/docker/Dockerfile.llvm-project index 63d2565cf3..0dc3e44884 100644 --- a/docker/Dockerfile.llvm-project +++ b/docker/Dockerfile.llvm-project @@ -28,8 +28,8 @@ RUN distro=$(cat /etc/os-release|grep -Po '(?<=^ID=").*(?=")|(?<=^ID=)[^"].*[^"] ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime && \ dpkg-reconfigure -f noninteractive tzdata && \ apt-get install -qq -y --no-install-recommends \ - autoconf automake ca-certificates cmake cppcheck curl \ - default-jdk-headless gcc g++ git libncurses-dev \ + autoconf automake ca-certificates clang cmake cppcheck \ + curl default-jdk-headless gcc g++ git libncurses-dev \ libtool make maven ninja-build openjdk-11-jdk-headless \ python3 python3-dev python3-distutils python3-numpy \ python3-pip python3-pytest-xdist python3-setuptools \ @@ -44,7 +44,7 @@ RUN distro=$(cat /etc/os-release|grep -Po '(?<=^ID=").*(?=")|(?<=^ID=)[^"].*[^"] https://dl.fedoraproject.org/pub/epel/epel-release-latest-${RHEL_VERSION}.noarch.rpm && \ yum update -q -y && \ yum install -q -y \ - autoconf automake ca-certificates cmake diffutils \ + autoconf automake ca-certificates clang cmake diffutils \ file java-11-openjdk-devel java-11-openjdk-headless \ gcc gcc-c++ git libtool make ncurses-devel \ python39 python39-devel python39-numpy python39-pip \ @@ -84,7 +84,9 @@ RUN git clone -n https://github.com/llvm/llvm-project.git \ && cd llvm-project \ && git checkout ${LLVM_PROJECT_SHA1} \ && mkdir -p build && cd build \ - && cmake -G Ninja ../llvm \ +# Build with clang since gcc on ppc64le doesn't support __builtin_thread_pointer + && CC=clang CXX=clang++ \ + cmake -G Ninja ../llvm \ -DLLVM_ENABLE_PROJECTS=mlir \ -DLLVM_TARGETS_TO_BUILD="host" \ -DCMAKE_BUILD_TYPE=Release \ diff --git a/docker/Dockerfile.onnx-mlir b/docker/Dockerfile.onnx-mlir index 37594a8122..415805f341 100644 --- a/docker/Dockerfile.onnx-mlir +++ b/docker/Dockerfile.onnx-mlir @@ -40,7 +40,8 @@ RUN LLVM_PROJECT_ROOT=${WORK_DIR}/llvm-project \ && rm -rf build && mkdir -p build && cd build \ # NNPA acclerator is built on all archs to enable lit tests # (dependent libzdnn is built on s390x only) - && cmake -DMLIR_DIR=${LLVM_PROJECT_ROOT}/build/lib/cmake/mlir \ + && CC=clang CXX=clang++ \ + cmake -DMLIR_DIR=${LLVM_PROJECT_ROOT}/build/lib/cmake/mlir \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_MESSAGE=NEVER \ -DONNX_MLIR_ACCELERATORS=${ACCEL} .. \ @@ -79,8 +80,8 @@ RUN LLVM_PROJECT_ROOT=${WORK_DIR}/llvm-project \ pip3 uninstall -q -y Cython pybind11 pytest pytest-forked \ pytest-xdist typing-extensions && \ yum remove -q -y \ - adwaita-icon-theme autoconf automake cmake diffutils file \ - git libtool make python39 && \ + adwaita-icon-theme autoconf automake cmake file \ + git libtool python39 && \ rm -rf /var/cache/dnf/* /usr/local/bin/ninja; \ fi \ && rm -rf /tmp/* /usr/bin/python \ diff --git a/docker/Dockerfile.onnx-mlir-dev b/docker/Dockerfile.onnx-mlir-dev index b3c63ce747..e8d5dddd45 100644 --- a/docker/Dockerfile.onnx-mlir-dev +++ b/docker/Dockerfile.onnx-mlir-dev @@ -29,7 +29,8 @@ RUN LLVM_PROJECT_ROOT=${WORK_DIR}/llvm-project \ && rm -rf build && mkdir -p build && cd build \ # NNPA acclerator is built on all archs to enable lit tests # (dependent libzdnn is built on s390x only) - && cmake -DMLIR_DIR=${LLVM_PROJECT_ROOT}/build/lib/cmake/mlir \ + && CC=clang CXX=clang++ \ + cmake -DMLIR_DIR=${LLVM_PROJECT_ROOT}/build/lib/cmake/mlir \ -DCMAKE_BUILD_TYPE=Debug \ -DONNX_MLIR_TEST_OPTLEVEL=0 \ -DONNX_MLIR_ACCELERATORS=${ACCEL} .. \