Skip to content

rivet: add through v4.0.2 (incl yoda: add through v2.0.2) - #47383

Merged
vvolkl merged 7 commits into
developfrom
packages/rivet-4.0.2
Nov 6, 2024
Merged

rivet: add through v4.0.2 (incl yoda: add through v2.0.2)#47383
vvolkl merged 7 commits into
developfrom
packages/rivet-4.0.2

Conversation

@wdconinc

@wdconinc wdconinc commented Nov 2, 2024

Copy link
Copy Markdown
Contributor

This PR adds rivet, through v4.0.2. This completes the v3 series and adds the v4 series (which changes the API, uses yoda@2, and adds hdf5 support through highfive). Note that the rivet configure.ac requirements for yoda are not always strict enough: rivet-4 uses Estimate::rmErrs() which was only added in yoda-2.0.1.

Test build (v4):

==> Installing yoda-2.0.2-zjwri2wpwht7vmtwfxr3rxcty2zvy7na [117/118]
==> No binary for yoda-2.0.2-zjwri2wpwht7vmtwfxr3rxcty2zvy7na found: installing from source
==> Fetching https://yoda.hepforge.org/downloads/?f=YODA-2.0.2.tar.bz2
==> No patches needed for yoda
==> yoda: Executing phase: 'autoreconf'
==> yoda: Executing phase: 'configure'
==> yoda: Executing phase: 'build'
==> yoda: Executing phase: 'install'
==> yoda: Successfully installed yoda-2.0.2-zjwri2wpwht7vmtwfxr3rxcty2zvy7na
  Stage: 5.41s.  Autoreconf: 0.00s.  Configure: 6.82s.  Build: 11m 7.14s.  Install: 0.60s.  Post-install: 0.75s.  Total: 11m 21.21s
[+] /opt/software/linux-ubuntu24.10-skylake/gcc-14.2.0/yoda-2.0.2-zjwri2wpwht7vmtwfxr3rxcty2zvy7na
==> Installing rivet-4.0.2-tnblwot3wyad7cogsjfu75vjhq3qlmw5 [118/118]
==> No binary for rivet-4.0.2-tnblwot3wyad7cogsjfu75vjhq3qlmw5 found: installing from source
==> Fetching https://rivet.hepforge.org/downloads/?f=Rivet-4.0.2.tar.bz2
==> No patches needed for rivet
==> rivet: Executing phase: 'autoreconf'
==> rivet: Executing phase: 'configure'
==> rivet: Executing phase: 'build'
==> rivet: Executing phase: 'install'
==> rivet: Successfully installed rivet-4.0.2-tnblwot3wyad7cogsjfu75vjhq3qlmw5
  Stage: 1m 16.16s.  Autoreconf: 8.40s.  Configure: 8.58s.  Build: 18m 34.79s.  Install: 8.97s.  Post-install: 2.45s.  Total: 20m 19.81s
[+] /opt/software/linux-ubuntu24.10-skylake/gcc-14.2.0/rivet-4.0.2-tnblwot3wyad7cogsjfu75vjhq3qlmw5

Test build (v3):

==> Installing yoda-1.9.10-k6xa5shw5nwthdur4wqavdofqibszn4v [105/106]
==> No binary for yoda-1.9.10-k6xa5shw5nwthdur4wqavdofqibszn4v found: installing from source
==> Fetching https://mirror.spack.io/_source-cache/archive/0a/0a708ee9d704945d3387cc437b15ffddf382c70fe5bab39ed2bdbf83c2c28c6f.tar.bz2
==> No patches needed for yoda
==> yoda: Executing phase: 'autoreconf'
==> yoda: Executing phase: 'configure'
==> yoda: Executing phase: 'build'
==> yoda: Executing phase: 'install'
==> yoda: Successfully installed yoda-1.9.10-k6xa5shw5nwthdur4wqavdofqibszn4v
  Stage: 1.08s.  Autoreconf: 0.00s.  Configure: 5.97s.  Build: 1m 57.24s.  Install: 0.26s.  Post-install: 0.70s.  Total: 2m 5.64s
