Skip to content

Set HDF5_DIR as environment variable during YODA build#5942

Closed
jackal1-66 wants to merge 1 commit intoalisw:masterfrom
jackal1-66:yodahdf5fix
Closed

Set HDF5_DIR as environment variable during YODA build#5942
jackal1-66 wants to merge 1 commit intoalisw:masterfrom
jackal1-66:yodahdf5fix

Conversation

@jackal1-66
Copy link
Copy Markdown
Contributor

h5cc sets the include directory in yoda-config which is used later to set cppflags in Rivet. the dailytag is wrongly taken when building in docker/CI, so the folder must be correctly set at building time.
Not clear why this was working before. An update somewhere must have had an effect here (no updates since a month on Rivet, hdf5, Yoda and GMP).

@jackal1-66 jackal1-66 requested a review from a team as a code owner July 9, 2025 14:50
@ktf
Copy link
Copy Markdown
Member

ktf commented Jul 9, 2025

This will not do what you claim it does. It will set HDF5_DIR for all the yoda dependencies, not for yoda itself. What should be done to properly handle relocation is that Rivet finds out about HDF5 by itself, not by relying on YODA. Not doing so will break dependencies whenever YODA and HDF5 are built separately.

@jackal1-66
Copy link
Copy Markdown
Contributor Author

From what I saw in the source code of YODA the main issue is that HDF5_CPPFLAGS is replaced in yoda-config with the output of h5cc --show at build time. I tested the --with-h5df option for Rivet and it does not seem to be recognised. However hdf5 is automatically pulled to build as an additional compatibility package. @ktf do you have any idea why everything seemed to work fine before? I'm a bit puzzled by this...

@ktf
Copy link
Copy Markdown
Member

ktf commented Jul 9, 2025

Yes, everything works fine as long as YODA and HDF5 are built at the same time. The recent PR #5941 triggered a rebuild of YODA, but not HDF5, exposing the issue. The bottomline is that for being properly relocatable and able to build independently, packages should not cache the paths of their dependencies. The correct fix is to get --with-h5df work in Rivet. All the other changes to YODA will break next time we touch GMP or similar.

@ktf
Copy link
Copy Markdown
Member

ktf commented Jul 9, 2025

Can't we simply set H5DF_DIR inside the rivet recipe?

@jackal1-66
Copy link
Copy Markdown
Contributor Author

Unfortunately this won't work. Because the include path is generated from the yoda-config executable:

  YODACPPFLAGS=`$YODACONFIG --cppflags`
  YODALIBS=`$YODACONFIG --libs`
  AC_MSG_RESULT([$YODA_PYTHONPATH])
fi
AC_SUBST(YODALIBS)
AC_SUBST(YODACPPFLAGS)
AC_SUBST(YODA_PYTHONPATH)

## HDF5
AC_ARG_ENABLE([h5], [AS_HELP_STRING([--disable-h5],[disable H5 extension  @<:@default=build@:>@])], [], [with_h5=yes])
if test "x$with_h5" = "xyes"; then
  oldCPPFLAGS=$CPPFLAGS
  CPPFLAGS="$CPPFLAGS $YODACPPFLAGS"

@ktf
Copy link
Copy Markdown
Member

ktf commented Jul 10, 2025

Can't we set CPPFLAGS like we do for LDFLAGS?

@jackal1-66
Copy link
Copy Markdown
Contributor Author

Closing. Fixed with #5948 and #5953

@jackal1-66 jackal1-66 closed this Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants