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
This commit is contained in:
Allen Byrne 2020-02-25 16:28:11 -06:00
commit 1775d6c9bc
5 changed files with 40 additions and 15 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -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)
{

View File

@ -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 */

View File

@ -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