diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 94181448fd..e82219a0af 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -526,7 +526,21 @@ if(NOT WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "Android") find_package(Iconv REQUIRED) set(ICONV_LIB Iconv::Iconv) endif() + find_package(Patch) +if (WIN32 AND NOT Patch_FOUND) + # work around CI machines missing patch from the git install by falling back to the binary in this repo. + # replicate what happens in https://github.com/Kitware/CMake/blob/master/Modules/FindPatch.cmake but without + # the hardcoded suffixes in the path to the patch binary. + find_program(Patch_EXECUTABLE NAMES patch PATHS ${PROJECT_SOURCE_DIR}/external/git.Win32.2.41.03.patch) + if(Patch_EXECUTABLE) + set(Patch_FOUND 1) + if (NOT TARGET Patch::patch) + add_executable(Patch::patch IMPORTED) + set_property(TARGET Patch::patch PROPERTY IMPORTED_LOCATION ${Patch_EXECUTABLE}) + endif() + endif() +endif() if(Patch_FOUND) message("Patch found: ${Patch_EXECUTABLE}") endif() diff --git a/cmake/external/eigen.cmake b/cmake/external/eigen.cmake index c0f7ddc50e..b123adb624 100644 --- a/cmake/external/eigen.cmake +++ b/cmake/external/eigen.cmake @@ -1,23 +1,14 @@ - if (onnxruntime_USE_PREINSTALLED_EIGEN) add_library(eigen INTERFACE) file(TO_CMAKE_PATH ${eigen_SOURCE_PATH} eigen_INCLUDE_DIRS) target_include_directories(eigen INTERFACE ${eigen_INCLUDE_DIRS}) else () - if (onnxruntime_USE_ACL) - FetchContent_Declare( - eigen - URL ${DEP_URL_eigen} - URL_HASH SHA1=${DEP_SHA1_eigen} - PATCH_COMMAND ${Patch_EXECUTABLE} --ignore-space-change --ignore-whitespace < ${PROJECT_SOURCE_DIR}/patches/eigen/Fix_Eigen_Build_Break.patch - ) - else() - FetchContent_Declare( - eigen - URL ${DEP_URL_eigen} - URL_HASH SHA1=${DEP_SHA1_eigen} - ) - endif() + FetchContent_Declare( + eigen + URL ${DEP_URL_eigen} + URL_HASH SHA1=${DEP_SHA1_eigen} + ) + FetchContent_Populate(eigen) set(eigen_INCLUDE_DIRS "${eigen_SOURCE_DIR}") endif() diff --git a/cmake/external/git.Win32.2.41.03.patch/msys-2.0.dll b/cmake/external/git.Win32.2.41.03.patch/msys-2.0.dll new file mode 100644 index 0000000000..686afedb50 Binary files /dev/null and b/cmake/external/git.Win32.2.41.03.patch/msys-2.0.dll differ diff --git a/cmake/external/git.Win32.2.41.03.patch/msys-gcc_s-1.dll b/cmake/external/git.Win32.2.41.03.patch/msys-gcc_s-1.dll new file mode 100644 index 0000000000..1750b9ce92 Binary files /dev/null and b/cmake/external/git.Win32.2.41.03.patch/msys-gcc_s-1.dll differ diff --git a/cmake/external/git.Win32.2.41.03.patch/patch.exe b/cmake/external/git.Win32.2.41.03.patch/patch.exe new file mode 100644 index 0000000000..8d784cb5d7 Binary files /dev/null and b/cmake/external/git.Win32.2.41.03.patch/patch.exe differ diff --git a/cmake/patches/eigen/Fix_Eigen_Build_Break.patch b/cmake/patches/eigen/Fix_Eigen_Build_Break.patch deleted file mode 100644 index ca0e0fd23d..0000000000 --- a/cmake/patches/eigen/Fix_Eigen_Build_Break.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff -Naur git_org/cmake/external/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h git/cmake/external/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h ---- git_org/cmake/external/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h 2019-07-17 15:27:59.540667336 -0500 -+++ git/cmake/external/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h 2019-07-17 15:30:16.000000000 -0500 -@@ -1076,8 +1076,9 @@ - dest = *b; - } - -- EIGEN_STRONG_INLINE void updateRhs(const RhsScalar* b, RhsPacketx4& dest) const -- {} -+ EIGEN_STRONG_INLINE void updateRhs(const RhsScalar*, RhsPacketx4&) const -+ { -+ } - - EIGEN_STRONG_INLINE void loadRhsQuad(const RhsScalar* b, RhsPacket& dest) const - { -@@ -1145,8 +1146,9 @@ - loadRhs(b,dest); - } - -- EIGEN_STRONG_INLINE void updateRhs(const RhsScalar* b, RhsPacketx4& dest) const -- {} -+ EIGEN_STRONG_INLINE void updateRhs(const RhsScalar*, RhsPacketx4&) const -+ { -+ } - - EIGEN_STRONG_INLINE void loadRhsQuad(const RhsScalar* b, RhsPacket& dest) const - {