From a7a283f5456c1fcdea3b91ed14c53ebe7574e37d Mon Sep 17 00:00:00 2001 From: Ferdinand Oeinck Date: Tue, 21 Oct 2025 17:36:03 +0200 Subject: [PATCH] =?UTF-8?q?Added=20changes=20for=20building=20on=20Windows?= =?UTF-8?q?=20on=20ARM64.=20(build=20from=20'arm64=20Native=20Tools?= =?UTF-8?q?=E2=80=99=20command=20prompt)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmake/dotnet.cmake | 2 +- ortools/dotnet/Google.OrTools-full.csproj.in | 8 ++++++-- ortools/dotnet/Google.OrTools.sln | 1 + patches/scip-v922.patch | 16 +++++++++++++++- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/cmake/dotnet.cmake b/cmake/dotnet.cmake index c74042c04c0..f356c52ed65 100644 --- a/cmake/dotnet.cmake +++ b/cmake/dotnet.cmake @@ -47,7 +47,7 @@ set(DOTNET_PACKAGES_DIR "${PROJECT_BINARY_DIR}/dotnet/packages") # Runtime IDentifier # see: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog -if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64)") +if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64|ARM64)") set(DOTNET_PLATFORM arm64) else() set(DOTNET_PLATFORM x64) diff --git a/ortools/dotnet/Google.OrTools-full.csproj.in b/ortools/dotnet/Google.OrTools-full.csproj.in index 9945e956c0a..1d84c5010f4 100644 --- a/ortools/dotnet/Google.OrTools-full.csproj.in +++ b/ortools/dotnet/Google.OrTools-full.csproj.in @@ -3,7 +3,7 @@ Library @DOTNET_LANG@ @DOTNET_TFM@ - linux-x64;osx-x64;win-x64;linux-arm64;osx-arm64 + linux-x64;osx-x64;win-x64;win-arm64;linux-arm64;osx-arm64 true @DOTNET_PROJECT@ @PROJECT_VERSION@ @@ -112,6 +112,7 @@ + @@ -122,11 +123,13 @@ + + - + @@ -196,6 +199,7 @@ + diff --git a/ortools/dotnet/Google.OrTools.sln b/ortools/dotnet/Google.OrTools.sln index c2ef81d8af4..d90a9dc8766 100644 --- a/ortools/dotnet/Google.OrTools.sln +++ b/ortools/dotnet/Google.OrTools.sln @@ -6,6 +6,7 @@ MinimumVisualStudioVersion = 15.0.26124.0 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Google.OrTools.runtime.linux-x64", "Google.OrTools.runtime.linux-x64\Google.OrTools.runtime.linux-x64.csproj", "{FC646C34-8541-427D-B9F6-1247798F4574}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Google.OrTools.runtime.osx-x64", "Google.OrTools.runtime.osx-x64\Google.OrTools.runtime.osx-x64.csproj", "{FC646C34-8541-427D-B9F6-1247798F4574}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Google.OrTools.runtime.win-x64", "Google.OrTools.runtime.win-x64\Google.OrTools.runtime.win-x64.csproj", "{FC646C34-8541-427D-B9F6-1247798F4574}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Google.OrTools.runtime.win-arm64", "Google.OrTools.runtime.win-arm64\Google.OrTools.runtime.win-arm64.csproj", "{FC646C34-8541-427D-B9F6-1247798F4574}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Google.OrTools", "Google.OrTools\Google.OrTools.csproj", "{FC646C34-8541-427D-B9F6-1247798F4574}" EndProject Global diff --git a/patches/scip-v922.patch b/patches/scip-v922.patch index b1093c9e341..6a2c626e498 100644 --- a/patches/scip-v922.patch +++ b/patches/scip-v922.patch @@ -176,4 +176,18 @@ index d6dd3acf..a146ddec 100644 +) install(FILES "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/scip-config.cmake" ${PROJECT_BINARY_DIR}/scip-config-version.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/scip) + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/scip) +diff --git a/src/scip/intervalarith.c b/src/scip/intervalarith.c +index 6d76d12e..7a0b0204 100644 +--- a/src/scip/intervalarith.c ++++ b/src/scip/intervalarith.c +@@ -301,7 +301,7 @@ double negate( + /* cl or icl compiler on 32bit windows or icl compiler on 64bit windows + * cl on 64bit windows does not seem to support inline assembler + */ +-#elif defined(_MSC_VER) && (defined(__INTEL_COMPILER) || !defined(_M_X64)) ++#elif defined(_MSC_VER) && (defined(__INTEL_COMPILER) || (!defined(_M_X64) && !defined(_M_ARM64))) + + /** gets the negation of a double + * Do this in a way that the compiler does not "optimize" it away, which usually does not considers rounding modes. +