Skip to content

Commit 85892a2

Browse files
Fix cross-platform release build (Linux libblas, MSYS2 python/cc) (#174)
1 parent c0a5cc3 commit 85892a2

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/release-binaries.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,12 @@ jobs:
7272
update: true
7373
# OpenBLAS provides both BLAS and LAPACK. The package prefix differs by
7474
# environment (mingw-w64-x86_64-* vs mingw-w64-clang-aarch64-*).
75+
# gcc-fortran (gfortran + gcc/cc), openblas (BLAS+LAPACK), python (for
76+
# patch_sources.py). Package prefix differs by environment.
7577
install: >-
7678
${{ matrix.msystem == 'CLANGARM64'
77-
&& 'mingw-w64-clang-aarch64-gcc-fortran mingw-w64-clang-aarch64-openblas'
78-
|| 'mingw-w64-x86_64-gcc-fortran mingw-w64-x86_64-openblas' }}
79+
&& 'mingw-w64-clang-aarch64-gcc-fortran mingw-w64-clang-aarch64-openblas mingw-w64-clang-aarch64-python'
80+
|| 'mingw-w64-x86_64-gcc-fortran mingw-w64-x86_64-openblas mingw-w64-x86_64-python' }}
7981
8082
# --- Build -----------------------------------------------------------
8183
- name: Build native binary
@@ -90,7 +92,7 @@ jobs:
9092
;;
9193
linux-*)
9294
# Static LAPACK/BLAS + Fortran runtime; glibc stays dynamic.
93-
export LAPACK_LIBS="-l:liblapack.a -l:lblas.a"
95+
export LAPACK_LIBS="-l:liblapack.a -l:libblas.a"
9496
export EXTRA_LDFLAGS="-static-libquadmath"
9597
;;
9698
windows-*)

native/build.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ mode="${MPI_MODE:-shim}"
2020
build_dir="$here/build_$mode"
2121
out="${OUT:-$here/amica15_$mode}"
2222
os="$(uname -s)"
23-
cc="${CC:-cc}"
23+
# `cc` is not always present (MSYS2 mingw ships `gcc`, not `cc`); fall back.
24+
cc="${CC:-$(command -v cc 2>/dev/null || command -v gcc 2>/dev/null || echo cc)}"
25+
# patch_sources.py needs a Python; MSYS2 mingw calls it `python`, not `python3`.
26+
python="${PYTHON:-$(command -v python3 2>/dev/null || command -v python 2>/dev/null || echo python3)}"
2427

2528
if [[ "$mode" == "shim" ]]; then
2629
fc="${FC:-gfortran}"
@@ -53,7 +56,7 @@ work="$build_dir/src"
5356
cp "$src_dir/funmod2.f90" "$src_dir/amica15.f90" "$src_dir/amica15_header.f90" "$work/"
5457

5558
# --- Patch the build copy only (the tracked sources stay the parity reference).
56-
python3 "$here/patch_sources.py" "$work/amica15.f90" "$work/amica15_header.f90"
59+
"$python" "$here/patch_sources.py" "$work/amica15.f90" "$work/amica15_header.f90"
5760

5861
set -x
5962
# Vector-math shim (vrda_exp/vrda_log as libm loops); portable, no AMD LibM.

0 commit comments

Comments
 (0)