Skip to content

h5cc -show is not a recognized command #231

@kevinushey

Description

@kevinushey

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
# help@hdfgroup.org.
##

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions