Skip to content

Commit bb49192

Browse files
committed
Windows ARM fixes
1 parent 5d92f36 commit bb49192

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎local/scipy_openblas64/__init__.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,16 @@ def get_pkg_config(use_preloading=False, use_prefix=False):
9696
variables = {}
9797
with open(f"{get_lib_dir()}/pkgconfig/scipy-openblas.pc") as pc_file:
9898
for line in pc_file:
99-
if match := re.fullmatch(r"(.+?)=(.*)", line.strip()):
99+
# The CMake build used by Windows ARM64 produces a Version: keyword but not
100+
# a version= variable, so parse both kinds of line.
101+
if match := re.fullmatch(r"(.+?)[:=](.*)", line.strip()):
100102
variables[match[1].strip()] = match[2].strip()
101103

102104
return dedent(f"""\
103105
libdir={libdir}
104106
includedir={incdir}
105107
openblas_config= {variables["openblas_config"]}
106-
version={variables["version"]}
108+
version={variables.get("version") or variables["Version"]}
107109
extralib={extralib}
108110
Name: openblas
109111
Description: OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version

‎tools/build_steps_win_arm64.bat‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ REM Copy CMake configuration files
224224
echo Copying CMake configuration files...
225225
if exist openblasconfig.cmake copy /Y openblasconfig.cmake "%DEST_DIR%\lib\cmake\openblas\"
226226
if exist openblasconfigversion.cmake copy /Y openblasconfigversion.cmake "%DEST_DIR%\lib\cmake\openblas\"
227-
227+
228228
REM Copy header files
229229
echo Copying generated header files...
230230
if exist generated xcopy /E /Y generated "%DEST_DIR%\include\"
@@ -238,11 +238,9 @@ xcopy /Y "..\lapack-netlib\lapacke\include\*.h" "%DEST_DIR%\include\"
238238
if errorlevel 1 exit /b 1
239239

240240
echo Create pkgconfig scipy-openblas.pc
241-
242-
echo FIXME
243-
bash -c "find . -name *.pc | xargs ls -l"
244-
bash -c "find . -name *.pc | xargs cat"
245-
241+
if not exist "%DEST_DIR%\lib\pkgconfig" mkdir "%DEST_DIR%\lib\pkgconfig"
242+
copy /Y openblas*.pc "%DEST_DIR%\lib\pkgconfig\scipy-openblas.pc"
243+
if errorlevel 1 exit /b 1
246244
cd ../..
247245
bash -e tools\get_pkg_config.sh
248246
if errorlevel 1 (

0 commit comments

Comments
 (0)