[+] /opt/software/linux-ubuntu24.10-skylake/gcc-14.2.0/yoda-1.9.10-k6xa5shw5nwthdur4wqavdofqibszn4v
==> Installing rivet-3.1.10-2k56b6fuitz6ypugaeqawcrzbd7ers3u [106/106]
==> No binary for rivet-3.1.10-2k56b6fuitz6ypugaeqawcrzbd7ers3u found: installing from source
==> Using cached archive: /opt/spack/cache/_source-cache/archive/45/458b8e0df1de738e9972d24b260eaa087df12c99d4fe9dee5377d47ea6a49919.tar.bz2
==> No patches needed for rivet
==> rivet: Executing phase: 'autoreconf'
==> rivet: Executing phase: 'configure'
==> rivet: Executing phase: 'build'
==> rivet: Executing phase: 'install'
==> rivet: Successfully installed rivet-3.1.10-2k56b6fuitz6ypugaeqawcrzbd7ers3u
  Stage: 4.94s.  Autoreconf: 9.37s.  Configure: 8.40s.  Build: 12m 10.58s.  Install: 9.20s.  Post-install: 2.44s.  Total: 12m 45.41s
[+] /opt/software/linux-ubuntu24.10-skylake/gcc-14.2.0/rivet-3.1.10-2k56b6fuitz6ypugaeqawcrzbd7ers3u

@spackbot-app

spackbot-app Bot commented Nov 2, 2024

Copy link
Copy Markdown

Hi @wdconinc! I noticed that the following package(s) don't yet have maintainers:

  • rivet
  • yoda

Are you interested in adopting any of these package(s)? If so, simply add the following to the package class:

    maintainers("wdconinc")

If not, could you contact the developers of this package and see if they are interested? You can quickly see who has worked on a package with spack blame:

$ spack blame rivet

Thank you for your help! Please don't add maintainers without their consent.

You don't have to be a Spack expert or package developer in order to be a "maintainer," it just gives us a list of users willing to review PRs or debug issues relating to this package. A package can have multiple maintainers; just add a list of GitHub handles of anyone who wants to volunteer.

@vvolkl
vvolkl self-requested a review November 3, 2024 22:51
alalazo
alalazo previously approved these changes Nov 4, 2024
@alalazo alalazo self-assigned this Nov 4, 2024

@alalazo alalazo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Waiting for @vvolkl before merging

@vvolkl

vvolkl commented Nov 5, 2024

Copy link
Copy Markdown
Contributor

Is hepmc=2 still supported? Fails for me:

==> Installing rivet-4.0.2-zpjyndaptak7srgctxgcst4oec4ddteu [72/72]
==> No binary for rivet-4.0.2-zpjyndaptak7srgctxgcst4oec4ddteu found: installing from source
==> Using cached archive: /home/vavolkl/spack/var/spack/cache/_source-cache/archive/65/65a3b36f42bff782ed2767930e669e09b140899605d7972fc8f77785b4a882c0.tar.bz2
==> No patches needed for rivet
==> rivet: Executing phase: 'autoreconf'
==> rivet: Executing phase: 'configure'
==> Error: ProcessError: Command exited with status 1:
    '/tmp/vavolkl/spack-stage/spack-stage-rivet-4.0.2-zpjyndaptak7srgctxgcst4oec4ddteu/spack-src/configure' 'CXXFLAGS=-faligned-new' '--prefix=/home/vavolkl/spack/opt/spack/linux-almalinux9-zen2/gcc-13.1.0/rivet-4.0.2-zpjyndaptak7srgctxgcst4oec4ddteu' '--with-hepmc=/home/vavolkl/spack/opt/spack/linux-almalinux9-zen2/clang-15.0.7/hepmc-2.06.11-4acnfy7jciyv4nkea7d3hasbmkbnnzso' '--with-fastjet=/home/vavolkl/spack/opt/spack/linux-almalinux9-zen2/gcc-13.1.0/fastjet-3.4.2-ddjp4onusktlvgyhidc7dnv5imflqpra' '--with-yoda=/home/vavolkl/spack/opt/spack/linux-almalinux9-zen2/gcc-13.1.0/yoda-2.0.2-7sty6eayf35yldn5nnc2nv3gapi6dequ' '--with-fjcontrib=/home/vavolkl/spack/opt/spack/linux-almalinux9-zen2/gcc-13.1.0/fjcontrib-1.054-yfpxu4ota2czrpizqzux4r7lxiay3jci' '--with-highfive=/home/vavolkl/spack/opt/spack/linux-almalinux9-zen2/gcc-13.1.0/highfive-2.10.0-ywanputp65kzzpfphwx3wg5tjntykkqz' '--disable-pdfmanual'

