Patch gfan to build on most systems - #4643
Conversation
|
Written by Claude Opus 5, per the AI disclosure above. I made the changes and ran the builds below; @d-torrance reviewed them. What was actually blocking gfan 0.8betaTen separate things, not one. Each row is a distinct reason a build fails, which is why the workarounds linked above ended up being "require an older gfan" rather than a fix:
After these, gfan compiles as C++17 and needs no compiler newer than GCC 7.5. No new dependencies. TBB was already an unconditional link option in gfan's Makefile, so calling it directly adds nothing. The Notes on the M2-side changes
VerifiedEach row is a full gfan build plus
Also through our own machinery: a clean Two gaps worth knowing about:
Not addressed
|
Currently, gfan only builds on systems using a pretty modern gcc, e.g., we've had to use gcc from homebrew on macOS instead of using clang. We've also had to patch gfanInterface on some older systems (RHEL 8/9, Ubuntu 18.04) so that it would accept gfan 0.6 & 0.7 (🫲🤪🫱). However, after the gfanInterface changes at the 2026 Warwick workshop, gfan 0.8 will be a hard requirement. Patch written with significant help from Claude, and also submitted upstream. We also set VLIMIT to be unlimited, as we ran out of memory sometimes running the tests. [ci skip]
|
I had Claude put together a GitHub workflow that builds gfan on a bunch of systems, both before and after the patch, to help with reviewing: |
|
I guess this workflow checks only |
Asked for in review: the matrix showed that the patch makes gfan build and pass its own tests, but said nothing about whether M2 can then use the result. Macaulay2#4643 (comment) A new m2check phase installs a released Macaulay2 from a binary package, the way a user of that system would -- ppa:macaulay2/macaulay2 on Ubuntu, macaulay2.com/Repositories on Debian and Rocky, Macaulay2/tap on macOS -- puts the gfan the patched build just produced where gfanInterface will find it, and runs that package's tests. Every row of the matrix has such a package, on both architectures, so no row has to sit the question out. Nothing is compiled in the new phase, which is the point: M2 comes from a binary, so the only thing that differs from a stock install is the gfan underneath it -- and it is last release's M2, not this branch, since the patch has to work with the M2 people are running. findProgram looks in programPaths first, so that is what m2check.m2 sets; run.sh also moves any gfan in M2's own programs directory aside and puts the new binary at the front of PATH, for the tests that check runs in a subprocess rather than capturing in the same one. If M2 nonetheless resolves gfan somewhere else, the row fails rather than reporting a result about the wrong binary. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
It's easy for Claude! |
In #4268, we started requiring gfan 0.8, with the idea that eventually we'll need some of its new features (and bug fixes!) in the gfanInterface package. Currently, the package still works just fine with older gfan releases like 0.6.2 and 0.7 if you comment out the check. We've had to do this in multiple places like Debian/Ubuntu, spack, RHEL, and nix because currently, 0.8 only compiles on modern systems and only when compiling with GCC.
At the Macaulay2 workshop at Warwick this summer, the package was updated so that we actually will need 0.8 for several features (see #4466), so patching out the version requirement won't work once those changes are merged.
Claude and I worked on a series of patches (also submitted upstream) that enable us to build gfan on most systems using either GCC 7+ or Clang. They're squashed into a single patch to fit our
M2/librariespatch convention.AI Disclosure
Most code was written by Claude after lots of discussion. I'll have it comment below with a summary of changes.
Draft for now to test the buildsBuilds passed!