From 609d0d2ac237a535f1ba3acdf9d1b0138c31a427 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Mon, 15 Jun 2026 16:41:55 +0300 Subject: [PATCH 1/8] add MT --- .github/workflows/build-nuget-package.yml | 4 ++-- nuget/build_windows.ps1 | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-nuget-package.yml b/.github/workflows/build-nuget-package.yml index bb92c13ee36..d81cda0a22f 100644 --- a/.github/workflows/build-nuget-package.yml +++ b/.github/workflows/build-nuget-package.yml @@ -75,7 +75,7 @@ jobs: - name: Configure CMake win32 shell: bash working-directory: ${{github.workspace}}/build32 - run: cmake $GITHUB_WORKSPACE -DCSHARP=ON -DBUILD_DOTNET=ON -A Win32 + run: cmake $GITHUB_WORKSPACE -DCSHARP=ON -DBUILD_DOTNET=ON -A Win32 -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded - name: Build win32 shell: bash @@ -145,7 +145,7 @@ jobs: - name: Configure CMake working-directory: ${{github.workspace}}/build shell: bash - run: cmake $GITHUB_WORKSPACE -DCSHARP=ON -DBUILD_DOTNET=ON + run: cmake $GITHUB_WORKSPACE -DCSHARP=ON -DBUILD_DOTNET=ON -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded - name: Build working-directory: ${{github.workspace}}/build diff --git a/nuget/build_windows.ps1 b/nuget/build_windows.ps1 index f0450329d8f..12d44e42b18 100644 --- a/nuget/build_windows.ps1 +++ b/nuget/build_windows.ps1 @@ -17,6 +17,7 @@ try { # $flags = "/arch:AVX512 /Ox /Ot /Oi /O2" - Intel stopped supporting AVX-512 on some CPUs, me might run into compatibility issues $flags = "/Ox /Ot /Oi /O2" $arguments += "-DCMAKE_CXX_FLAGS='$flags'" + $arguments += "-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded" # Pass the argument list to cmake & cmake $arguments ../.. From 41f81278097e67ea881cbc79739c2509eaba081b Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Mon, 15 Jun 2026 16:55:04 +0300 Subject: [PATCH 2/8] test-nuget --- .github/workflows/build-nuget-package.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-nuget-package.yml b/.github/workflows/build-nuget-package.yml index d81cda0a22f..14afd6869a9 100644 --- a/.github/workflows/build-nuget-package.yml +++ b/.github/workflows/build-nuget-package.yml @@ -2,6 +2,15 @@ name: build-nuget-package on: workflow_dispatch: + inputs: + version: + description: 'Package version (e.g. 1.14.0-preview.1)' + required: true + default: '1.14.0-preview.1' + push_package: + description: 'Push package to NuGet.org' + type: boolean + default: false pull_request: release: types: @@ -196,7 +205,7 @@ jobs: - name: Dotnet pack working-directory: ${{github.workspace}}/build/dotnet/Highs.Native - run: dotnet pack -c Release /p:Version=1.14.0 + run: dotnet pack -c Release /p:Version=${{ inputs.version || '1.14.0' }} - uses: actions/upload-artifact@v7 with: @@ -211,7 +220,7 @@ jobs: permissions: id-token: write # enable GitHub OIDC token issuance for this job - if: github.event_name == 'release' + if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.push_package == 'true') steps: - uses: actions/checkout@v6 - uses: actions/setup-dotnet@v5 From ed6d9ef92f5760c9e1f439c1b7e115c06d58b4d6 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Mon, 15 Jun 2026 17:04:40 +0300 Subject: [PATCH 3/8] fixes 32bit --- .github/workflows/build-nuget-package.yml | 10 +++++----- cmake/dotnet.cmake | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-nuget-package.yml b/.github/workflows/build-nuget-package.yml index 14afd6869a9..fbd0fd43a06 100644 --- a/.github/workflows/build-nuget-package.yml +++ b/.github/workflows/build-nuget-package.yml @@ -93,8 +93,8 @@ jobs: - uses: actions/upload-artifact@v7 with: - name: win-x32 - path: ${{github.workspace}}/build32/dotnet/Highs.Native/runtimes/win-x64/ + name: win-x86 + path: ${{github.workspace}}/build32/dotnet/Highs.Native/runtimes/win-x86/ build_linux: runs-on: ubuntu-latest @@ -178,11 +178,11 @@ jobs: name: macos-arm64 path: ${{github.workspace}}/build/dotnet/Highs.Native/runtimes - - name: Download runtimes win-x32 + - name: Download runtimes win-x86 uses: actions/download-artifact@v8 with: - name: win-x32 - path: ${{github.workspace}}/build/dotnet/Highs.Native/runtimes/win-x32 + name: win-x86 + path: ${{github.workspace}}/build/dotnet/Highs.Native/runtimes/win-x86 - name: Download runtimes uses: actions/download-artifact@v8 diff --git a/cmake/dotnet.cmake b/cmake/dotnet.cmake index f4274bfdc1a..5dc2b2195c4 100644 --- a/cmake/dotnet.cmake +++ b/cmake/dotnet.cmake @@ -13,6 +13,8 @@ set(DOTNET_PACKAGES_DIR "${PROJECT_BINARY_DIR}/dotnet") # see: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64)") set(DOTNET_PLATFORM arm64) +elseif(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) + set(DOTNET_PLATFORM x86) else() set(DOTNET_PLATFORM x64) endif() From 2868825b21a579545b9787f778d328904b9adb04 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Mon, 15 Jun 2026 17:27:25 +0300 Subject: [PATCH 4/8] add -A Win32 --- cmake/dotnet.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/dotnet.cmake b/cmake/dotnet.cmake index 5dc2b2195c4..f243e801eb7 100644 --- a/cmake/dotnet.cmake +++ b/cmake/dotnet.cmake @@ -13,7 +13,7 @@ set(DOTNET_PACKAGES_DIR "${PROJECT_BINARY_DIR}/dotnet") # see: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64)") set(DOTNET_PLATFORM arm64) -elseif(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) +elseif(WIN32 AND (CMAKE_GENERATOR_PLATFORM STREQUAL "Win32" OR CMAKE_SIZEOF_VOID_P EQUAL 4)) set(DOTNET_PLATFORM x86) else() set(DOTNET_PLATFORM x64) From f647b150c2a1085bba8ffc839463b85718d1f30a Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 16 Jun 2026 10:24:18 +0300 Subject: [PATCH 5/8] x86 --- highs/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/highs/CMakeLists.txt b/highs/CMakeLists.txt index c55c481f8aa..9348624869a 100644 --- a/highs/CMakeLists.txt +++ b/highs/CMakeLists.txt @@ -377,6 +377,8 @@ else() # see: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64)") set(DOTNET_PLATFORM arm64) + elseif(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) + set(DOTNET_PLATFORM x86) else() set(DOTNET_PLATFORM x64) endif() From 849b316016cffe2308e69a253cbf82cb3709f734 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 16 Jun 2026 10:47:08 +0300 Subject: [PATCH 6/8] for consistency --- highs/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/highs/CMakeLists.txt b/highs/CMakeLists.txt index 9348624869a..fbdd7d34e65 100644 --- a/highs/CMakeLists.txt +++ b/highs/CMakeLists.txt @@ -377,7 +377,7 @@ else() # see: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64)") set(DOTNET_PLATFORM arm64) - elseif(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) + elseif(WIN32 AND (CMAKE_GENERATOR_PLATFORM STREQUAL "Win32" OR CMAKE_SIZEOF_VOID_P EQUAL 4)) set(DOTNET_PLATFORM x86) else() set(DOTNET_PLATFORM x64) From 0ee4bf67286be261fb73a1803dfdf88ab31d6beb Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 16 Jun 2026 12:16:33 +0300 Subject: [PATCH 7/8] check for --- .github/workflows/build-nuget-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-nuget-package.yml b/.github/workflows/build-nuget-package.yml index fbd0fd43a06..ba82da5cf14 100644 --- a/.github/workflows/build-nuget-package.yml +++ b/.github/workflows/build-nuget-package.yml @@ -220,7 +220,7 @@ jobs: permissions: id-token: write # enable GitHub OIDC token issuance for this job - if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.push_package == 'true') + if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.push_package) steps: - uses: actions/checkout@v6 - uses: actions/setup-dotnet@v5 From 7e13f47702f313e8f757ccf05660ab1361d55e7c Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 16 Jun 2026 15:07:27 +0300 Subject: [PATCH 8/8] update docs as well --- README.md | 2 +- docs/src/interfaces/csharp.md | 2 +- nuget/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b6056bcc41b..7084496f010 100644 --- a/README.md +++ b/README.md @@ -262,7 +262,7 @@ dotnet add package Highs.Native --version 1.14.0 The nuget package contains runtime libraries for * `win-x64` -* `win-x32` +* `win-x86` * `linux-x64` * `linux-arm64` * `macos-x64` diff --git a/docs/src/interfaces/csharp.md b/docs/src/interfaces/csharp.md index a75ef697430..a174e869716 100644 --- a/docs/src/interfaces/csharp.md +++ b/docs/src/interfaces/csharp.md @@ -23,7 +23,7 @@ dotnet add package Highs.Native --version 1.14.0 The nuget package contains runtime libraries for * `win-x64` -* `win-x32` +* `win-x86` * `linux-x64` * `linux-arm64` * `macos-x64` diff --git a/nuget/README.md b/nuget/README.md index db615956186..01f26e73e26 100644 --- a/nuget/README.md +++ b/nuget/README.md @@ -13,7 +13,7 @@ dotnet add package Highs.Native --version 1.14.0 The nuget package contains runtime libraries for * `win-x64` -* `win-x32` +* `win-x86` * `linux-x64` * `linux-arm64` * `macos-x64`