Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

h5cc -show is not a recognized command #231

Open
kevinushey opened this issue Oct 30, 2024 · 1 comment
Open

h5cc -show is not a recognized command #231

kevinushey opened this issue Oct 30, 2024 · 1 comment

Comments

@kevinushey
Copy link

rhdf5 tries to run h5cc -show in its configure script, in order to determine the libraries to be used:

HDF5_LIBS=`${H5CC} -show | ${GREP} -o " \-[lL][^[:space:]]\+" | tr "\n" " "`

Unfortunately, this doesn't appear to be a supported option. I see:

$ /opt/homebrew/bin/h5cc -show
/opt/homebrew/h5cc
dir is /opt/homebrew
clang: error: unknown argument: '-show'

This is on macOS, with hdf5 1.14.4.3 installed from Homebrew. My guess is that the intention here is to read the variables reported via pkg-config, but those could also just be read by rhdf5 using pkg-config directly:

$ pkg-config --cflags --libs hdf5
-I/opt/homebrew/Cellar/hdf5/1.14.4.3/include -L/opt/homebrew/Cellar/hdf5/1.14.4.3/lib -lhdf5

For reference, this is the contents of my h5cc script, which is as-is from Homebrew:

#! /bin/sh
##
# Copyright by The HDF Group.
# All rights reserved.
#
# This file is part of HDF5.  The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# [email protected].
##

prg=$0
if [ ! -e "$prg" ]; then
  case $prg in
    (*/*) exit 1;;
    (*) prg=$(command -v -- "$prg") || exit;;
  esac
fi
dir=$(
  cd -P -- "$(dirname -- "$prg")/.." && pwd -P
) || exit
prg=$dir/$(basename -- "$prg") || exit

printf '%s\n' "$prg"
printf 'dir is %s\n' "$dir"


# Show the configuration summary of the library recorded in the
# libhdf5.settings file residing in the lib directory.
showconfigure()
{
  cat $dir/lib/libhdf5.settings
  status=$?
}

export PKG_CONFIG_PATH=$dir/lib/pkgconfig

for arg in $@ ; do
  case "$arg" in
    -showconfig)
      showconfigure
      exit $status
      ;;
    *)
      clang $@ `pkg-config --define-variable=prefix=$dir --cflags --libs hdf5`
      status=$?
      exit $status
      ;;
  esac
done

It's possible that the issue here lies with Homebrew, since as far as I can see the h5cc source script is quite a bit more fully-featured...

https://github.com/HDFGroup/hdf5/blob/develop/bin/h5cc.in

@kevinushey
Copy link
Author

It looks like this is an issue with this specific version of hdf5. There are two input scripts, h5cc.in and libh5cc.in, and the latter is apparently chosen / used for installation here. That script is indeed missing handling for -show. The fix was made here:

HDFGroup/hdf5@6fa09bd#diff-9234b02fa3d31d92123597ace8a2a87086966f2ced5c7a9a1a23cafaeac5a1ff

but I'm not sure if that's made it's way into any hdf5 releases yet.

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

No branches or pull requests

1 participant