From 3c7e11c034b8646d67380789a827709347f45754 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 14 Oct 2021 06:30:49 -0700 Subject: Reverts rename of SWMR VFD check program, which causes CMake issues --- MANIFEST | 2 +- hl/tools/h5watch/CMakeLists.txt | 23 +++++++++++++++++ hl/tools/h5watch/CMakeTests.cmake | 2 +- hl/tools/h5watch/Makefile.am | 4 +-- hl/tools/h5watch/testh5watch.sh.in | 2 +- test/CMakeLists.txt | 1 + test/CMakeTests.cmake | 2 ++ test/Makefile.am | 2 +- test/ShellTests.cmake | 2 +- test/swmr_check_compat_vfd.c | 53 ++++++++++++++++++++++++++++++++++++++ test/test_usecases.sh.in | 2 +- test/testflushrefresh.sh.in | 2 +- test/testswmr.sh.in | 2 +- test/testvdsswmr.sh.in | 2 +- utils/CMakeLists.txt | 25 ------------------ utils/Makefile.am | 2 +- utils/swmr_compat_vfd.c | 53 -------------------------------------- 17 files changed, 91 insertions(+), 90 deletions(-) create mode 100644 test/swmr_check_compat_vfd.c delete mode 100644 utils/swmr_compat_vfd.c diff --git a/MANIFEST b/MANIFEST index 4f067b1..c46f6a1 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1302,6 +1302,7 @@ ./test/stab.c ./test/swmr.c ./test/swmr_addrem_writer.c +./test/swmr_check_compat_vfd.c ./test/swmr_common.c ./test/swmr_common.h ./test/swmr_generator.c @@ -2979,7 +2980,6 @@ # Utils directory ./utils/Makefile.am -./utils/swmr_compat_vfd.c ./utils/vds_elink_compat_vol.c # Mirror VFD utilities diff --git a/hl/tools/h5watch/CMakeLists.txt b/hl/tools/h5watch/CMakeLists.txt index 1ab473d..be983ba 100644 --- a/hl/tools/h5watch/CMakeLists.txt +++ b/hl/tools/h5watch/CMakeLists.txt @@ -40,6 +40,29 @@ if (HDF5_ENABLE_FORMATTERS) endif () if (BUILD_TESTING AND HDF5_TEST_SWMR AND HDF5_TEST_SERIAL) + #-- Add swmr_check_compat_vfd program + set (hl_swmr_check_compat_vfd_SOURCES + ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/swmr_check_compat_vfd.c + ) + add_executable (hl_swmr_check_compat_vfd ${hl_swmr_check_compat_vfd_SOURCES}) + target_compile_options(hl_swmr_check_compat_vfd PRIVATE "${HDF5_CMAKE_C_FLAGS}") + target_include_directories (hl_swmr_check_compat_vfd PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + if (NOT ONLY_SHARED_LIBS) + TARGET_C_PROPERTIES (hl_swmr_check_compat_vfd STATIC) + target_link_libraries (hl_swmr_check_compat_vfd PRIVATE ${HDF5_LIB_TARGET}) + else () + TARGET_C_PROPERTIES (hl_swmr_check_compat_vfd SHARED) + target_link_libraries (hl_swmr_check_compat_vfd PRIVATE ${HDF5_LIBSH_TARGET}) + endif () + set_target_properties (hl_swmr_check_compat_vfd PROPERTIES FOLDER tools/hl) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_TOOLS_H5WATCH_hl_swmr_check_compat_vfd_FORMAT hl_swmr_check_compat_vfd) + endif () + #-- Add extend_dset program set (extend_dset_SOURCES ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/extend_dset.c diff --git a/hl/tools/h5watch/CMakeTests.cmake b/hl/tools/h5watch/CMakeTests.cmake index dbda07f..60c099b 100644 --- a/hl/tools/h5watch/CMakeTests.cmake +++ b/hl/tools/h5watch/CMakeTests.cmake @@ -149,7 +149,7 @@ add_custom_target(H5WATCH_files ALL COMMENT "Copying files needed by H5WATCH tes # Check to see if the VFD specified by the HDF5_DRIVER environment variable # supports SWMR. -set (SWMR_INCOMPAT ${swmr_compat_vfd}) +set (SWMR_INCOMPAT ${hl_swmr_check_compat_vfd}) if (NOT SWMR_INCOMPAT) # Remove any output file left over from previous test run diff --git a/hl/tools/h5watch/Makefile.am b/hl/tools/h5watch/Makefile.am index b569214..5112965 100644 --- a/hl/tools/h5watch/Makefile.am +++ b/hl/tools/h5watch/Makefile.am @@ -24,7 +24,7 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib -I$(top_srcdir)/hl/sr # These are our main targets, the tools bin_PROGRAMS=h5watch -noinst_PROGRAMS= +noinst_PROGRAMS=swmr_check_compat_vfd # Add h5watch specific linker flags here h5watch_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) @@ -37,7 +37,7 @@ if BUILD_TESTS_CONDITIONAL AM_CPPFLAGS+=-I$(top_srcdir)/hl/test TEST_SCRIPT=testh5watch.sh check_SCRIPTS=$(TEST_SCRIPT) - SCRIPT_DEPEND=extend_dset$(EXEEXT) h5watch$(EXEEXT) + SCRIPT_DEPEND=swmr_check_compat_vfd$(EXEEXT) extend_dset$(EXEEXT) h5watch$(EXEEXT) noinst_PROGRAMS+=h5watchgentest extend_dset # Add extend_dset specific preprocessor flags here # (add the main test subdirectory to the include file path) diff --git a/hl/tools/h5watch/testh5watch.sh.in b/hl/tools/h5watch/testh5watch.sh.in index 72e4140..67ffcc3 100644 --- a/hl/tools/h5watch/testh5watch.sh.in +++ b/hl/tools/h5watch/testh5watch.sh.in @@ -16,7 +16,7 @@ # Check to see if the VFD specified by the HDF5_DRIVER environment variable # supports SWMR. -../../../utils/swmr_compat_vfd +./swmr_check_compat_vfd rc=$? if [ $rc != 0 ] ; then echo diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 4efe087..1461101 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -617,6 +617,7 @@ endif () set (H5_SWMR_TESTS swmr_addrem_writer + swmr_check_compat_vfd swmr_generator swmr_reader swmr_remove_reader diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index b2ed8e8..c537f37 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -879,6 +879,8 @@ if (ENABLE_EXTENDED_TESTS) # testswmr.sh: swmr* # testvdsswmr.sh: vds_swmr* +# add_test (NAME H5Test-swmr_check_compat_vfd COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) + #-- Adding test for flushrefresh file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/flushrefresh_test") if (H5_PERL_FOUND) diff --git a/test/Makefile.am b/test/Makefile.am index b55a0fd..f6ede6f 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -91,7 +91,7 @@ check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version \ use_append_chunk use_append_chunk_mirror use_append_mchunks use_disable_mdc_flushes \ swmr_generator swmr_start_write swmr_reader swmr_writer swmr_remove_reader \ swmr_remove_writer swmr_addrem_writer swmr_sparse_reader swmr_sparse_writer \ - vds_env vds_swmr_gen vds_swmr_reader vds_swmr_writer \ + swmr_check_compat_vfd vds_env vds_swmr_gen vds_swmr_reader vds_swmr_writer \ mirror_vfd if HAVE_SHARED_CONDITIONAL check_PROGRAMS+= filter_plugin vfd_plugin vol_plugin diff --git a/test/ShellTests.cmake b/test/ShellTests.cmake index 4074299..9614152 100644 --- a/test/ShellTests.cmake +++ b/test/ShellTests.cmake @@ -37,7 +37,7 @@ if (UNIX) #shell script creates dir #file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/swmr_test") add_custom_command ( - TARGET output_filter.sh + TARGET swmr_check_compat_vfd POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different "${HDF5_SOURCE_DIR}/bin/output_filter.sh" "${HDF5_TEST_BINARY_DIR}/H5TEST/bin/output_filter.sh" diff --git a/test/swmr_check_compat_vfd.c b/test/swmr_check_compat_vfd.c new file mode 100644 index 0000000..720c747 --- /dev/null +++ b/test/swmr_check_compat_vfd.c @@ -0,0 +1,53 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* Purpose: This is a small program that checks if the HDF5_DRIVER + * environment variable is set to a value that supports SWMR. + * + * It is intended for use in shell scripts. + */ + +#include "h5test.h" + +/* This file needs to access the file driver testing code */ +#define H5FD_FRIEND /*suppress error about including H5FDpkg */ +#define H5FD_TESTING +#include "H5FDpkg.h" /* File drivers */ + +/*------------------------------------------------------------------------- + * Function: main + * + * Purpose: Inspects the HDF5_DRIVER environment variable, which + * determines the VFD that the test harness will use with + * the majority of the tests. + * + * Return: VFD supports SWMR: EXIT_SUCCESS + * + * VFD does not support SWMR + * or failure: EXIT_FAILURE + * + *------------------------------------------------------------------------- + */ +int +main(void) +{ + char *driver = NULL; + + driver = HDgetenv(HDF5_DRIVER); + + if (H5FD__supports_swmr_test(driver)) + return EXIT_SUCCESS; + else + return EXIT_FAILURE; + +} /* end main() */ diff --git a/test/test_usecases.sh.in b/test/test_usecases.sh.in index 7ba5583..cd2e65e 100644 --- a/test/test_usecases.sh.in +++ b/test/test_usecases.sh.in @@ -36,7 +36,7 @@ fi # Check to see if the VFD specified by the HDF5_DRIVER environment variable # supports SWMR. -../utils/swmr_compat_vfd +./swmr_check_compat_vfd rc=$? if [[ $rc != 0 ]] ; then echo diff --git a/test/testflushrefresh.sh.in b/test/testflushrefresh.sh.in index b58799a..83685e8 100644 --- a/test/testflushrefresh.sh.in +++ b/test/testflushrefresh.sh.in @@ -65,7 +65,7 @@ fi # Check to see if the VFD specified by the HDF5_DRIVER environment variable # supports SWMR. -../utils/swmr_compat_vfd +./swmr_check_compat_vfd rc=$? if [ $rc -ne 0 ] ; then echo diff --git a/test/testswmr.sh.in b/test/testswmr.sh.in index 0ae554c..9085306 100644 --- a/test/testswmr.sh.in +++ b/test/testswmr.sh.in @@ -110,7 +110,7 @@ fi # Check to see if the VFD specified by the HDF5_DRIVER environment variable # supports SWMR. -../utils/swmr_compat_vfd +./swmr_check_compat_vfd rc=$? if [ $rc -ne 0 ] ; then echo diff --git a/test/testvdsswmr.sh.in b/test/testvdsswmr.sh.in index a1225a2..f4bcd77 100644 --- a/test/testvdsswmr.sh.in +++ b/test/testvdsswmr.sh.in @@ -96,7 +96,7 @@ fi # Check to see if the VFD specified by the HDF5_DRIVER environment variable # supports SWMR. -../utils/swmr_compat_vfd +./swmr_check_compat_vfd rc=$? if [ $rc -ne 0 ] ; then echo diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index b79191f..5fddf90 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -4,31 +4,6 @@ project (HDF5_UTILS C) add_subdirectory (mirror_vfd) #----------------------------------------------------------------------------- -# Add the swmr_compat_vfd executable -#----------------------------------------------------------------------------- - -set (swmr_compat_vfd_SOURCES ${HDF5_UTILS_SOURCE_DIR}/swmr_compat_vfd.c) -add_executable (swmr_compat_vfd ${swmr_compat_vfd_SOURCES}) -target_include_directories (swmr_compat_vfd PRIVATE "${HDF5_UTILS_DIR};${HDF5_SRC_DIR};${HDF5_TEST_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") -if (NOT BUILD_SHARED_LIBS) - TARGET_C_PROPERTIES (swmr_compat_vfd STATIC) - target_link_libraries (swmr_compat_vfd PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -else () - TARGET_C_PROPERTIES (swmr_compat_vfd SHARED) - target_link_libraries (swmr_compat_vfd PRIVATE ${HDF5_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET}) -endif () -set_target_properties (swmr_compat_vfd PROPERTIES FOLDER utils) -set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};swmr_compat_vfd") -set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} swmr_compat_vfd) - -#----------------------------------------------------------------------------- -# Add Target to clang-format -#----------------------------------------------------------------------------- -if (HDF5_ENABLE_FORMATTERS) - clang_format (HDF5_UTILS_FORMAT swmr_compat_vfd) -endif () - -#----------------------------------------------------------------------------- # Add the vds_elink_compat_vol executable #----------------------------------------------------------------------------- diff --git a/utils/Makefile.am b/utils/Makefile.am index 0f66c89..9185457 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -25,7 +25,7 @@ SUBDIRS=mirror_vfd AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_builddir)/src -I$(top_srcdir)/test -noinst_PROGRAMS = vds_elink_compat_vol swmr_compat_vfd +bin_PROGRAMS = vds_elink_compat_vol # All programs depend on the hdf5 library LDADD=$(LIBH5TEST) $(LIBHDF5) diff --git a/utils/swmr_compat_vfd.c b/utils/swmr_compat_vfd.c deleted file mode 100644 index 720c747..0000000 --- a/utils/swmr_compat_vfd.c +++ /dev/null @@ -1,53 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * 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. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* Purpose: This is a small program that checks if the HDF5_DRIVER - * environment variable is set to a value that supports SWMR. - * - * It is intended for use in shell scripts. - */ - -#include "h5test.h" - -/* This file needs to access the file driver testing code */ -#define H5FD_FRIEND /*suppress error about including H5FDpkg */ -#define H5FD_TESTING -#include "H5FDpkg.h" /* File drivers */ - -/*------------------------------------------------------------------------- - * Function: main - * - * Purpose: Inspects the HDF5_DRIVER environment variable, which - * determines the VFD that the test harness will use with - * the majority of the tests. - * - * Return: VFD supports SWMR: EXIT_SUCCESS - * - * VFD does not support SWMR - * or failure: EXIT_FAILURE - * - *------------------------------------------------------------------------- - */ -int -main(void) -{ - char *driver = NULL; - - driver = HDgetenv(HDF5_DRIVER); - - if (H5FD__supports_swmr_test(driver)) - return EXIT_SUCCESS; - else - return EXIT_FAILURE; - -} /* end main() */ -- cgit v0.12