Skip to content

swiglpk: add build-swiglpk.yml for riscv64 wheels - #1379

Merged
luhenry merged 3 commits into
mainfrom
swiglpk
Sep 7, 2026
Merged

swiglpk: add build-swiglpk.yml for riscv64 wheels#1379
luhenry merged 3 commits into
mainfrom
swiglpk

Conversation

@luhenry

@luhenry luhenry commented Sep 7, 2026

Copy link
Copy Markdown
Member

Compiles SWIG-generated Python bindings around GLPK, the GNU linear/mixed-integer programming kit. Upstream publishes no riscv64 wheel.

Mirrors upstream's build-wheels.yml.

Differs from upstream

  • GLPK build moved to CIBW_BEFORE_ALL_LINUX - runs once, not per interpreter like upstream's before-build
  • swig/gmp-devel installed from Rocky 10's repos - replaces upstream's from-source SWIG 3.0.10/GMP builds, build-time only
  • GLPK installed with --libdir=/usr/lib64 - riscv64 autotools default (/usr/lib) isn't on the linker path

Testing

  • same as upstream

License: Wheel bundles GLPK (GPL-3.0, embedding LGPL-2.1 AMD/COLAMD and MIT MiniSat) and GMP (LGPL-3.0/GPL-2.0); upstream ships no licence text for them, so the build adds it and a gpl_sources job publishes their sources.

Patches

  • 0001-Use-the-Python-3-long-API-in-as_intArray.patch - Backport [https://github.com/biosustain/swiglpk/commit/fbf4c5ff246ea0c9fce1b8d60a7fa038bd994020]. Without it, PyInt_Check/PyInt_AsLong (Python 2 API) fail as implicit-declaration errors on the riscv64 image's GCC. Reproduces on any platform whose compiler errors on implicit declarations, not riscv64-only.

Built on cp312; 1 passed, 0 skipped.

Mirrors upstream's build-wheels.yml (cibuildwheel + config.sh's GLPK
build), narrowed to Linux/manylinux_riscv64. GLPK has no riscv64 distro
package, so it is built from the pinned upstream tarball; swig and
gmp-devel come from Rocky 10's repos instead of upstream's from-source
builds. Adds a gpl_sources job collecting gcc/gmp RPM sources plus the
pinned GLPK tarball, since the wheel vendors all three.
luhenry added a commit that referenced this pull request Sep 7, 2026
GLPK 5.0's bundled config.guess/config.sub (2012-era) don't recognize
riscv64, so ./configure died with "cannot guess build type" on the
riscv64 CI job (cp313/cp314 failed). Swap in automake's copies before
configuring (gotcha 138), the same fix used for libspatialite.
glpk.i at tag 5.0.13 still calls PyInt_Check/PyInt_AsLong (Python 2
only). The riscv64 manylinux image's GCC treats the resulting implicit
declarations as hard errors, failing every interpreter's build.
Upstream fixed this on master (fbf4c5ff2, 2026-09-04) after the 5.0.13
release; backport that single-hunk fix as a patch.
@luhenry
luhenry merged commit 9117f45 into main Sep 7, 2026
11 checks passed
@luhenry
luhenry deleted the swiglpk branch September 7, 2026 16:08
@luhenry luhenry linked an issue Sep 7, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

swiglpk riscv64 support

1 participant