77:: Expects these binaries on the PATH:
88:: clang-cl, flang-new, cmake, perl
99
10+ :: First commit containing WoA build fixes.
11+ :: Minimum OpenBLAS commit to build; we'll update to this if commit not
12+ :: present.
13+ set first_woa_buildable_commit = " de2380e5a6149706a633322a16a0f66faa5591fc"
14+
1015@ echo off
1116setlocal enabledelayedexpansion
1217
@@ -18,32 +23,25 @@ if "%1"=="" (
1823echo Building for %BUILD_BIT% -bit configuration...
1924
2025:: Define destination directory
21- move " ..\local\scipy_openblas64" " ..\local\scipy_openblas32"
22- set " DEST_DIR = %CD% \..\local\scipy_openblas32"
23- cd ..
24-
25- :: Check if 'openblas' folder exists and is empty
26- if exist " openblas" (
27- dir /b " openblas" | findstr . > nul
28- if errorlevel 1 (
29- echo OpenBLAS folder exists but is empty. Deleting and recloning...
30- rmdir /s /q " openblas"
31- )
32- )
26+ set ob_out_root = %CD% \local\scipy_openblas
27+ set ob_64 = " %ob_out_root% 64"
28+ set ob_32 = " %ob_out_root% 32"
29+ if exist %ob_64% copy %ob_64% %ob_32%
30+ set DEST_DIR = %ob_32%
31+
32+ :: Clone OpenBLAS
33+ echo Cloning OpenBLAS repository with submodules...
34+ git submodule update --init --recursive OpenBLAS
35+ if errorlevel 1 exit /b 1
3336
34- :: Clone OpenBLAS if not present
35- if not exist " openblas" (
36- echo Cloning OpenBLAS repository with submodules...
37- git clone --recursive https://github.com/OpenMathLib/OpenBLAS.git OpenBLAS
38- if errorlevel 1 exit /b 1
37+ :: Enter OpenBLAS directory and checkout buildable commit
38+ cd OpenBLAS
39+ git merge-base --is-ancestor %first_woa_buildable_commit% HEAD 2 > NUL
40+ if errorlevel 1 (
41+ echo Updating to WoA buildable commit for OpenBLAS
42+ git checkout %first_woa_buildable_commit%
3943)
4044
41- :: Enter OpenBLAS directory and checkout develop branch
42- cd openblas
43- git checkout develop
44-
45- echo Checked out to the latest branch of OpenBLAS.
46-
4745:: Create build directory and navigate to it
4846if not exist build mkdir build
4947cd build
@@ -76,7 +74,7 @@ powershell -Command "(Get-Content 'local\scipy_openblas32\__init__.py') -replace
7674:: Prepare destination directory
7775cd OpenBLAS/build
7876echo Preparing destination directory at %DEST_DIR% ...
79- if not exist " %DEST_DIR% \lib\cmake\openblas " mkdir " %DEST_DIR% \lib\cmake\openblas "
77+ if not exist " %DEST_DIR% \lib\cmake\OpenBLAS " mkdir " %DEST_DIR% \lib\cmake\OpenBLAS "
8078if not exist " %DEST_DIR% \include" mkdir " %DEST_DIR% \include"
8179
8280:: Move library files
@@ -129,4 +127,4 @@ pip install "%WHEEL_FILE%"
129127if errorlevel 1 exit /b 1
130128
131129echo Done.
132- exit /b 0
130+ exit /b 0
0 commit comments