Skip to content

pythia8: Include patch for C++20 / Clang - #47400

Merged
wdconinc merged 5 commits into
spack:developfrom
paulgessinger:pythia-cpp20-patch
Nov 5, 2024
Merged

pythia8: Include patch for C++20 / Clang#47400
wdconinc merged 5 commits into
spack:developfrom
paulgessinger:pythia-cpp20-patch

Conversation

@paulgessinger

@paulgessinger paulgessinger commented Nov 4, 2024

Copy link
Copy Markdown
Contributor

Pythia8 vendors some FJCore sources that are as of Pythia8 312 incompatible with C++20 on clang. This adds a patch that makes it compatible in these scenarios.
Related issue on the Pythia repository: https://gitlab.com/Pythia8/releases/-/issues/523

This PR:

  • Moves the existing modification of configure to generate a modified Makefile from a patch function to the already existing function being run before the configure step
    • This is needed because defining a patch function prevents using patch() in the class (as far as I can tell)
  • Adds patches for %clang and %appleclang when cxxstd=20 and `@:8312

Compilation on linux:

$ spack install pythia8@8.312%clang cxxstd=20
==> Installing pythia8-8.312-zxo6h4jqqw4yjgzzythtyehp2yyzjvws [14/14]
==> No binary for pythia8-8.312-zxo6h4jqqw4yjgzzythtyehp2yyzjvws found: installing from source
==> Using cached archive: /scratch/pagessin/spack-test/spack/var/spack/cache/_source-cache/archive/ba/bad98e2967b687046c4568c9091d630a0c31b628745c021a994aba4d1d50f8ea.tgz
==> Applied patch /scratch/pagessin/spack-test/spack/var/spack/repos/builtin/packages/pythia8/pythia8-cpp20-fjcore-forward-decl.patch
==> pythia8: Executing phase: 'autoreconf'
==> pythia8: Executing phase: 'configure'
==> pythia8: Executing phase: 'build'
==> pythia8: Executing phase: 'install'
==> pythia8: Successfully installed pythia8-8.312-zxo6h4jqqw4yjgzzythtyehp2yyzjvws
  Stage: 0.48s.  Autoreconf: 0.00s.  Configure: 1.52s.  Build: 30.28s.  Install: 0.60s.  Post-install: 0.29s.  Total: 33.33s
[+] /scratch/pagessin/spack-test/spack/opt/spack/linux-almalinux9-zen2/clang-17.0.6/pythia8-8.312-zxo6h4jqqw4yjgzzythtyehp2yyzjvws

Compilation on macOS:

$ spack install pythia8@8.312 cxxstd=20
==> Installing pythia8-8.312-otexj543luj3kaglxp2hlxx3ojiz2wfh [13/13]
==> No binary for pythia8-8.312-otexj543luj3kaglxp2hlxx3ojiz2wfh found: installing from source
==> Using cached archive: /Users/pagessin/spack/var/spack/cache/_source-cache/archive/ba/bad98e2967b687046c4568c9091d630a0c31b628745c021a994aba4d1d50f8ea.tgz
==> Applied patch /Users/pagessin/spack/var/spack/repos/builtin/packages/pythia8/pythia8-cpp20-fjcore-forward-decl.patch
==> pythia8: Executing phase: 'autoreconf'
==> pythia8: Executing phase: 'configure'
==> pythia8: Executing phase: 'build'
==> pythia8: Executing phase: 'install'
==> pythia8: Successfully installed pythia8-8.312-otexj543luj3kaglxp2hlxx3ojiz2wfh
  Stage: 0.40s.  Autoreconf: 0.00s.  Configure: 2.90s.  Build: 48.19s.  Install: 1.22s.  Post-install: 0.19s.  Total: 53.05s
[+] /Users/pagessin/spack/opt/spack/darwin-sequoia-m1/apple-clang-15.0.0/pythia8-8.312-otexj543luj3kaglxp2hlxx3ojiz2wfh

Pythia8 vendors some FJCore sources that are as of Pythia8 312
incompatible with C++20 on clang. This adds a patch that makes it
compatible in these scenarios
@paulgessinger

Copy link
Copy Markdown
Contributor Author

fyi @vvolkl

vvolkl
vvolkl previously approved these changes Nov 4, 2024

@vvolkl vvolkl 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.

Very nice, thanks!

Comment thread var/spack/repos/builtin/packages/pythia8/package.py Outdated
@wdconinc
wdconinc merged commit f8da72c into spack:develop Nov 5, 2024
@paulgessinger
paulgessinger deleted the pythia-cpp20-patch branch November 5, 2024 05:51
fryeguy52 pushed a commit to fryeguy52/spack that referenced this pull request Dec 17, 2024
* pythia8: Include patch for C++20 / Clang

Pythia8 vendors some FJCore sources that are as of Pythia8 312
incompatible with C++20 on clang. This adds a patch that makes it
compatible in these scenarios

* Add issue link

* rename setup_cxxstd function

* Remove an accidental printout

* Apply patch to all compilers, add lower bound
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants