Skip to content

gromacs: add v2024.4, apple-clang openmp support for 2025+#61

Merged
tldahlgren merged 4 commits intospack:developfrom
mathomp4:spack-pr-47931
Jul 30, 2025
Merged

gromacs: add v2024.4, apple-clang openmp support for 2025+#61
tldahlgren merged 4 commits intospack:developfrom
mathomp4:spack-pr-47931

Conversation

@mathomp4
Copy link
Contributor

@mathomp4 mathomp4 commented Jun 6, 2025

This is a "by-hand" transfer of spack/spack#47931 to spack-packages. The migrate-package-prs script by @haampie didn't work for this because of a conflict.


First up, I mention the maintainers of Gromacs:

I was trying to build Gromacs on my Mac today and when I tried I got the:

        if(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
            message(FATAL_ERROR "The compiler you are using does not support OpenMP parallelism, "
                "Apple has unfortunately explicitly disabled OpenMP in their clang-derived compiler. "
                "You can disable OpenMP in Gromacs with -DGMX_OPENMP=OFF, but instead "
                "we recommend installing the unsupported library distributed by the R "
                "project from https://mac.r-project.org/openmp/ - or switch to gcc.")

error. This is because +openmp is the default variant.

Now, I've seen similar in the past on projects I work on and the solution has been to depend on llvm-openmp. So I added that.

Further build testing showed, though, that the latest version here, 2024.3, was not yet happy as it failed in build with:

  >> 397    clang++: error: unknown argument: '-Xclang -fopenmp'

The issue was that in the verbose output it had in the flags:

...
-mmacosx-version-min=15.0 -fPIC "-Xclang -fopenmp" -Xclang -fopenmp -MD -MT
...

So, I did a bit more testing and did some spack checksum as well and found that gromacs@2024.4 did not work, but gromacs@2025.0-beta did and so did gromacs@main. As there isn't yet an official 2025 version, this is sort of a...PR in waiting.

Now, the one issue is, I don't really know how to run Gromacs1 let alone test if OpenMP is working. So I'm hoping one of the maintainers can try out this change and see if it lets the macOS version of Gromacs use OpenMP.

Echoing what @mabraham did in #47935, I've added a conflict if the version is 2024 or older.

I've also added 2024.4 as...it wasn't there.

Footnotes

  1. I know, sounds odd, but I saw this Macinchem post in my RSS feeds asking about Gromacs and Apple Silicon and, well, spack was right there on my laptop so... 😄

@tldahlgren tldahlgren added the waiting-on-maintainer Waiting on a review from the package maintainer label Jun 10, 2025
Copy link
Contributor

@tldahlgren tldahlgren left a comment

Choose a reason for hiding this comment

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

The syntax has changed. See the suggested fix.

@tldahlgren tldahlgren self-assigned this Jul 7, 2025
Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
@spackbot-app spackbot-app bot added core PR affects Spack core functionality dependencies labels Jul 8, 2025
alalazo
alalazo previously approved these changes Jul 10, 2025
@alalazo alalazo dismissed their stale review July 10, 2025 20:12

Apologies, I thought I was in another tab 😞

Usually, we don't recommend supporting openmp parallelism when using apple-clang. Trying to maintain support for a feature that was deliberately removed from the compiler might have a high maintenance burden.

@mabraham
Copy link
Contributor

I'm a listed maintainer, why can't I approve this?

@mabraham
Copy link
Contributor

@alalazo Thanks for the tip. If openmp and apple-clang causes trouble, I'll revert it. But since we're only supporting the latest of everything maybe it will be ok...

@mathomp4
Copy link
Contributor Author

@alalazo I can close this if you like, in re openmp on apple-clang.

Copy link
Contributor

@tldahlgren tldahlgren left a comment

Choose a reason for hiding this comment

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

Will defer to @alalazo for final decision on this PR being merged.

@tldahlgren tldahlgren removed the waiting-on-maintainer Waiting on a review from the package maintainer label Jul 21, 2025
@tldahlgren
Copy link
Contributor

Will defer to @alalazo for final decision on this PR being merged.

ping @alalazo

@alalazo
Copy link
Member

alalazo commented Jul 30, 2025

Apologies. I missed this ping, but feel free to merge if this seems ready. I really entered this review by accident, thinking I was approving another PR 🙂

The comment above #61 (comment) was really just an "fyi". I didn't meant to block (otherwise I would have used "require changes")

@tldahlgren tldahlgren merged commit a30431e into spack:develop Jul 30, 2025
15 checks passed
hfbauman pushed a commit to hfbauman/spack-packages that referenced this pull request Aug 12, 2025
* gromacs: add v2024.4, apple-clang openmp support for 2025+

* Fix dependency spec

Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>

* Update comment

Co-authored-by: Mark Abraham <Mark.J.Abraham@gmail.com>

---------

Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
Co-authored-by: Mark Abraham <Mark.J.Abraham@gmail.com>
afzpatel pushed a commit to afzpatel/spack-packages that referenced this pull request Aug 12, 2025
* gromacs: add v2024.4, apple-clang openmp support for 2025+

* Fix dependency spec

Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>

* Update comment

Co-authored-by: Mark Abraham <Mark.J.Abraham@gmail.com>

---------

Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
Co-authored-by: Mark Abraham <Mark.J.Abraham@gmail.com>
mladenivkovic pushed a commit to mladenivkovic/spack-packages that referenced this pull request Aug 31, 2025
* gromacs: add v2024.4, apple-clang openmp support for 2025+

* Fix dependency spec

Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>

* Update comment

Co-authored-by: Mark Abraham <Mark.J.Abraham@gmail.com>

---------

Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
Co-authored-by: Mark Abraham <Mark.J.Abraham@gmail.com>
@mathomp4 mathomp4 deleted the spack-pr-47931 branch September 25, 2025 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core PR affects Spack core functionality dependencies update-package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants