Skip to content

Add script to test examples with h5*cc pkg-config wrappers #5486

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

Draft
wants to merge 18 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions HDF5Examples/C/H5G/test-pc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ dumpout() {
$H5DUMP $*
}

return_val=0

$H5CC $srcdir/h5ex_g_create.c -o h5ex_g_create

$ECHO_N "Testing C/H5G/h5ex_g_create...$ECHO_C"
Expand Down
6 changes: 3 additions & 3 deletions HDF5Examples/C/H5VDS/test-pc.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ version_compare() {


topics=""
topics110="vds vds-exc vds-exclim vds-eiger vds-simpleIO vds-percival vds-percival-unlim vds-percival-unlim-maxmin"

topics110="vds vds-exc vds-eiger vds-simpleIO vds-percival vds-percival-unlim vds-percival-unlim-maxmin"
# not tested vds-exclim
return_val=0

version_compare "$H5_LIBVER" "1.10.0"
if [ "$version_lt" = 0 ]; then
for topic in $topics110
do
$H5CC $srcdir/h5ex_d_$topic.c -o h5ex_d_$topic
$H5CC $srcdir/h5ex_$topic.c -o h5ex_$topic
done

for topic in $topics110
Expand Down
8 changes: 7 additions & 1 deletion HDF5Examples/C/HL/test-pc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ verbose=yes
nerrors=0

# HDF5 compile commands, assuming they are in your $PATH.
H5CC=$HDF5_HOME/bin/h5cc
H5CC=$HDF5_HOME/bin/h5hlcc
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is this h5hlcc? We want to test h5cc.

LD_LIBRARY_PATH=$HDF5_HOME/lib
export LD_LIBRARY_PATH

Expand Down Expand Up @@ -81,6 +81,8 @@ version_compare() {
fi
}

#define DATA_FILE1 "image8.txt"
#define DATA_FILE2 "image24pixel.txt"

topics="h5ex_lite3 h5ex_packet_table_FL \
h5ex_image1 h5ex_image2 \
Expand All @@ -96,6 +98,10 @@ do
$H5CC $srcdir/$topic.c -o $topic
done

# h5ex_image2 needs data files
cp $srcdir/tfiles/image8.txt image8.txt
cp $srcdir/tfiles/image24pixel.txt image24pixel.txt

for topic in $topics
do
fname=$topic
Expand Down
35 changes: 35 additions & 0 deletions HDF5Examples/C/test-pc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#! /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 LICENSE 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].

# This file is for use of h5cc created with the CMake process
# HDF5_HOME is expected to be set

srcdir=..
builddir=.
verbose=yes
nerrors=0

# Loop through all subdirectories
for dir in */; do
if [ -d "$dir" ]; then
#check if sysconfig.out exists
if [ -f "$dir/test-pc.sh" ];
then
echo "Entering directory: $dir"
(
cd "$dir" && mkdir "build"
cd "build" && ../test-pc.sh # Execute script in the subdirectory
)
echo "Exiting directory: $dir"
fi
fi
done
35 changes: 35 additions & 0 deletions HDF5Examples/CXX/test-pc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#! /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 LICENSE 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].

# This file is for use of h5cc created with the CMake process
# HDF5_HOME is expected to be set

srcdir=..
builddir=.
verbose=yes
nerrors=0

# Loop through all subdirectories
for dir in */; do
if [ -d "$dir" ]; then
#check if sysconfig.out exists
if [ -f "$dir/test-pc.sh" ];
then
echo "Entering directory: $dir"
(
cd "$dir" && mkdir "build"
cd "build" && ../test-pc.sh # Execute script in the subdirectory
)
echo "Exiting directory: $dir"
fi
fi
done
5 changes: 2 additions & 3 deletions HDF5Examples/FORTRAN/H5D/test-pc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,11 @@ version_compare() {
fi
}

# require h5_version.h generated
# topics="chunk compact extern"

topics="alloc \
checksum \
chunk \
compact \
extern \
fillval \
gzip \
hyper \
Expand Down
1 change: 1 addition & 0 deletions HDF5Examples/FORTRAN/H5G/test-pc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ dumpout() {

return_val=0

$H5FC $srcdir/h5ex_g_create.F90 -o h5ex_g_create

$ECHO_N "Testing FORTRAN/H5G/h5ex_g_create...$ECHO_C"
./h5ex_g_create
Expand Down
4 changes: 2 additions & 2 deletions HDF5Examples/FORTRAN/H5T/test-pc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ do
fname=h5ex_t_$topic
$ECHO_N "Testing FORTRAN/H5T/$fname...$ECHO_C"
exout ./$fname >tmp.test
cmp -s tmp.test $srcdir/tfiles/18/$fname.tst
cmp -s tmp.test $srcdir/tfiles/18/$fname.tstc
status=$?
if test $status -ne 0
then
Expand Down Expand Up @@ -242,7 +242,7 @@ do
return_val=`expr $status + $return_val`
done

$H5FC $srcdir/h5ex_t_convert.F90 -o h5ex_t_convert
#$H5FC $srcdir/h5ex_t_convert.F90 -o h5ex_t_convert

#fname=h5ex_t_convert
#$ECHO_N "Testing FORTRAN/H5T/$fname...$ECHO_C"
Expand Down
2 changes: 1 addition & 1 deletion HDF5Examples/FORTRAN/HL/test-pc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ verbose=yes
nerrors=0

# HDF5 compile commands, assuming they are in your $PATH.
H5FC=$HDF5_HOME/bin/h5fc
H5FC=$HDF5_HOME/bin/h5hlfc
LD_LIBRARY_PATH=$HDF5_HOME/lib
export LD_LIBRARY_PATH

Expand Down
35 changes: 35 additions & 0 deletions HDF5Examples/FORTRAN/test-pc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#! /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 LICENSE 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].

# This file is for use of h5cc created with the CMake process
# HDF5_HOME is expected to be set

srcdir=..
builddir=.
verbose=yes
nerrors=0

# Loop through all subdirectories
for dir in */; do
if [ -d "$dir" ]; then
#check if sysconfig.out exists
if [ -f "$dir/test-pc.sh" ];
then
echo "Entering directory: $dir"
(
cd "$dir" && mkdir "build"
cd "build" && ../test-pc.sh # Execute script in the subdirectory
)
echo "Exiting directory: $dir"
fi
fi
done
3 changes: 2 additions & 1 deletion HDF5Examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ The HDF Group is the developer, maintainer, and steward of HDF5 software. Find m
information about The HDF Group, the HDF5 Community, and other HDF5 software projects,
tools, and services at [The HDF Group's website](https://www.hdfgroup.org/).


The test-pc.sh script can test the examples with the h5*cc pkg-config wrappers with:
export HDF5_HOME="hdf5 installation root"; sh ./test-pc.h

HELP AND SUPPORT
----------------
Expand Down
6 changes: 3 additions & 3 deletions HDF5Examples/config/cmake/grepTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ cmake_policy(SET CMP0007 NEW)
cmake_policy(SET CMP0053 NEW)

# arguments checking
if (NOT TEST_PROGRAM)
if (NOT TEST_PROGRAM) #the program to be run
message (FATAL_ERROR "Require TEST_PROGRAM to be defined")
endif ()
if (NOT TEST_FOLDER)
if (NOT TEST_FOLDER) # this is the folder where the test program is run
message (FATAL_ERROR "Require TEST_FOLDER to be defined")
endif ()
if (NOT TEST_OUTPUT)
if (NOT TEST_OUTPUT) # the output file to capture the test program output
message (FATAL_ERROR "Require TEST_OUTPUT to be defined")
endif ()
if (NOT TEST_REFERENCE)
Expand Down
8 changes: 4 additions & 4 deletions HDF5Examples/config/cmake/runTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ cmake_policy(SET CMP0007 NEW)
cmake_policy(SET CMP0053 NEW)

# arguments checking
if (NOT TEST_PROGRAM)
if (NOT TEST_PROGRAM) #the program to be run
message (FATAL_ERROR "Require TEST_PROGRAM to be defined")
endif ()
if (NOT TEST_FOLDER)
if (NOT TEST_FOLDER) # this is the folder where the test program is run
message (FATAL_ERROR "Require TEST_FOLDER to be defined")
endif ()
if (NOT TEST_OUTPUT)
if (NOT TEST_OUTPUT) # the output file to capture the test program output
message (FATAL_ERROR "Require TEST_OUTPUT to be defined")
endif ()
if (NOT TEST_EXPECT)
Expand Down Expand Up @@ -50,7 +50,7 @@ endif ()

if (TEST_ENV_VAR)
set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}")
message (TRACE "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}")
message (STATUS "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}")
endif ()

if (NOT TEST_INPUT)
Expand Down
35 changes: 35 additions & 0 deletions HDF5Examples/test-pc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#! /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 LICENSE 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].

# This file is for use of h5cc created with the CMake process
# HDF5_HOME is expected to be set

srcdir=..
builddir=.
verbose=yes
nerrors=0

mkdir "build"
# Loop through all subdirectories
for dir in */; do
if [ -d "$dir" ]; then
#check if sysconfig.out exists
if [ -f "$dir/test-pc.sh" ];
then
echo "Entering directory: $dir"
(
cd "$dir" && ./test-pc.sh # Execute script in the subdirectory
)
echo "Exiting directory: $dir"
fi
fi
done
3 changes: 1 addition & 2 deletions config/libhdf5.fpc.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ Name: @_PKG_CONFIG_LIBNAME@
Description: HDF5 (Hierarchical Data Format 5) Software Library
Version: @_PKG_CONFIG_VERSION@

Cflags: -I${includedir}
Fflags: -I${moddir}
Cflags: -I${includedir} -I${moddir}
Libs: -L${libdir} @_PKG_CONFIG_SH_LIBS@
Requires: @_PKG_CONFIG_REQUIRES@
Libs.private: @_PKG_CONFIG_LIBS@ @_PKG_CONFIG_LIBS_PRIVATE@
Expand Down
Loading