7 errors found in build log:
     21     libtoolize: copying file 'm4/lt~obsolete.m4'
     22     autoreconf: configure.ac: not using Intltool
     23     autoreconf: configure.ac: not using Gtkdoc
     24     autoreconf: running: aclocal -I /home/vavolkl/spack/opt/spack/linux-almalinux9-zen2/gcc-13.1.0/libtool-2.4.7-kywmjo6cxvucc5uetb4jw7mr2mm3drwb/share/aclocal --force -I m4
     25     autoreconf: running: /home/vavolkl/spack/opt/spack/linux-almalinux9-zen2/gcc-13.1.0/autoconf-2.72-kpvns6ofhwtifkyynwa4rqja5i2kkxp6/bin/autoconf --include=/home/vavolkl/spack/opt/spack/linux-almalinux9-zen2/gcc-13.1.0/l
            ibtool-2.4.7-kywmjo6cxvucc5uetb4jw7mr2mm3drwb/share/aclocal --force
     26     configure.ac:250: warning: The macro 'AC_HAVE_LIBRARY' is obsolete.
  >> 27     configure.ac:250: You should run autoupdate.
  >> 28     /tmp/vavolkl/spack-stage/spack-stage-autoconf-2.72-kpvns6ofhwtifkyynwa4rqja5i2kkxp6/spack-src/lib/autoconf/libs.m4:138: AC_HAVE_LIBRARY is expanded from...
  >> 29     m4/ax_lib_hdf5.m4:93: AX_LIB_HDF5 is expanded from...
  >> 30     configure.ac:250: the top level
     31     autoreconf: running: /home/vavolkl/spack/opt/spack/linux-almalinux9-zen2/gcc-13.1.0/autoconf-2.72-kpvns6ofhwtifkyynwa4rqja5i2kkxp6/bin/autoheader --include=/home/vavolkl/spack/opt/spack/linux-almalinux9-zen2/gcc-13.1.0
            /libtool-2.4.7-kywmjo6cxvucc5uetb4jw7mr2mm3drwb/share/aclocal --force
     32     autoreconf: running: automake --add-missing --copy --force-missing
  >> 33     configure.ac:19: installing './compile'
  >> 34     configure.ac:17: installing './missing'
     35     bin/Makefile.am: installing './depcomp'
     36     autoreconf: './install-sh' is updated
     37     autoreconf: './config.sub' is updated
     38     autoreconf: './config.guess' is updated
     39     autoreconf: Leaving directory '.'
     40     ==> rivet: Executing phase: 'configure'

     ...

     156    configure: Found YODA library at /home/vavolkl/spack/opt/spack/linux-almalinux9-zen2/gcc-13.1.0/yoda-2.0.2-7sty6eayf35yldn5nnc2nv3gapi6dequ/lib/libYODA.so
     157    configure: Found YODA header directory at /home/vavolkl/spack/opt/spack/linux-almalinux9-zen2/gcc-13.1.0/yoda-2.0.2-7sty6eayf35yldn5nnc2nv3gapi6dequ/include
     158    checking for yoda-config... /home/vavolkl/spack/opt/spack/linux-almalinux9-zen2/gcc-13.1.0/yoda-2.0.2-7sty6eayf35yldn5nnc2nv3gapi6dequ/lib/../bin/yoda-config
     159    checking YODA version using yoda-config... 2.0.2
     160    checking YODA Python path using yoda-config... /home/vavolkl/spack/opt/spack/linux-almalinux9-zen2/gcc-13.1.0/yoda-2.0.2-7sty6eayf35yldn5nnc2nv3gapi6dequ/lib/python3.11/site-packages
     161    configure: WARNING: HepMC3 library was not found
  >> 162    configure: error:  HepMC3 is required

@vvolkl

vvolkl commented Nov 5, 2024

Copy link
Copy Markdown
Contributor

But I also had to add this patch for the libpath on hepmc3:

diff --git a/var/spack/repos/builtin/packages/rivet/package.py b/var/spack/repos/builtin/packages/rivet/package.py
index 3bcfcf431f..4082fe5d06 100644
--- a/var/spack/repos/builtin/packages/rivet/package.py
+++ b/var/spack/repos/builtin/packages/rivet/package.py
@@ -118,7 +118,7 @@ def configure_args(self):
             args += ["--with-hepmc=" + self.spec["hepmc"].prefix]
         else:
             args += ["--with-hepmc3=" + self.spec["hepmc3"].prefix]
-            args += ["--with-hepmc3-libpath=" + self.spec["hepmc3"].prefix.lib]
+            args += ["--with-hepmc3-libpath=" + self.spec["hepmc3"].prefix.lib64]
 
         args += ["--with-fastjet=" + self.spec["fastjet"].prefix]
         args += ["--with-yoda=" + self.spec["yoda"].prefix]

I'm happy to approve and fix those issues in a future PR though

@wdconinc

wdconinc commented Nov 5, 2024

Copy link
Copy Markdown
Contributor Author

But I also had to add this patch for the libpath on hepmc3:

I'm worried this is one of those patches that will make it work for fedora, but break for ubuntu. My hepmc3 libs are under lib/, not lib64/.

@wdconinc

wdconinc commented Nov 5, 2024

Copy link
Copy Markdown
Contributor Author

@vvolkl Try with 333bff9 and see if that works for finding the lib64 correctly.

@vvolkl

vvolkl commented Nov 6, 2024

Copy link
Copy Markdown
Contributor

That seems like the best solution indeed, but doesn't work as is because spack doesn't find the libraries of hepmc3:

==> Installing rivet-4.0.2-v6aj56wm76vbyga7puy6pxo3jzfougk7 [72/72]
==> No binary for rivet-4.0.2-v6aj56wm76vbyga7puy6pxo3jzfougk7 found: installing from source
==> Using cached archive: /home/vavolkl/spack/var/spack/cache/_source-cache/archive/65/65a3b36f42bff782ed2767930e669e09b140899605d7972fc8f77785b4a882c0.tar.bz2
==> No patches needed for rivet
==> rivet: Executing phase: 'autoreconf'
==> rivet: Executing phase: 'configure'
==> Error: NoLibrariesError: Unable to recursively locate hepmc3 libraries in /home/vavolkl/spack/opt/spack/linux-almalinux9-zen2/gcc-13.1.0/hepmc3-3.3.0-4y3kffaunmf6723uwcnxt6xb4kgzrxa4

/home/vavolkl/spack/var/spack/repos/builtin/packages/rivet/package.py:126, in configure_args:
        123            args += ["--with-hepmc=" + self.spec["hepmc"].prefix]
        124        else:
        125            args += ["--with-hepmc3=" + self.spec["hepmc3"].prefix]
  >>    126            args += ["--with-hepmc3-libpath=" + self.spec["hepmc3"].libs.directories[0]]
        127
        128        args += ["--with-fastjet=" + self.spec["fastjet"].prefix]
        129        args += ["--with-yoda=" + self.spec["yoda"].prefix]

With this patch everything works:

diff --git a/var/spack/repos/builtin/packages/hepmc3/package.py b/var/spack/repos/builtin/packages/hepmc3/package.py
index 52759ac037..6996be82ca 100644
--- a/var/spack/repos/builtin/packages/hepmc3/package.py
+++ b/var/spack/repos/builtin/packages/hepmc3/package.py
@@ -58,6 +58,12 @@ class Hepmc3(CMakePackage):
     conflicts("%gcc@9.3.0", when="@:3.1.1")
     patch("ba38f14d8f56c16cc4105d98f6d4540c928c6150.patch", when="@3.1.2:3.2.1 %gcc@9.3.0")
 
