From 4906d3d6a82e1dcc10bae150a1e0dc9bbc890259 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 25 Feb 2020 14:57:02 -0600 Subject: Fix standalone link --- tools/src/h5repack/h5repack_refs.c | 6 +++--- tools/test/h5dump/h5dumpgentest.c | 3 ++- tools/test/misc/h5clear_gentest.c | 2 +- tools/test/perform/CMakeLists.txt | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c index 54fe1f2..2685823 100644 --- a/tools/src/h5repack/h5repack_refs.c +++ b/tools/src/h5repack/h5repack_refs.c @@ -530,14 +530,14 @@ static int copy_refs_attr(hid_t loc_in, ref_comp_size = NULL; } } - /* This line below needs to be moved in this loop instead of inserting outside. Otherwise, - ref_comp_field_n may be >0 for the next attribute, which may not be + /* This line below needs to be moved in this loop instead of inserting outside. Otherwise, + ref_comp_field_n may be >0 for the next attribute, which may not be the reference type and will be accidently treated as the reference type. It will then cause the H5Acreate2 failed since that attribute is already created. KY 2020-02-07 */ is_ref_comp = (ref_comp_field_n > 0); - + } diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index d72664e..550b182 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -6312,7 +6312,7 @@ static int gent_ldouble(void) return 0; - error: +error: HDprintf("error !\n"); return -1; @@ -7567,6 +7567,7 @@ gent_attr_intsize(void) H5Gclose(root); H5Fclose(fid); } + static void gent_nodata(void) { diff --git a/tools/test/misc/h5clear_gentest.c b/tools/test/misc/h5clear_gentest.c index 1411c21..d5f415e 100644 --- a/tools/test/misc/h5clear_gentest.c +++ b/tools/test/misc/h5clear_gentest.c @@ -170,7 +170,7 @@ gen_enhance_files(hbool_t user) hid_t did = H5I_INVALID_HID; /* Dataset ID */ hsize_t dim[1]; /* Dimension sizes */ int data[NUM_ELMTS]; /* Buffer for data */ - int fd = -1; /* The file descriptor ID */ + int fd = H5I_INVALID_HID; /* The file descriptor ID */ int64_t eoa; /* The EOA value */ uint32_t chksum; /* The chksum value */ int i = 0 , j = 0, u = 0; /* Local index variable */ diff --git a/tools/test/perform/CMakeLists.txt b/tools/test/perform/CMakeLists.txt index 3dda45c..6780c06 100644 --- a/tools/test/perform/CMakeLists.txt +++ b/tools/test/perform/CMakeLists.txt @@ -179,10 +179,10 @@ if (H5_HAVE_PARALLEL AND HDF5_TEST_PARALLEL) target_include_directories (h5perf_alone PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TOOLS_DIR}/lib;$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (h5perf_alone STATIC) - target_link_libraries (h5perf_alone PRIVATE ${HDF5_LIB_TARGET} "$<$:${MPI_C_LIBRARIES}>") + target_link_libraries (h5perf_alone PRIVATE ${HDF5_LIB_TARGET} ${LINK_LIBS} "$<$:${MPI_C_LIBRARIES}>") else () TARGET_C_PROPERTIES (h5perf_alone SHARED) - target_link_libraries (h5perf_alone PRIVATE ${HDF5_LIBSH_TARGET} "$<$:${MPI_C_LIBRARIES}>") + target_link_libraries (h5perf_alone PRIVATE ${HDF5_LIBSH_TARGET} ${LINK_LIBS} "$<$:${MPI_C_LIBRARIES}>") endif () set_target_properties (h5perf_alone PROPERTIES FOLDER perform) set_property (TARGET h5perf_alone -- cgit v0.12 From 2af8a87af0d7a1589a4df22d16b2d2513876e7a9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 25 Feb 2020 16:04:56 -0600 Subject: Copy generated files instead creating twice --- fortran/src/CMakeLists.txt | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index f333f60..b5d1a60 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -80,13 +80,25 @@ add_executable (H5match_types ${HDF5_F90_SRC_SOURCE_DIR}/H5match_types.c ) target_include_directories (H5match_types PRIVATE "${HDF5_BINARY_DIR};${HDF5_SRC_DIR};${HDF5_F90_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + +add_custom_command ( + OUTPUT ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h + ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ + WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} + DEPENDS H5match_types +) + if (NOT ONLY_SHARED_LIBS) add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different "${HDF5_F90_BINARY_DIR}/H5f90i_gen.h" "${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h" + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different "${HDF5_F90_BINARY_DIR}/H5fortran_types.F90" "${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90" WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static - DEPENDS H5match_types + DEPENDS ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h ) set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h PROPERTIES GENERATED TRUE) set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 PROPERTIES GENERATED TRUE) @@ -95,9 +107,12 @@ if (BUILD_SHARED_LIBS) add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90 - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different "${HDF5_F90_BINARY_DIR}/H5f90i_gen.h" "${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h" + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different "${HDF5_F90_BINARY_DIR}/H5fortran_types.F90" "${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90" WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/shared - DEPENDS H5match_types + DEPENDS ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h ) set_source_files_properties (${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h PROPERTIES GENERATED TRUE) set_source_files_properties (${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90 PROPERTIES GENERATED TRUE) @@ -180,12 +195,20 @@ set (f90_F_GEN_SOURCES ${HDF5_F90_SRC_SOURCE_DIR}/H5Dff.F90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Pff.F90 ) +add_custom_command ( + OUTPUT ${HDF5_F90_BINARY_DIR}/H5_gen.F90 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ + WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} + DEPENDS ${f90_F_GEN_SOURCES} + COMMENT "Generating the H5_gen.F90 file" +) if (NOT ONLY_SHARED_LIBS) add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90 - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different "${HDF5_F90_BINARY_DIR}/H5_gen.F90" "${HDF5_F90_BINARY_DIR}/static/H5_gen.F90" WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static - DEPENDS ${f90_F_GEN_SOURCES} + DEPENDS ${HDF5_F90_BINARY_DIR}/H5_gen.F90 COMMENT "Generating the H5_gen.F90 file" ) add_custom_target (H5gen ALL @@ -197,9 +220,10 @@ endif () if (BUILD_SHARED_LIBS) add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different "${HDF5_F90_BINARY_DIR}/H5_gen.F90" "${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90" WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/shared - DEPENDS ${f90_F_GEN_SOURCES} + DEPENDS ${HDF5_F90_BINARY_DIR}/H5_gen.F90 COMMENT "Generating the H5_gen.F90 shared file" ) add_custom_target (H5genSH ALL -- cgit v0.12