Skip to content

gfan: add v0.8beta - #6090

Open
d-torrance wants to merge 3 commits into
spack:developfrom
d-torrance:gfan
Open

gfan: add v0.8beta#6090
d-torrance wants to merge 3 commits into
spack:developfrom
d-torrance:gfan

Conversation

@d-torrance

Copy link
Copy Markdown
Contributor

We add gfan 0.8beta, which is required for Macaulay2 1.26.06. Previously, we patched Macaulay2 to allow for an older gfan, but this won't work soon, as likely at the next release there will be features that require the new version.

This version of gfan doesn't build on machines w/o a new-ish version of GCC (and GCC specifically, so no Clang at all), so we add a patch (also submitted upstream) that makes this possible. (AI Disclosure: Claude 🤖 wrote the patch with lots of oversight from me.) See Macaulay2/M2#4643 for more specifics about what the patch contains.

We also drop the old Macaulay2 patch and instead tell it to depend on this new version. (I hope this is okay -- this is the first time I've proposed updating two packages in one PR, but they naturally fit together.)

@spackbot-triage spackbot-triage Bot added new-version Modifications to packages' `depends_on()` directives dependencies Modifications with a `depends_on()` directive patch Modifications to packages' sets of defined patches update-package Modifications to packages in the repository labels Aug 13, 2026
@bernhardkaindl
bernhardkaindl requested a lite review from Copilot August 14, 2026 09:11
@bernhardkaindl

Copy link
Copy Markdown
Contributor

@d-torrance, I requrested a light copilot review just do see what it says.

It should be better than in the past, but still take care, it might still hallucinate convincingly!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Spack’s package recipes to introduce gfan version 0.8beta (needed for macaulay2@1.26.06) and adjusts macaulay2 to use the newer gfan instead of carrying a local patch to relax the gfan minimum version.

Changes:

  • Add gfan@0.8beta with a new patch to broaden compiler/toolchain compatibility and add a tbb dependency for that version.
  • Update macaulay2@1.26.06: to require gfan@0.8beta: and drop the prior allow-older-gfan.patch.
  • Remove repos/spack_repo/builtin/packages/macaulay2/allow-older-gfan.patch from the package.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
repos/spack_repo/builtin/packages/macaulay2/package.py Constrains gfan dependency for macaulay2@1.26.06: and removes the older local workaround patch.
repos/spack_repo/builtin/packages/macaulay2/allow-older-gfan.patch Deleted patch that previously relaxed Macaulay2’s gfan version check.
repos/spack_repo/builtin/packages/gfan/package.py Adds gfan@0.8beta, tbb dependency for that version, and applies the compatibility patch.
repos/spack_repo/builtin/packages/gfan/compile-on-more-systems-0.8beta.patch Upstream-style patch to make gfan@0.8beta build on more compilers/platforms (notably macOS/clang and older GCC).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +42 to +45
@property
def build_targets(self):
return [f"CXX={spack_cxx}"]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! This is an also an issue for cddlib and gmp. I just force-pushed a new version of this commit setting these flags

We also include a patch from that allows it to build using a much wider
variety of compilers.

Also we pass a bunch of variables to make:
* CXX, or the Makefile would overwrite it with "g++"
* Drop flag_handler and move the flags we set there to build_targets
  for consistency.
* The rest are noops in Linux, but in macOS, the Makefile would have
  us looking for Homebrew packages for the dependencies.
Now that gfan 0.8beta is available, then we can just depend on it
rather than patching out the check for it.  (Furthermore, we'll
actually need it soon as the gfanInterface package is being updated to
add 0.8-only features.)
It now includes a FreeBSD to fix the build on Clang 19+:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282851
@d-torrance

d-torrance commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

I just pushed one more commit - the v0.6.2 builds were failing on macos due to a known bug (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282851) when compiling w/ Clang 19+.

The patch we were already using for 0.6.2 from the Macaulay2 repo had already been updated to include the FreeBSD patch, so I just bumped the commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Modifications with a `depends_on()` directive new-version Modifications to packages' `depends_on()` directives patch Modifications to packages' sets of defined patches update-package Modifications to packages in the repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants