diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-02-25 22:28:11 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-02-25 22:28:11 (GMT) |
commit | 1775d6c9bc86862f120bd39865840ed152c47b0a (patch) | |
tree | ea10c37bdb3ae9138bd372df262a77ded87f3c4f | |
parent | ddb95a6dc51b38c82f6604facf464672882ef4d8 (diff) | |
parent | 2af8a87af0d7a1589a4df22d16b2d2513876e7a9 (diff) | |
download | hdf5-1775d6c9bc86862f120bd39865840ed152c47b0a.zip hdf5-1775d6c9bc86862f120bd39865840ed152c47b0a.tar.gz hdf5-1775d6c9bc86862f120bd39865840ed152c47b0a.tar.bz2 |
Merge pull request #2405 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop
* commit '2af8a87af0d7a1589a4df22d16b2d2513876e7a9':
Copy generated files instead creating twice
Fix standalone link
-rw-r--r-- | fortran/src/CMakeLists.txt | 40 | ||||
-rw-r--r-- | tools/src/h5repack/h5repack_refs.c | 6 | ||||
-rw-r--r-- | tools/test/h5dump/h5dumpgentest.c | 3 | ||||
-rw-r--r-- | tools/test/misc/h5clear_gentest.c | 2 | ||||
-rw-r--r-- | tools/test/perform/CMakeLists.txt | 4 |
5 files changed, 40 insertions, 15 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};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${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} $<TARGET_FILE:H5match_types> + 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} $<TARGET_FILE:H5match_types> + 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} $<TARGET_FILE:H5match_types> + 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} $<TARGET_FILE:H5_buildiface> + 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} $<TARGET_FILE:H5_buildiface> + 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} $<TARGET_FILE:H5_buildiface> + 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 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;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (h5perf_alone STATIC) - target_link_libraries (h5perf_alone PRIVATE ${HDF5_LIB_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>") + target_link_libraries (h5perf_alone PRIVATE ${HDF5_LIB_TARGET} ${LINK_LIBS} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>") else () TARGET_C_PROPERTIES (h5perf_alone SHARED) - target_link_libraries (h5perf_alone PRIVATE ${HDF5_LIBSH_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>") + target_link_libraries (h5perf_alone PRIVATE ${HDF5_LIBSH_TARGET} ${LINK_LIBS} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>") endif () set_target_properties (h5perf_alone PROPERTIES FOLDER perform) set_property (TARGET h5perf_alone |