Skip to content

Commit c279309

Browse files
committed
windows 32bit openblas
1 parent 3652af3 commit c279309

File tree

2 files changed

+67
-53
lines changed

2 files changed

+67
-53
lines changed

.github/workflows/release-cpack.yml

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -71,54 +71,54 @@ jobs:
7171
name: windows-${{ matrix.arch }}
7272
path: build/*.zip
7373

74-
# build-windows-32:
75-
# runs-on: windows-latest
76-
# strategy:
77-
# fail-fast: false
78-
# matrix:
79-
# arch: [Win32]
80-
# steps:
81-
# - uses: actions/checkout@v3
82-
# - name: Build
83-
# run: |
84-
# cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }} `
85-
# -DHIPO=ON -DBUILD_OPENBLAS=ON -DBUILD_STATIC_EXE=ON `
86-
# -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL
87-
# cmake --build build --config Release --parallel
88-
# cd build
89-
# cpack -C Release
90-
91-
# # -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL
92-
# # Win32
93-
94-
# - name: Upload artifacts
95-
# uses: actions/upload-artifact@v4
96-
# with:
97-
# name: windows-${{ matrix.arch }}
98-
# path: build/*.zip
99-
100-
# build-windows-arm-32:
101-
# runs-on: windows-11-arm
102-
# strategy:
103-
# matrix:
104-
# arch: [ARM]
105-
# steps:
106-
# - uses: actions/checkout@v3
107-
# - name: Build
108-
# run: |
109-
# cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }} `
110-
# -DHIPO=ON -DBUILD_OPENBLAS=ON -DBUILD_STATIC_EXE=ON `
111-
# -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL `
112-
# -DCMAKE_VS_WINDOWS_SDK_VERSION=10.0.20348.0
113-
# cmake --build build --config Release --parallel
114-
# cd build
115-
# cpack -C Release
116-
117-
# - name: Upload artifacts
118-
# uses: actions/upload-artifact@v4
119-
# with:
120-
# name: windows-${{ matrix.arch }}
121-
# path: build/*.zip
74+
build-windows-32:
75+
runs-on: windows-latest
76+
strategy:
77+
fail-fast: false
78+
matrix:
79+
arch: [Win32]
80+
steps:
81+
- uses: actions/checkout@v3
82+
- name: Build
83+
run: |
84+
cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }} `
85+
-DHIPO=ON -DBUILD_OPENBLAS=ON -DBUILD_STATIC_EXE=ON `
86+
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL
87+
cmake --build build --config Release --parallel
88+
cd build
89+
cpack -C Release
90+
91+
# -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL
92+
# Win32
93+
94+
- name: Upload artifacts
95+
uses: actions/upload-artifact@v4
96+
with:
97+
name: windows-${{ matrix.arch }}
98+
path: build/*.zip
99+
100+
build-windows-arm-32:
101+
runs-on: windows-11-arm
102+
strategy:
103+
matrix:
104+
arch: [ARM]
105+
steps:
106+
- uses: actions/checkout@v3
107+
- name: Build
108+
run: |
109+
cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }} `
110+
-DHIPO=ON -DBUILD_OPENBLAS=ON -DBUILD_STATIC_EXE=ON `
111+
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL `
112+
-DCMAKE_VS_WINDOWS_SDK_VERSION=10.0.20348.0
113+
cmake --build build --config Release --parallel
114+
cd build
115+
cpack -C Release
116+
117+
- name: Upload artifacts
118+
uses: actions/upload-artifact@v4
119+
with:
120+
name: windows-${{ matrix.arch }}
121+
path: build/*.zip
122122

123123
build-windows-arm:
124124
runs-on: windows-11-arm

cmake/FindHipoDeps.cmake

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,27 @@ if (BUILD_OPENBLAS)
1616
-DNO_COMPLEX=ON
1717
-DNO_SINGLE=ON
1818
-DONLY_BLAS=ON
19+
)
20+
21+
if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64|armv8|arm")
22+
message(STATUS "ARM architecture detected. Applying -DTARGET=ARMV8.")
23+
list(APPEND OPENBLAS_MINIMAL_FLAGS -DTARGET=ARMV8)
24+
endif()
1925

20-
# Crucial for size on ARM: Target the specific architecture
21-
-DTARGET=ARMV8
26+
# CMAKE_SIZEOF_VOID_P is 4 for 32-bit builds, 8 for 64-bit builds.
27+
if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
28+
message(STATUS "32-bit target detected. Applying 32-bit configuration flags for OpenBLAS.")
2229

23-
# may be needed for 32 bit
24-
# -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL
25-
)
30+
list(APPEND OPENBLAS_MINIMAL_FLAGS -DCMAKE_GENERATOR_PLATFORM=Win32)
31+
32+
# Note: If OpenBLAS has an internal logic flag to force 32-bit, you would add it here.
33+
# Example (hypothetical):
34+
# list(APPEND OPENBLAS_MINIMAL_FLAGS -DOPENBLAS_32BIT=ON)
35+
36+
# If the MSVC runtime library issue persists, you can try this flag as well,
37+
# though CMAKE_GENERATOR_PLATFORM should usually be sufficient.
38+
# list(APPEND OPENBLAS_MINIMAL_FLAGS -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL)
39+
endif()
2640

2741
message(CHECK_START "Fetching OpenBLAS")
2842
list(APPEND CMAKE_MESSAGE_INDENT " ")

0 commit comments

Comments
 (0)