+
+    @property
+    def libs(self):
+       return find_libraries(["libHepMC3", "libHepMC3Search"], root=self.prefix, recursive=True)
+
+
     def cmake_args(self):
         spec = self.spec
         from_variant = self.define_from_variant

@wdconinc

wdconinc commented Nov 6, 2024

Copy link
Copy Markdown
Contributor Author

With this patch everything works:

Added the libs property to hepmc3.

vvolkl
vvolkl previously approved these changes Nov 6, 2024
@vvolkl

vvolkl commented Nov 6, 2024

Copy link
Copy Markdown
Contributor

@spackbot fix style

@spackbot-app

spackbot-app Bot commented Nov 6, 2024

Copy link
Copy Markdown

Let me see if I can fix that for you!

@spackbot-app

spackbot-app Bot commented Nov 6, 2024

Copy link
Copy Markdown

I was able to run spack style --fix for you!

spack style --fix
==> Running style checks on spack
  selected: isort, black, flake8, mypy
==> Modified files
  var/spack/repos/builtin/packages/hepmc3/package.py
  var/spack/repos/builtin/packages/rivet/package.py
  var/spack/repos/builtin/packages/yoda/package.py
==> Running isort checks
  isort checks were clean
==> Running black checks
reformatted var/spack/repos/builtin/packages/hepmc3/package.py
All done! ✨ 🍰 ✨
1 file reformatted, 2 files left unchanged.
  black checks were clean
==> Running flake8 checks
  flake8 checks were clean
==> Running mypy checks
lib/spack/spack/version/version_types.py:145: error: Argument 2 to "StandardVersion" has incompatible type "*Tuple[Tuple[Any, ...], Tuple[Any, ...]]"; expected "Tuple[Tuple[Any, ...], Tuple[Any, ...]]"  [arg-type]
lib/spack/spack/version/version_types.py:452: error: Argument 2 to "StandardVersion" has incompatible type "*Tuple[Tuple[Any, ...], Tuple[Any, ...]]"; expected "Tuple[Tuple[Any, ...], Tuple[Any, ...]]"  [arg-type]
lib/spack/spack/version/version_types.py:481: error: Argument 2 to "StandardVersion" has incompatible type "*Tuple[Tuple[Any, ...], Tuple[Any, ...]]"; expected "Tuple[Tuple[Any, ...], Tuple[Any, ...]]"  [arg-type]
lib/spack/spack/variant.py:131: error: Unsupported right operand type for in ("Union[Collection[Any], Callable[..., Any]]")  [operator]
Found 4 errors in 2 files (checked 620 source files)
  mypy found errors
Keep in mind that I cannot fix your flake8 or mypy errors, so if you have any you'll need to fix them and update the pull request. If I was able to push to your branch, if you make further changes you will need to pull from your updated branch before pushing again.

I've updated the branch with style fixes.

@vvolkl
vvolkl enabled auto-merge (squash) November 6, 2024 13:06
@vvolkl
vvolkl merged commit ee2723d into develop Nov 6, 2024
@vvolkl
vvolkl deleted the packages/rivet-4.0.2 branch November 6, 2024 16:09
fryeguy52 pushed a commit to fryeguy52/spack that referenced this pull request Dec 17, 2024
* yoda: add v2.0.1, v2.0.2

* rivet: add v3.1.9, v3.1.10, v4.0.0, v4.0.1, v4.0.2

* rivet: yoda@:1 when @:3; conflicts hepmc3@3.3.0 when @:4.0.0

* rivet: fix style

* rivet: hepmc=2 only when @:3; use libs.directories[0]

* hepmc3: def libs

* [@spackbot] updating style on behalf of wdconinc

---------

Co-authored-by: wdconinc <wdconinc@users.noreply.github.com>
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