7
7
:: Expects these binaries on the PATH:
8
8
:: clang-cl, flang-new, cmake, perl
9
9
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
+
10
15
@ echo off
11
16
setlocal enabledelayedexpansion
12
17
@@ -18,32 +23,25 @@ if "%1"=="" (
18
23
echo Building for %BUILD_BIT% -bit configuration...
19
24
20
25
:: 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
33
36
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%
39
43
)
40
44
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
-
47
45
:: Create build directory and navigate to it
48
46
if not exist build mkdir build
49
47
cd build
@@ -76,7 +74,7 @@ powershell -Command "(Get-Content 'local\scipy_openblas32\__init__.py') -replace
76
74
:: Prepare destination directory
77
75
cd OpenBLAS/build
78
76
echo 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 "
80
78
if not exist " %DEST_DIR% \include" mkdir " %DEST_DIR% \include"
81
79
82
80
:: Move library files
@@ -129,4 +127,4 @@ pip install "%WHEEL_FILE%"
129
127
if errorlevel 1 exit /b 1
130
128
131
129
echo Done.
132
- exit /b 0
130
+ exit /b 0
0 commit comments