From 4b87d2c172bc77ca67a674009e48e3eb30cc155a Mon Sep 17 00:00:00 2001 From: Edward Chen <18449977+edgchen1@users.noreply.github.com> Date: Mon, 24 Jan 2022 19:06:09 -0800 Subject: [PATCH] Fix dockerfiles/Dockerfile.arm32v7 build. (#10360) Install CMake, ignore some Eigen warnings. --- dockerfiles/Dockerfile.arm32v7 | 6 +++--- dockerfiles/scripts/install_fedora_arm32.sh | 4 +++- include/onnxruntime/core/common/eigen_common_wrapper.h | 7 +++++++ .../core/platform/EigenNonBlockingThreadPool.h | 7 +++++++ onnxruntime/core/util/math_cpuonly.h | 7 +++++++ onnxruntime/test/perftest/performance_runner.cc | 8 ++++++++ onnxruntime/test/util/compare_ortvalue.cc | 7 +++++++ 7 files changed, 42 insertions(+), 4 deletions(-) diff --git a/dockerfiles/Dockerfile.arm32v7 b/dockerfiles/Dockerfile.arm32v7 index 9abfb47f65..54cc58c426 100644 --- a/dockerfiles/Dockerfile.arm32v7 +++ b/dockerfiles/Dockerfile.arm32v7 @@ -8,10 +8,10 @@ FROM arm32v7/fedora:34 MAINTAINER Changming Sun "chasun@microsoft.com" ADD . /code - -RUN /code/dockerfiles/scripts/install_fedora_arm32.sh && cd /code && ./build.sh --skip_submodule_sync --config Release --build_wheel --update --build --parallel --cmake_extra_defines ONNXRUNTIME_VERSION=$(cat ./VERSION_NUMBER) +RUN /code/dockerfiles/scripts/install_fedora_arm32.sh +RUN cd /code && ./build.sh --skip_submodule_sync --config Release --build_wheel --update --build --parallel --cmake_extra_defines ONNXRUNTIME_VERSION=$(cat ./VERSION_NUMBER) FROM arm64v8/centos:7 COPY --from=0 /code/build/Linux/Release/dist /root COPY --from=0 /code/dockerfiles/LICENSE-IMAGE.txt /code/LICENSE-IMAGE.txt -RUN yum install -y python3-wheel python3-pip && python3 -m pip install --upgrade pip && python3 -m pip install /root/*.whl && rm -rf /root/*.whl \ No newline at end of file +RUN yum install -y python3-wheel python3-pip && python3 -m pip install --upgrade pip && python3 -m pip install /root/*.whl && rm -rf /root/*.whl diff --git a/dockerfiles/scripts/install_fedora_arm32.sh b/dockerfiles/scripts/install_fedora_arm32.sh index 7f4b554213..c32859e696 100755 --- a/dockerfiles/scripts/install_fedora_arm32.sh +++ b/dockerfiles/scripts/install_fedora_arm32.sh @@ -1,3 +1,5 @@ -dnf install -y binutils gcc gcc-c++ aria2 python3-pip python3-wheel git python3-devel +#!/bin/bash +set -e +dnf install -y binutils gcc gcc-c++ aria2 python3-pip python3-wheel git python3-devel cmake python3 -m pip install --upgrade pip python3 -m pip install numpy diff --git a/include/onnxruntime/core/common/eigen_common_wrapper.h b/include/onnxruntime/core/common/eigen_common_wrapper.h index fa51a009a6..3ddb4e1e28 100644 --- a/include/onnxruntime/core/common/eigen_common_wrapper.h +++ b/include/onnxruntime/core/common/eigen_common_wrapper.h @@ -18,6 +18,13 @@ #ifdef HAS_DEPRECATED_COPY #pragma GCC diagnostic ignored "-Wdeprecated-copy" #endif +// cmake/external/eigen/unsupported/Eigen/CXX11/../../../Eigen/src/Core/arch/NEON/PacketMath.h:1633:9: +// error: ‘void* memcpy(void*, const void*, size_t)’ copying an object of non-trivial type ‘Eigen::internal::Packet4c’ +// {aka ‘struct Eigen::internal::eigen_packet_wrapper’} from an array of ‘const int8_t’ +// {aka ‘const signed char’} [-Werror=class-memaccess] +#ifdef HAS_CLASS_MEMACCESS +#pragma GCC diagnostic ignored "-Wclass-memaccess" +#endif #elif defined(_MSC_VER) // build\windows\debug\external\eigen3\unsupported\eigen\cxx11\src/Tensor/Tensor.h(76): // warning C4554: '&': check operator precedence for possible error; use parentheses to clarify precedence diff --git a/include/onnxruntime/core/platform/EigenNonBlockingThreadPool.h b/include/onnxruntime/core/platform/EigenNonBlockingThreadPool.h index 95bab63ba0..75eb86c9a0 100644 --- a/include/onnxruntime/core/platform/EigenNonBlockingThreadPool.h +++ b/include/onnxruntime/core/platform/EigenNonBlockingThreadPool.h @@ -20,6 +20,13 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-result" +// cmake/external/eigen/unsupported/Eigen/CXX11/../../../Eigen/src/Core/arch/NEON/PacketMath.h:1633:9: +// error: ‘void* memcpy(void*, const void*, size_t)’ copying an object of non-trivial type ‘Eigen::internal::Packet4c’ +// {aka ‘struct Eigen::internal::eigen_packet_wrapper’} from an array of ‘const int8_t’ +// {aka ‘const signed char’} [-Werror=class-memaccess] +#ifdef HAS_CLASS_MEMACCESS +#pragma GCC diagnostic ignored "-Wclass-memaccess" +#endif #elif defined(_MSC_VER) #pragma warning(push) #pragma warning(disable : 4127) diff --git a/onnxruntime/core/util/math_cpuonly.h b/onnxruntime/core/util/math_cpuonly.h index ced9eb404e..d9214b16c0 100644 --- a/onnxruntime/core/util/math_cpuonly.h +++ b/onnxruntime/core/util/math_cpuonly.h @@ -35,6 +35,13 @@ #pragma GCC diagnostic ignored "-Wdeprecated-copy" #endif #endif +// cmake/external/eigen/Eigen/src/Core/arch/NEON/PacketMath.h:1633:9: +// error: ‘void* memcpy(void*, const void*, size_t)’ copying an object of non-trivial type ‘Eigen::internal::Packet4c’ +// {aka ‘struct Eigen::internal::eigen_packet_wrapper’} from an array of ‘const int8_t’ +// {aka ‘const signed char’} [-Werror=class-memaccess] +#ifdef HAS_CLASS_MEMACCESS +#pragma GCC diagnostic ignored "-Wclass-memaccess" +#endif #elif defined(_MSC_VER) // build\windows\debug\external\eigen3\unsupported\eigen\cxx11\src/Tensor/Tensor.h(76): // warning C4554: '&': check operator precedence for possible error; use parentheses to clarify precedence diff --git a/onnxruntime/test/perftest/performance_runner.cc b/onnxruntime/test/perftest/performance_runner.cc index f789ed5745..c59c5dc391 100644 --- a/onnxruntime/test/perftest/performance_runner.cc +++ b/onnxruntime/test/perftest/performance_runner.cc @@ -20,10 +20,18 @@ using onnxruntime::Status; // TODO: Temporary, while we bring up the threadpool impl... #include "core/platform/threadpool.h" +#include "onnxruntime_config.h" #if defined(__GNUC__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-result" +// cmake/external/eigen/unsupported/Eigen/CXX11/../../../Eigen/src/Core/arch/NEON/PacketMath.h:1633:9: +// error: ‘void* memcpy(void*, const void*, size_t)’ copying an object of non-trivial type ‘Eigen::internal::Packet4c’ +// {aka ‘struct Eigen::internal::eigen_packet_wrapper’} from an array of ‘const int8_t’ +// {aka ‘const signed char’} [-Werror=class-memaccess] +#ifdef HAS_CLASS_MEMACCESS +#pragma GCC diagnostic ignored "-Wclass-memaccess" +#endif #endif #include #if defined(__GNUC__) diff --git a/onnxruntime/test/util/compare_ortvalue.cc b/onnxruntime/test/util/compare_ortvalue.cc index 53fccefbe4..c6bbae3465 100644 --- a/onnxruntime/test/util/compare_ortvalue.cc +++ b/onnxruntime/test/util/compare_ortvalue.cc @@ -10,6 +10,13 @@ #pragma GCC diagnostic ignored "-Wignored-qualifiers" #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-result" +// cmake/external/eigen/Eigen/src/Core/arch/NEON/PacketMath.h:1633:9: +// error: ‘void* memcpy(void*, const void*, size_t)’ copying an object of non-trivial type ‘Eigen::internal::Packet4c’ +// {aka ‘struct Eigen::internal::eigen_packet_wrapper’} from an array of ‘const int8_t’ +// {aka ‘const signed char’} [-Werror=class-memaccess] +#ifdef HAS_CLASS_MEMACCESS +#pragma GCC diagnostic ignored "-Wclass-memaccess" +#endif #endif #include #include