diff options
author | hdftest <hdftest@hdfgroup.org> | 2020-04-26 19:13:37 (GMT) |
---|---|---|
committer | hdftest <hdftest@hdfgroup.org> | 2020-04-26 19:13:37 (GMT) |
commit | 57b1f0b994bb90f5654093d90620bd7e36ebefa7 (patch) | |
tree | 3b09c2b4c7c53be66499854eaf710265c9503fe3 /hl | |
parent | 507d8f3cdf04ddad0fb7cdb92de033fa70d07f47 (diff) | |
parent | 7015ea5ec07e5bec11c6fed75dbe34d48428cf2b (diff) | |
download | hdf5-57b1f0b994bb90f5654093d90620bd7e36ebefa7.zip hdf5-57b1f0b994bb90f5654093d90620bd7e36ebefa7.tar.gz hdf5-57b1f0b994bb90f5654093d90620bd7e36ebefa7.tar.bz2 |
Merge branch 'hdf5_1_8' of ssh://bitbucket.hdfgroup.org:7999/~hdftest/hdf5_hft into hdf5_1_8
Diffstat (limited to 'hl')
35 files changed, 368 insertions, 289 deletions
diff --git a/hl/Makefile.in b/hl/Makefile.in index 71b8ffd..492f8d0 100644 --- a/hl/Makefile.in +++ b/hl/Makefile.in @@ -410,7 +410,7 @@ AMTAR = @AMTAR@ # AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -472,6 +472,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -591,6 +592,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/hl/c++/Makefile.in b/hl/c++/Makefile.in index 695e026..cd98f3e 100644 --- a/hl/c++/Makefile.in +++ b/hl/c++/Makefile.in @@ -406,7 +406,7 @@ AMTAR = @AMTAR@ # AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -468,6 +468,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -587,6 +588,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/hl/c++/examples/Makefile.am b/hl/c++/examples/Makefile.am index ce719f5..592e8da 100644 --- a/hl/c++/examples/Makefile.am +++ b/hl/c++/examples/Makefile.am @@ -33,8 +33,8 @@ CXX_API=yes # Where to install examples # Note: no '/' after DESTDIR. Explanation in commence.am -EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/c++ -EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl +EXAMPLEDIR=$(examplesdir)/hl/c++ +EXAMPLETOPDIR=$(examplesdir)/hl # How to build programs using h5c++ $(EXTRA_PROG): $(H5CPP) diff --git a/hl/c++/examples/Makefile.in b/hl/c++/examples/Makefile.in index 8d0bcd7..e27e485 100644 --- a/hl/c++/examples/Makefile.in +++ b/hl/c++/examples/Makefile.in @@ -353,7 +353,7 @@ AMTAR = @AMTAR@ # AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -415,6 +415,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -534,6 +535,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ @@ -632,8 +634,8 @@ CXX_API = yes # Where to install examples # Note: no '/' after DESTDIR. Explanation in commence.am -EXAMPLEDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/c++ -EXAMPLETOPDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl +EXAMPLEDIR = $(examplesdir)/hl/c++ +EXAMPLETOPDIR = $(examplesdir)/hl # Assume that all tests in this directory are examples, and tell # conclude.am when to build them. diff --git a/hl/c++/examples/run-hlc++-ex.sh.in b/hl/c++/examples/run-hlc++-ex.sh.in index 7443407..43831f5 100644 --- a/hl/c++/examples/run-hlc++-ex.sh.in +++ b/hl/c++/examples/run-hlc++-ex.sh.in @@ -18,7 +18,7 @@ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # This script will compile and run the c++ examples from source files # -# installed in .../share/hdf5_examples/hl/c++ using h5c++. The # +# installed in @examplesdir@/hl/c++ using h5c++. The # # order for running programs with RunTest in the MAIN section below is taken # # from the Makefile. The order is important since some of the test programs # # use data files created by earlier test programs. Any future additions should # @@ -29,9 +29,33 @@ # Initializations EXIT_SUCCESS=0 EXIT_FAILURE=1 + +# +# Try to derive the path to the installation $prefix established +# by ./configure relative to the examples directory established by +# ./configure. If successful, set `prefix_relto_examplesdir` to the +# relative path. Otherwise, set `prefix_relto_examplesdir` to the +# absolute installation $prefix. +# +# This script uses the value of `prefix` in the user's environment, if +# it is set, below. The content of $() is evaluated in a sub-shell, so +# if `prefix` is set in the user's environment, the shell statements in +# $() won't clobbered it. +# +prefix_relto_examplesdir=$( +prefix=@prefix@ +examplesdir=@examplesdir@ +if [ ${examplesdir##${prefix}/} != ${examplesdir} ]; then + echo $(echo ${examplesdir##${prefix}/} | \ + sed 's,[^/][^/]*,..,g') +else + echo $prefix +fi +) + # Where the tool is installed. # default is relative path to installed location of the tools -prefix="${prefix:-../../../../}" +prefix="${prefix:-../../${prefix_relto_examplesdir}}" AR="@AR@" RANLIB="@RANLIB@" H5TOOL="h5c++" # The tool name diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index 866f372..fbabc86 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -14,6 +14,7 @@ if (NOT ONLY_SHARED_LIBS) PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" ) + target_compile_options(${HDF5_HL_CPP_LIB_TARGET} PRIVATE "${HDF5_CMAKE_CXX_FLAGS}") TARGET_C_PROPERTIES (${HDF5_HL_CPP_LIB_TARGET} STATIC) target_link_libraries (${HDF5_HL_CPP_LIB_TARGET} PUBLIC ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIB_TARGET}") @@ -28,9 +29,8 @@ if (BUILD_SHARED_LIBS) PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" ) - target_compile_definitions(${HDF5_HL_CPP_LIBSH_TARGET} - PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" - ) + target_compile_options(${HDF5_HL_CPP_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_CXX_FLAGS}") + target_compile_definitions(${HDF5_HL_CPP_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB") TARGET_C_PROPERTIES (${HDF5_HL_CPP_LIBSH_TARGET} SHARED) target_link_libraries (${HDF5_HL_CPP_LIBSH_TARGET} PUBLIC ${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIBSH_TARGET}") diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index b58e9a9..76c79b4 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -406,7 +406,7 @@ AMTAR = @AMTAR@ # AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ # Include src directory AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ @@ -471,6 +471,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -590,6 +591,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt index 9bf32ef..5c224a8 100644 --- a/hl/c++/test/CMakeLists.txt +++ b/hl/c++/test/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required (VERSION 3.12) project (HDF5_HL_CPP_TEST CXX) add_executable (hl_ptableTest ${HDF5_HL_CPP_TEST_SOURCE_DIR}/ptableTest.cpp) +target_compile_options(hl_ptableTest PRIVATE "${HDF5_CMAKE_CXX_FLAGS}") target_include_directories (hl_ptableTest PRIVATE "${HDF5_HL_SRC_DIR}/test;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (hl_ptableTest STATIC) diff --git a/hl/c++/test/Makefile.in b/hl/c++/test/Makefile.in index 32c9cc1..62bcbe8 100644 --- a/hl/c++/test/Makefile.in +++ b/hl/c++/test/Makefile.in @@ -401,7 +401,7 @@ AMTAR = @AMTAR@ # AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ # Include directories AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ @@ -468,6 +468,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -587,6 +588,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/hl/c++/test/ptableTest.cpp b/hl/c++/test/ptableTest.cpp index e873503..fd85828 100644 --- a/hl/c++/test/ptableTest.cpp +++ b/hl/c++/test/ptableTest.cpp @@ -142,7 +142,7 @@ int TestCompoundDatatype() HDfflush(stdout); /* Create compound datatype */ - typedef struct compoundType + typedef struct { short a, b, c; int e; @@ -479,7 +479,7 @@ int SystemTest() /* Creating two inter-related datatypes. Create two datasets and put * one datatype in each. */ - typedef struct compoundType + typedef struct { short a, b, c; int e; @@ -492,7 +492,7 @@ int SystemTest() H5Tinsert(dtypeID1, "charlie", HOFFSET( compoundType, c ), H5T_NATIVE_SHORT); H5Tinsert(dtypeID1, "ebert", HOFFSET( compoundType, e ), H5T_NATIVE_INT); - typedef struct cType2 + typedef struct { char f; compoundType g; diff --git a/hl/examples/Makefile.am b/hl/examples/Makefile.am index 29e1a48..cc2d671 100644 --- a/hl/examples/Makefile.am +++ b/hl/examples/Makefile.am @@ -25,8 +25,8 @@ endif # Example directory # Note: no '/' after DESTDIR. Explanation in commence.am -EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/c -EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl +EXAMPLEDIR=$(examplesdir)/hl/c +EXAMPLETOPDIR=$(examplesdir)/hl INSTALL_SCRIPT_FILES = run-hlc-ex.sh INSTALL_TOP_SCRIPT_FILES = run-hl-ex.sh diff --git a/hl/examples/Makefile.in b/hl/examples/Makefile.in index 5c046b1..45eada2 100644 --- a/hl/examples/Makefile.in +++ b/hl/examples/Makefile.in @@ -353,7 +353,7 @@ AMTAR = @AMTAR@ # AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -415,6 +415,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -534,6 +535,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ @@ -621,8 +623,8 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 # Example directory # Note: no '/' after DESTDIR. Explanation in commence.am -EXAMPLEDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/c -EXAMPLETOPDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl +EXAMPLEDIR = $(examplesdir)/hl/c +EXAMPLETOPDIR = $(examplesdir)/hl INSTALL_SCRIPT_FILES = run-hlc-ex.sh INSTALL_TOP_SCRIPT_FILES = run-hl-ex.sh diff --git a/hl/examples/run-hlc-ex.sh.in b/hl/examples/run-hlc-ex.sh.in index 11560ff..e6d0cc9 100644 --- a/hl/examples/run-hlc-ex.sh.in +++ b/hl/examples/run-hlc-ex.sh.in @@ -18,7 +18,7 @@ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # This script will compile and run the c examples from source files installed # -# in .../share/hdf5_examples/hl/c using h5cc or h5pc. The order for running # +# in @examplesdir@/hl/c using h5cc or h5pc. The order for running # # programs with RunTest in the MAIN section below is taken from the Makefile. # # The order is important since some of the test programs use data files created # # by earlier test programs. Any future additions should be placed accordingly. # @@ -29,9 +29,32 @@ EXIT_SUCCESS=0 EXIT_FAILURE=1 +# +# Try to derive the path to the installation $prefix established +# by ./configure relative to the examples directory established by +# ./configure. If successful, set `prefix_relto_examplesdir` to the +# relative path. Otherwise, set `prefix_relto_examplesdir` to the +# absolute installation $prefix. +# +# This script uses the value of `prefix` in the user's environment, if +# it is set, below. The content of $() is evaluated in a sub-shell, so +# if `prefix` is set in the user's environment, the shell statements in +# $() won't clobbered it. +# +prefix_relto_examplesdir=$( +prefix=@prefix@ +examplesdir=@examplesdir@ +if [ ${examplesdir##${prefix}/} != ${examplesdir} ]; then + echo $(echo ${examplesdir##${prefix}/} | \ + sed 's,[^/][^/]*,..,g') +else + echo $prefix +fi +) + # Where the tool is installed. # default is relative path to installed location of the tools -prefix="${prefix:-../../../../}" +prefix="${prefix:-../../${prefix_relto_examplesdir}}" PARALLEL=@PARALLEL@ # Am I in parallel mode? AR="@AR@" RANLIB="@RANLIB@" diff --git a/hl/fortran/Makefile.in b/hl/fortran/Makefile.in index d05cc89..b607895 100644 --- a/hl/fortran/Makefile.in +++ b/hl/fortran/Makefile.in @@ -410,7 +410,7 @@ AMTAR = @AMTAR@ # AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -472,6 +472,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -591,6 +592,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt index b671baa..75791d3 100644 --- a/hl/fortran/examples/CMakeLists.txt +++ b/hl/fortran/examples/CMakeLists.txt @@ -12,38 +12,22 @@ foreach (example ${examples}) PRIVATE $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}> ) -# set_property(TARGET hl_f90_ex_${example} APPEND PROPERTY -# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE"> -# ) -# set_property(TARGET hl_f90_ex_${example} APPEND PROPERTY -# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}> -# ) +# set_property(TARGET hl_f90_ex_${example} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">) +# set_property(TARGET hl_f90_ex_${example} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>) if(MSVC) set_property(TARGET hl_f90_ex_${example} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - target_include_directories (hl_f90_ex_${example} - PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src" - ) - target_link_libraries (hl_f90_ex_${example} - PRIVATE - ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} - ) + target_include_directories (hl_f90_ex_${example} PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") + target_link_libraries (hl_f90_ex_${example} PRIVATE ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (hl_f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran FOLDER examples/hl/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) else () - target_include_directories (hl_f90_ex_${example} - PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src" - ) - target_link_libraries (hl_f90_ex_${example} - PRIVATE - ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} - ) + target_include_directories (hl_f90_ex_${example} PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") + target_link_libraries (hl_f90_ex_${example} PRIVATE ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (hl_f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran FOLDER examples/hl/fortran diff --git a/hl/fortran/examples/Makefile.am b/hl/fortran/examples/Makefile.am index 71c2866..a174094 100644 --- a/hl/fortran/examples/Makefile.am +++ b/hl/fortran/examples/Makefile.am @@ -51,8 +51,8 @@ endif # Tell automake how to install examples # Note: no '/' after DESTDIR. Explanation in commence.am -EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/fortran -EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl +EXAMPLEDIR=$(examplesdir)/hl/fortran +EXAMPLETOPDIR=$(examplesdir)/hl # List dependencies for each example. Normally, automake would take # care of this for us, but if we tell automake about the programs it diff --git a/hl/fortran/examples/Makefile.in b/hl/fortran/examples/Makefile.in index 297e902..df232ba 100644 --- a/hl/fortran/examples/Makefile.in +++ b/hl/fortran/examples/Makefile.in @@ -354,7 +354,7 @@ AMTAR = @AMTAR@ # AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -416,6 +416,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -535,6 +536,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ @@ -640,8 +642,8 @@ FORTRAN_API = yes # Tell automake how to install examples # Note: no '/' after DESTDIR. Explanation in commence.am -EXAMPLEDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/fortran -EXAMPLETOPDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl +EXAMPLEDIR = $(examplesdir)/hl/fortran +EXAMPLETOPDIR = $(examplesdir)/hl # Assume that all tests in this directory are examples, and tell # conclude.am when to build them. diff --git a/hl/fortran/examples/run-hlfortran-ex.sh.in b/hl/fortran/examples/run-hlfortran-ex.sh.in index 8e8663d..d7de8e3 100644 --- a/hl/fortran/examples/run-hlfortran-ex.sh.in +++ b/hl/fortran/examples/run-hlfortran-ex.sh.in @@ -18,7 +18,7 @@ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # This script will compile and run the fortran examples from source files # -# installed in .../share/hdf5_examples/hl/fortran using h5fc or h5pfc. The # +# installed in @examplesdir@/hl/fortran using h5fc or h5pfc. The # # order for running programs with RunTest in the MAIN section below is taken # # from the Makefile. The order is important since some of the test programs # # use data files created by earlier test programs. Any future additions should # @@ -32,7 +32,7 @@ EXIT_FAILURE=1 # Where the tool is installed. # default is relative path to installed location of the tools -prefix="${prefix:-../../../../}" +prefix="${prefix:-@prefix@}" PARALLEL=@PARALLEL@ # Am I in parallel mode? AR="@AR@" RANLIB="@RANLIB@" diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 792d03f..28cce63 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -30,6 +30,7 @@ if (NOT ONLY_SHARED_LIBS) PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" ) + target_compile_options(${HDF5_HL_F90_C_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} STATIC) target_link_libraries (${HDF5_HL_F90_C_LIB_TARGET} PUBLIC ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}") @@ -46,9 +47,8 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" ) - target_compile_definitions(${HDF5_LIBSH_TARGET} - PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" - ) + target_compile_options(${HDF5_HL_F90_C_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") + target_compile_definitions(${HDF5_HL_F90_C_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB") TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED) target_link_libraries (${HDF5_HL_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_HL_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIBSH_TARGET}") @@ -74,27 +74,17 @@ set_source_files_properties (${HDF5_HL_F90_F_SRCS} PROPERTIES LANGUAGE Fortran) if (NOT ONLY_SHARED_LIBS) add_library (${HDF5_HL_F90_LIB_TARGET} STATIC ${HDF5_HL_F90_F_SRCS}) target_include_directories (${HDF5_HL_F90_LIB_TARGET} - PRIVATE - "${HDF5_F90_BINARY_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>" - INTERFACE - "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/static>" + PRIVATE "${HDF5_F90_BINARY_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>" + INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/static>" ) + target_compile_options(${HDF5_HL_F90_LIB_TARGET} PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}") target_compile_definitions(${HDF5_HL_F90_LIB_TARGET} - PUBLIC - $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:HDF5F90_WINDOWS> - PRIVATE - $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}> + PUBLIC $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:HDF5F90_WINDOWS> + PRIVATE $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}> ) - target_link_libraries (${HDF5_HL_F90_LIB_TARGET} - PUBLIC - ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET} - ) -# set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY -# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE"> -# ) -# set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY -# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}> -# ) + target_link_libraries (${HDF5_HL_F90_LIB_TARGET} PUBLIC ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) +# set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">) +# set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>) if(MSVC) set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() @@ -110,33 +100,24 @@ endif () if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_library (${HDF5_HL_F90_LIBSH_TARGET} SHARED ${HDF5_HL_F90_F_SRCS}) target_include_directories (${HDF5_HL_F90_LIBSH_TARGET} - PRIVATE - "${HDF5_F90_BINARY_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/shared;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>" - INTERFACE - "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/shared>" + PRIVATE "${HDF5_F90_BINARY_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/shared;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>" + INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/shared>" ) + target_compile_options(${HDF5_HL_F90_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}") target_compile_definitions(${HDF5_HL_F90_LIBSH_TARGET} - PUBLIC - "H5_BUILT_AS_DYNAMIC_LIB" + PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" PRIVATE $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:BUILD_HDF5_HL_DLL;HDF5F90_WINDOWS> $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}> ) target_link_libraries (${HDF5_HL_F90_LIBSH_TARGET} - PUBLIC - ${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} - PRIVATE - ${LINK_Fortran_LIBS} - ) -# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY -# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE"> -# ) -# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY -# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}> -# ) -# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY -# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-DLL"> -# ) + PUBLIC ${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} + PRIVATE ${LINK_Fortran_LIBS} + ) +# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">) +# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>) +# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-DLL">) +# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-DEF:${HDF5_HL_F90_SRC_BINARY_DIR}/hdf5_hl_fortrandll.def">) if(MSVC) set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS} -DLL") endif() diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index bad1a6c..66bee5e 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -424,7 +424,7 @@ AMTAR = @AMTAR@ # AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src @@ -489,6 +489,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -608,6 +609,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index a9ebe7c..efae5e3 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -15,40 +15,25 @@ macro (ADD_H5_FORTRAN_EXE file) add_executable (hl_f90_${file} ${file}.f90) target_compile_options(hl_f90_${file} PRIVATE + "${HDF5_CMAKE_Fortran_FLAGS}" $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}> ) -# set_property(TARGET hl_f90_${file} APPEND PROPERTY -# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE"> -# ) -# set_property(TARGET hl_f90_${file} APPEND PROPERTY -# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}> -# ) +# set_property(TARGET hl_f90_${file} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">) +# set_property(TARGET hl_f90_${file} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>) if(MSVC) set_property(TARGET hl_f90_${file} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - target_include_directories (hl_f90_${file} - PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src" - ) - target_link_libraries (hl_f90_${file} - PRIVATE - ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET} - ) + target_include_directories (hl_f90_${file} PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") + target_link_libraries (hl_f90_${file} PRIVATE ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET}) set_target_properties (hl_f90_${file} PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/hl/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) else () - target_include_directories (hl_f90_${file} - PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src" - ) - target_link_libraries (hl_f90_${file} - PRIVATE - ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} - ) + target_include_directories (hl_f90_${file} PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") + target_link_libraries (hl_f90_${file} PRIVATE ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET}) set_target_properties (hl_f90_${file} PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/hl/fortran diff --git a/hl/fortran/test/Makefile.in b/hl/fortran/test/Makefile.in index e4f74f6..22673b7 100644 --- a/hl/fortran/test/Makefile.in +++ b/hl/fortran/test/Makefile.in @@ -414,7 +414,7 @@ AMTAR = @AMTAR@ # AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_builddir)/src -I$(top_srcdir)/hl/src AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @@ -480,6 +480,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -599,6 +600,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index 136b8ac..6a2fc61 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -36,6 +36,7 @@ if (NOT ONLY_SHARED_LIBS) PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" ) + target_compile_options(${HDF5_HL_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (${HDF5_HL_LIB_TARGET} STATIC) target_link_libraries (${HDF5_HL_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} STATIC 0) @@ -50,9 +51,8 @@ if (BUILD_SHARED_LIBS) PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" ) - target_compile_definitions(${HDF5_HL_LIBSH_TARGET} - PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" - ) + target_compile_options(${HDF5_HL_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") + target_compile_definitions(${HDF5_HL_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB") TARGET_C_PROPERTIES (${HDF5_HL_LIBSH_TARGET} SHARED) target_link_libraries (${HDF5_HL_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_HL_LIBSH_TARGET} ${HDF5_HL_LIB_NAME} SHARED "HL") diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c index e49795a..92bc43f 100644 --- a/hl/src/H5LTanalyze.c +++ b/hl/src/H5LTanalyze.c @@ -876,12 +876,23 @@ char *H5LTyytext; * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#line 15 "H5LTanalyze.l" +/* NOTE! + * + * If you make any changes to H5LTanalyze.l, please run bin/genparser to + * recreate the output files. + */ +#line 21 "H5LTanalyze.l" #include <stdlib.h> #include <string.h> #include <hdf5.h> #include "H5LTparse.h" +/* Turn off suggest const & malloc attribute warnings in gcc */ +#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ +#pragma GCC diagnostic ignored "-Wsuggest-attribute=const" +#pragma GCC diagnostic ignored "-Wsuggest-attribute=malloc" +#endif + int my_yyinput(char *, int); #undef YY_INPUT #define YY_INPUT(b, r, ms) (r=my_yyinput(b, ms)) @@ -930,7 +941,7 @@ extern hbool_t is_opq_tag; hbool_t first_quote = 1; -#line 915 "H5LTanalyze.c" +#line 926 "H5LTanalyze.c" #define INITIAL 0 #define TAG_STRING 1 @@ -1105,10 +1116,10 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 71 "H5LTanalyze.l" +#line 83 "H5LTanalyze.l" -#line 1093 "H5LTanalyze.c" +#line 1104 "H5LTanalyze.c" if ( !(yy_init) ) { @@ -1202,277 +1213,277 @@ do_action: /* This label is used only to access EOF actions. */ { /* beginning of action switch */ case 1: YY_RULE_SETUP -#line 73 "H5LTanalyze.l" +#line 85 "H5LTanalyze.l" {return hid(H5T_STD_I8BE_TOKEN);} YY_BREAK case 2: YY_RULE_SETUP -#line 74 "H5LTanalyze.l" +#line 86 "H5LTanalyze.l" {return hid(H5T_STD_I8LE_TOKEN);} YY_BREAK case 3: YY_RULE_SETUP -#line 75 "H5LTanalyze.l" +#line 87 "H5LTanalyze.l" {return hid(H5T_STD_I16BE_TOKEN);} YY_BREAK case 4: YY_RULE_SETUP -#line 76 "H5LTanalyze.l" +#line 88 "H5LTanalyze.l" {return hid(H5T_STD_I16LE_TOKEN);} YY_BREAK case 5: YY_RULE_SETUP -#line 77 "H5LTanalyze.l" +#line 89 "H5LTanalyze.l" {return hid(H5T_STD_I32BE_TOKEN);} YY_BREAK case 6: YY_RULE_SETUP -#line 78 "H5LTanalyze.l" +#line 90 "H5LTanalyze.l" {return hid(H5T_STD_I32LE_TOKEN);} YY_BREAK case 7: YY_RULE_SETUP -#line 79 "H5LTanalyze.l" +#line 91 "H5LTanalyze.l" {return hid(H5T_STD_I64BE_TOKEN);} YY_BREAK case 8: YY_RULE_SETUP -#line 80 "H5LTanalyze.l" +#line 92 "H5LTanalyze.l" {return hid(H5T_STD_I64LE_TOKEN);} YY_BREAK case 9: YY_RULE_SETUP -#line 82 "H5LTanalyze.l" +#line 94 "H5LTanalyze.l" {return hid(H5T_STD_U8BE_TOKEN);} YY_BREAK case 10: YY_RULE_SETUP -#line 83 "H5LTanalyze.l" +#line 95 "H5LTanalyze.l" {return hid(H5T_STD_U8LE_TOKEN);} YY_BREAK case 11: YY_RULE_SETUP -#line 84 "H5LTanalyze.l" +#line 96 "H5LTanalyze.l" {return hid(H5T_STD_U16BE_TOKEN);} YY_BREAK case 12: YY_RULE_SETUP -#line 85 "H5LTanalyze.l" +#line 97 "H5LTanalyze.l" {return hid(H5T_STD_U16LE_TOKEN);} YY_BREAK case 13: YY_RULE_SETUP -#line 86 "H5LTanalyze.l" +#line 98 "H5LTanalyze.l" {return hid(H5T_STD_U32BE_TOKEN);} YY_BREAK case 14: YY_RULE_SETUP -#line 87 "H5LTanalyze.l" +#line 99 "H5LTanalyze.l" {return hid(H5T_STD_U32LE_TOKEN);} YY_BREAK case 15: YY_RULE_SETUP -#line 88 "H5LTanalyze.l" +#line 100 "H5LTanalyze.l" {return hid(H5T_STD_U64BE_TOKEN);} YY_BREAK case 16: YY_RULE_SETUP -#line 89 "H5LTanalyze.l" +#line 101 "H5LTanalyze.l" {return hid(H5T_STD_U64LE_TOKEN);} YY_BREAK case 17: YY_RULE_SETUP -#line 91 "H5LTanalyze.l" +#line 103 "H5LTanalyze.l" {return hid(H5T_NATIVE_CHAR_TOKEN);} YY_BREAK case 18: YY_RULE_SETUP -#line 92 "H5LTanalyze.l" +#line 104 "H5LTanalyze.l" {return hid(H5T_NATIVE_SCHAR_TOKEN);} YY_BREAK case 19: YY_RULE_SETUP -#line 93 "H5LTanalyze.l" +#line 105 "H5LTanalyze.l" {return hid(H5T_NATIVE_UCHAR_TOKEN);} YY_BREAK case 20: YY_RULE_SETUP -#line 94 "H5LTanalyze.l" +#line 106 "H5LTanalyze.l" {return hid(H5T_NATIVE_SHORT_TOKEN);} YY_BREAK case 21: YY_RULE_SETUP -#line 95 "H5LTanalyze.l" +#line 107 "H5LTanalyze.l" {return hid(H5T_NATIVE_USHORT_TOKEN);} YY_BREAK case 22: YY_RULE_SETUP -#line 96 "H5LTanalyze.l" +#line 108 "H5LTanalyze.l" {return hid(H5T_NATIVE_INT_TOKEN);} YY_BREAK case 23: YY_RULE_SETUP -#line 97 "H5LTanalyze.l" +#line 109 "H5LTanalyze.l" {return hid(H5T_NATIVE_UINT_TOKEN);} YY_BREAK case 24: YY_RULE_SETUP -#line 98 "H5LTanalyze.l" +#line 110 "H5LTanalyze.l" {return hid(H5T_NATIVE_LONG_TOKEN);} YY_BREAK case 25: YY_RULE_SETUP -#line 99 "H5LTanalyze.l" +#line 111 "H5LTanalyze.l" {return hid(H5T_NATIVE_ULONG_TOKEN);} YY_BREAK case 26: YY_RULE_SETUP -#line 100 "H5LTanalyze.l" +#line 112 "H5LTanalyze.l" {return hid(H5T_NATIVE_LLONG_TOKEN);} YY_BREAK case 27: YY_RULE_SETUP -#line 101 "H5LTanalyze.l" +#line 113 "H5LTanalyze.l" {return hid(H5T_NATIVE_ULLONG_TOKEN);} YY_BREAK case 28: YY_RULE_SETUP -#line 103 "H5LTanalyze.l" +#line 115 "H5LTanalyze.l" {return hid(H5T_IEEE_F32BE_TOKEN);} YY_BREAK case 29: YY_RULE_SETUP -#line 104 "H5LTanalyze.l" +#line 116 "H5LTanalyze.l" {return hid(H5T_IEEE_F32LE_TOKEN);} YY_BREAK case 30: YY_RULE_SETUP -#line 105 "H5LTanalyze.l" +#line 117 "H5LTanalyze.l" {return hid(H5T_IEEE_F64BE_TOKEN);} YY_BREAK case 31: YY_RULE_SETUP -#line 106 "H5LTanalyze.l" +#line 118 "H5LTanalyze.l" {return hid(H5T_IEEE_F64LE_TOKEN);} YY_BREAK case 32: YY_RULE_SETUP -#line 107 "H5LTanalyze.l" +#line 119 "H5LTanalyze.l" {return hid(H5T_NATIVE_FLOAT_TOKEN);} YY_BREAK case 33: YY_RULE_SETUP -#line 108 "H5LTanalyze.l" +#line 120 "H5LTanalyze.l" {return hid(H5T_NATIVE_DOUBLE_TOKEN);} YY_BREAK case 34: YY_RULE_SETUP -#line 109 "H5LTanalyze.l" +#line 121 "H5LTanalyze.l" {return hid(H5T_NATIVE_LDOUBLE_TOKEN);} YY_BREAK case 35: YY_RULE_SETUP -#line 111 "H5LTanalyze.l" +#line 123 "H5LTanalyze.l" {return token(H5T_STRING_TOKEN);} YY_BREAK case 36: YY_RULE_SETUP -#line 112 "H5LTanalyze.l" +#line 124 "H5LTanalyze.l" {return token(STRSIZE_TOKEN);} YY_BREAK case 37: YY_RULE_SETUP -#line 113 "H5LTanalyze.l" +#line 125 "H5LTanalyze.l" {return token(STRPAD_TOKEN);} YY_BREAK case 38: YY_RULE_SETUP -#line 114 "H5LTanalyze.l" +#line 126 "H5LTanalyze.l" {return token(CSET_TOKEN);} YY_BREAK case 39: YY_RULE_SETUP -#line 115 "H5LTanalyze.l" +#line 127 "H5LTanalyze.l" {return token(CTYPE_TOKEN);} YY_BREAK case 40: YY_RULE_SETUP -#line 116 "H5LTanalyze.l" +#line 128 "H5LTanalyze.l" {return token(H5T_STR_NULLTERM_TOKEN);} YY_BREAK case 41: YY_RULE_SETUP -#line 117 "H5LTanalyze.l" +#line 129 "H5LTanalyze.l" {return token(H5T_STR_NULLPAD_TOKEN);} YY_BREAK case 42: YY_RULE_SETUP -#line 118 "H5LTanalyze.l" +#line 130 "H5LTanalyze.l" {return token(H5T_STR_SPACEPAD_TOKEN);} YY_BREAK case 43: YY_RULE_SETUP -#line 119 "H5LTanalyze.l" +#line 131 "H5LTanalyze.l" {return token(H5T_CSET_ASCII_TOKEN);} YY_BREAK case 44: YY_RULE_SETUP -#line 120 "H5LTanalyze.l" +#line 132 "H5LTanalyze.l" {return token(H5T_CSET_UTF8_TOKEN);} YY_BREAK case 45: YY_RULE_SETUP -#line 121 "H5LTanalyze.l" +#line 133 "H5LTanalyze.l" {return token(H5T_C_S1_TOKEN);} YY_BREAK case 46: YY_RULE_SETUP -#line 122 "H5LTanalyze.l" +#line 134 "H5LTanalyze.l" {return token(H5T_FORTRAN_S1_TOKEN);} YY_BREAK case 47: YY_RULE_SETUP -#line 123 "H5LTanalyze.l" +#line 135 "H5LTanalyze.l" {return token(H5T_VARIABLE_TOKEN);} YY_BREAK case 48: YY_RULE_SETUP -#line 125 "H5LTanalyze.l" +#line 137 "H5LTanalyze.l" {return token(H5T_COMPOUND_TOKEN);} YY_BREAK case 49: YY_RULE_SETUP -#line 126 "H5LTanalyze.l" +#line 138 "H5LTanalyze.l" {return token(H5T_ENUM_TOKEN);} YY_BREAK case 50: YY_RULE_SETUP -#line 127 "H5LTanalyze.l" +#line 139 "H5LTanalyze.l" {return token(H5T_ARRAY_TOKEN);} YY_BREAK case 51: YY_RULE_SETUP -#line 128 "H5LTanalyze.l" +#line 140 "H5LTanalyze.l" {return token(H5T_VLEN_TOKEN);} YY_BREAK case 52: YY_RULE_SETUP -#line 130 "H5LTanalyze.l" +#line 142 "H5LTanalyze.l" {return token(H5T_OPAQUE_TOKEN);} YY_BREAK case 53: YY_RULE_SETUP -#line 131 "H5LTanalyze.l" +#line 143 "H5LTanalyze.l" {return token(OPQ_SIZE_TOKEN);} YY_BREAK case 54: YY_RULE_SETUP -#line 132 "H5LTanalyze.l" +#line 144 "H5LTanalyze.l" {return token(OPQ_TAG_TOKEN);} YY_BREAK case 55: YY_RULE_SETUP -#line 134 "H5LTanalyze.l" +#line 146 "H5LTanalyze.l" { if( is_str_size || (is_enum && is_enum_memb) || is_opq_size || (asindex>-1 && arr_stack[asindex].is_dim) || @@ -1485,7 +1496,7 @@ YY_RULE_SETUP YY_BREAK case 56: YY_RULE_SETUP -#line 144 "H5LTanalyze.l" +#line 156 "H5LTanalyze.l" { /*if it's first quote, and is a compound field name or an enum symbol*/ if((is_opq_tag || is_enum || (csindex>-1 && cmpd_stack[csindex].is_field)) @@ -1500,7 +1511,7 @@ YY_RULE_SETUP case 57: /* rule 57 can match eol */ YY_RULE_SETUP -#line 154 "H5LTanalyze.l" +#line 166 "H5LTanalyze.l" { #ifdef H5_HAVE_WIN32_API H5LTyylval.sval = _strdup(H5LTyytext); @@ -1513,52 +1524,52 @@ YY_RULE_SETUP YY_BREAK case 58: YY_RULE_SETUP -#line 164 "H5LTanalyze.l" +#line 176 "H5LTanalyze.l" {return token('{');} YY_BREAK case 59: YY_RULE_SETUP -#line 165 "H5LTanalyze.l" +#line 177 "H5LTanalyze.l" {return token('}');} YY_BREAK case 60: YY_RULE_SETUP -#line 166 "H5LTanalyze.l" +#line 178 "H5LTanalyze.l" {return token('[');} YY_BREAK case 61: YY_RULE_SETUP -#line 167 "H5LTanalyze.l" +#line 179 "H5LTanalyze.l" {return token(']');} YY_BREAK case 62: YY_RULE_SETUP -#line 168 "H5LTanalyze.l" +#line 180 "H5LTanalyze.l" {return token(':');} YY_BREAK case 63: YY_RULE_SETUP -#line 169 "H5LTanalyze.l" +#line 181 "H5LTanalyze.l" {return token(';');} YY_BREAK case 64: /* rule 64 can match eol */ YY_RULE_SETUP -#line 170 "H5LTanalyze.l" +#line 182 "H5LTanalyze.l" ; YY_BREAK case 65: /* rule 65 can match eol */ YY_RULE_SETUP -#line 171 "H5LTanalyze.l" +#line 183 "H5LTanalyze.l" { return 0; } YY_BREAK case 66: YY_RULE_SETUP -#line 173 "H5LTanalyze.l" +#line 185 "H5LTanalyze.l" ECHO; YY_BREAK -#line 1543 "H5LTanalyze.c" +#line 1554 "H5LTanalyze.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(TAG_STRING): yyterminate(); @@ -2527,7 +2538,7 @@ void H5LTyyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 173 "H5LTanalyze.l" +#line 185 "H5LTanalyze.l" int my_yyinput(char *buf, int max_size) diff --git a/hl/src/H5LTanalyze.l b/hl/src/H5LTanalyze.l index 0470d9f..f16455b 100644 --- a/hl/src/H5LTanalyze.l +++ b/hl/src/H5LTanalyze.l @@ -11,12 +11,24 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* NOTE! + * + * If you make any changes to H5LTanalyze.l, please run bin/genparser to + * recreate the output files. + */ + %{ #include <stdlib.h> #include <string.h> #include <hdf5.h> #include "H5LTparse.h" +/* Turn off suggest const & malloc attribute warnings in gcc */ +#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ +#pragma GCC diagnostic ignored "-Wsuggest-attribute=const" +#pragma GCC diagnostic ignored "-Wsuggest-attribute=malloc" +#endif + int my_yyinput(char *, int); #undef YY_INPUT #define YY_INPUT(b, r, ms) (r=my_yyinput(b, ms)) diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 16a0bcf..b85f9a0 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -89,7 +89,7 @@ /* Copy the first part of user declarations. */ /* Line 371 of yacc.c */ -#line 14 "H5LTparse.y" +#line 20 "H5LTparse.y" #include <stdio.h> #include <string.h> @@ -243,7 +243,7 @@ extern int H5LTyydebug; typedef union YYSTYPE { /* Line 387 of yacc.c */ -#line 66 "H5LTparse.y" +#line 72 "H5LTparse.y" int ival; /*for integer token*/ char *sval; /*for name string*/ @@ -603,16 +603,16 @@ static const yytype_int8 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 99, 99, 100, 102, 103, 104, 105, 107, 108, - 109, 110, 111, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 143, 144, 145, 146, 147, 148, 149, 153, 152, 161, - 162, 164, 164, 198, 204, 205, 208, 210, 210, 219, - 220, 222, 223, 222, 230, 233, 239, 240, 245, 246, - 237, 252, 254, 258, 259, 267, 276, 283, 256, 307, - 308, 310, 311, 312, 314, 315, 317, 318, 322, 321, - 326, 327, 329, 329, 381, 383 + 0, 105, 105, 106, 108, 109, 110, 111, 113, 114, + 115, 116, 117, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 149, 150, 151, 152, 153, 154, 155, 159, 158, 167, + 168, 170, 170, 207, 215, 216, 219, 221, 221, 230, + 231, 233, 234, 233, 241, 244, 250, 251, 256, 257, + 248, 265, 267, 271, 272, 280, 289, 296, 269, 320, + 321, 323, 324, 325, 327, 328, 330, 331, 335, 334, + 339, 340, 342, 342, 396, 398 }; #endif @@ -1642,229 +1642,229 @@ yyreduce: { case 2: /* Line 1792 of yacc.c */ -#line 99 "H5LTparse.y" +#line 105 "H5LTparse.y" { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } break; case 3: /* Line 1792 of yacc.c */ -#line 100 "H5LTparse.y" +#line 106 "H5LTparse.y" { return (yyval.hid);} break; case 13: /* Line 1792 of yacc.c */ -#line 114 "H5LTparse.y" +#line 120 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } break; case 14: /* Line 1792 of yacc.c */ -#line 115 "H5LTparse.y" +#line 121 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } break; case 15: /* Line 1792 of yacc.c */ -#line 116 "H5LTparse.y" +#line 122 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } break; case 16: /* Line 1792 of yacc.c */ -#line 117 "H5LTparse.y" +#line 123 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } break; case 17: /* Line 1792 of yacc.c */ -#line 118 "H5LTparse.y" +#line 124 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } break; case 18: /* Line 1792 of yacc.c */ -#line 119 "H5LTparse.y" +#line 125 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } break; case 19: /* Line 1792 of yacc.c */ -#line 120 "H5LTparse.y" +#line 126 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } break; case 20: /* Line 1792 of yacc.c */ -#line 121 "H5LTparse.y" +#line 127 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } break; case 21: /* Line 1792 of yacc.c */ -#line 122 "H5LTparse.y" +#line 128 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } break; case 22: /* Line 1792 of yacc.c */ -#line 123 "H5LTparse.y" +#line 129 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } break; case 23: /* Line 1792 of yacc.c */ -#line 124 "H5LTparse.y" +#line 130 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } break; case 24: /* Line 1792 of yacc.c */ -#line 125 "H5LTparse.y" +#line 131 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } break; case 25: /* Line 1792 of yacc.c */ -#line 126 "H5LTparse.y" +#line 132 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } break; case 26: /* Line 1792 of yacc.c */ -#line 127 "H5LTparse.y" +#line 133 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } break; case 27: /* Line 1792 of yacc.c */ -#line 128 "H5LTparse.y" +#line 134 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } break; case 28: /* Line 1792 of yacc.c */ -#line 129 "H5LTparse.y" +#line 135 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } break; case 29: /* Line 1792 of yacc.c */ -#line 130 "H5LTparse.y" +#line 136 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } break; case 30: /* Line 1792 of yacc.c */ -#line 131 "H5LTparse.y" +#line 137 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } break; case 31: /* Line 1792 of yacc.c */ -#line 132 "H5LTparse.y" +#line 138 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } break; case 32: /* Line 1792 of yacc.c */ -#line 133 "H5LTparse.y" +#line 139 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } break; case 33: /* Line 1792 of yacc.c */ -#line 134 "H5LTparse.y" +#line 140 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } break; case 34: /* Line 1792 of yacc.c */ -#line 135 "H5LTparse.y" +#line 141 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } break; case 35: /* Line 1792 of yacc.c */ -#line 136 "H5LTparse.y" +#line 142 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } break; case 36: /* Line 1792 of yacc.c */ -#line 137 "H5LTparse.y" +#line 143 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } break; case 37: /* Line 1792 of yacc.c */ -#line 138 "H5LTparse.y" +#line 144 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } break; case 38: /* Line 1792 of yacc.c */ -#line 139 "H5LTparse.y" +#line 145 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } break; case 39: /* Line 1792 of yacc.c */ -#line 140 "H5LTparse.y" +#line 146 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } break; case 40: /* Line 1792 of yacc.c */ -#line 143 "H5LTparse.y" +#line 149 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } break; case 41: /* Line 1792 of yacc.c */ -#line 144 "H5LTparse.y" +#line 150 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } break; case 42: /* Line 1792 of yacc.c */ -#line 145 "H5LTparse.y" +#line 151 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } break; case 43: /* Line 1792 of yacc.c */ -#line 146 "H5LTparse.y" +#line 152 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } break; case 44: /* Line 1792 of yacc.c */ -#line 147 "H5LTparse.y" +#line 153 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } break; case 45: /* Line 1792 of yacc.c */ -#line 148 "H5LTparse.y" +#line 154 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } break; case 46: /* Line 1792 of yacc.c */ -#line 149 "H5LTparse.y" +#line 155 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } break; case 47: /* Line 1792 of yacc.c */ -#line 153 "H5LTparse.y" +#line 159 "H5LTparse.y" { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } break; case 48: /* Line 1792 of yacc.c */ -#line 155 "H5LTparse.y" +#line 161 "H5LTparse.y" { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; cmpd_stack[csindex].first_memb = 1; @@ -1874,13 +1874,13 @@ yyreduce: case 51: /* Line 1792 of yacc.c */ -#line 164 "H5LTparse.y" +#line 170 "H5LTparse.y" { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } break; case 52: /* Line 1792 of yacc.c */ -#line 166 "H5LTparse.y" +#line 172 "H5LTparse.y" { size_t origin_size, new_size; hid_t dtype_id = cmpd_stack[csindex].id; @@ -1906,7 +1906,10 @@ yyreduce: H5Tinsert(dtype_id, (yyvsp[(4) - (7)].sval), (yyvsp[(6) - (7)].ival), (yyvsp[(1) - (7)].hid)); } } - + if((yyvsp[(4) - (7)].sval)) { + free((yyvsp[(4) - (7)].sval)); + (yyvsp[(4) - (7)].sval) = NULL; + } cmpd_stack[csindex].is_field = 0; H5Tclose((yyvsp[(1) - (7)].hid)); @@ -1916,33 +1919,35 @@ yyreduce: case 53: /* Line 1792 of yacc.c */ -#line 199 "H5LTparse.y" +#line 208 "H5LTparse.y" { - (yyval.sval) = yylval.sval; + (yyval.sval) = strdup(yylval.sval); + free(yylval.sval); + yylval.sval = NULL; } break; case 54: /* Line 1792 of yacc.c */ -#line 204 "H5LTparse.y" +#line 215 "H5LTparse.y" { (yyval.ival) = 0; } break; case 55: /* Line 1792 of yacc.c */ -#line 206 "H5LTparse.y" +#line 217 "H5LTparse.y" { (yyval.ival) = yylval.ival; } break; case 57: /* Line 1792 of yacc.c */ -#line 210 "H5LTparse.y" +#line 221 "H5LTparse.y" { asindex++; /*pushd onto the stack*/ } break; case 58: /* Line 1792 of yacc.c */ -#line 212 "H5LTparse.y" +#line 223 "H5LTparse.y" { (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); arr_stack[asindex].ndims = 0; @@ -1953,13 +1958,13 @@ yyreduce: case 61: /* Line 1792 of yacc.c */ -#line 222 "H5LTparse.y" +#line 233 "H5LTparse.y" { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } break; case 62: /* Line 1792 of yacc.c */ -#line 223 "H5LTparse.y" +#line 234 "H5LTparse.y" { unsigned ndims = arr_stack[asindex].ndims; arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; arr_stack[asindex].ndims++; @@ -1969,19 +1974,19 @@ yyreduce: case 65: /* Line 1792 of yacc.c */ -#line 234 "H5LTparse.y" +#line 245 "H5LTparse.y" { (yyval.hid) = H5Tvlen_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 66: /* Line 1792 of yacc.c */ -#line 239 "H5LTparse.y" +#line 250 "H5LTparse.y" { is_opq_size = 1; } break; case 67: /* Line 1792 of yacc.c */ -#line 240 "H5LTparse.y" +#line 251 "H5LTparse.y" { size_t size = (size_t)yylval.ival; (yyval.hid) = H5Tcreate(H5T_OPAQUE, size); @@ -1991,34 +1996,36 @@ yyreduce: case 68: /* Line 1792 of yacc.c */ -#line 245 "H5LTparse.y" +#line 256 "H5LTparse.y" { is_opq_tag = 1; } break; case 69: /* Line 1792 of yacc.c */ -#line 246 "H5LTparse.y" +#line 257 "H5LTparse.y" { H5Tset_tag((yyvsp[(7) - (13)].hid), yylval.sval); + free(yylval.sval); + yylval.sval = NULL; is_opq_tag = 0; } break; case 70: /* Line 1792 of yacc.c */ -#line 250 "H5LTparse.y" +#line 263 "H5LTparse.y" { (yyval.hid) = (yyvsp[(7) - (15)].hid); } break; case 73: /* Line 1792 of yacc.c */ -#line 258 "H5LTparse.y" +#line 271 "H5LTparse.y" { is_str_size = 1; } break; case 74: /* Line 1792 of yacc.c */ -#line 259 "H5LTparse.y" +#line 272 "H5LTparse.y" { if((yyvsp[(5) - (6)].ival) == H5T_VARIABLE_TOKEN) is_variable = 1; @@ -2030,7 +2037,7 @@ yyreduce: case 75: /* Line 1792 of yacc.c */ -#line 267 "H5LTparse.y" +#line 280 "H5LTparse.y" { if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLTERM_TOKEN) str_pad = H5T_STR_NULLTERM; @@ -2043,7 +2050,7 @@ yyreduce: case 76: /* Line 1792 of yacc.c */ -#line 276 "H5LTparse.y" +#line 289 "H5LTparse.y" { if((yyvsp[(13) - (14)].ival) == H5T_CSET_ASCII_TOKEN) str_cset = H5T_CSET_ASCII; @@ -2054,7 +2061,7 @@ yyreduce: case 77: /* Line 1792 of yacc.c */ -#line 283 "H5LTparse.y" +#line 296 "H5LTparse.y" { if((yyvsp[(17) - (18)].hid) == H5T_C_S1_TOKEN) (yyval.hid) = H5Tcopy(H5T_C_S1); @@ -2065,7 +2072,7 @@ yyreduce: case 78: /* Line 1792 of yacc.c */ -#line 290 "H5LTparse.y" +#line 303 "H5LTparse.y" { hid_t str_id = (yyvsp[(19) - (20)].hid); @@ -2086,67 +2093,67 @@ yyreduce: case 79: /* Line 1792 of yacc.c */ -#line 307 "H5LTparse.y" +#line 320 "H5LTparse.y" {(yyval.ival) = H5T_VARIABLE_TOKEN;} break; case 81: /* Line 1792 of yacc.c */ -#line 310 "H5LTparse.y" +#line 323 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} break; case 82: /* Line 1792 of yacc.c */ -#line 311 "H5LTparse.y" +#line 324 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} break; case 83: /* Line 1792 of yacc.c */ -#line 312 "H5LTparse.y" +#line 325 "H5LTparse.y" {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} break; case 84: /* Line 1792 of yacc.c */ -#line 314 "H5LTparse.y" +#line 327 "H5LTparse.y" {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} break; case 85: /* Line 1792 of yacc.c */ -#line 315 "H5LTparse.y" +#line 328 "H5LTparse.y" {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} break; case 86: /* Line 1792 of yacc.c */ -#line 317 "H5LTparse.y" +#line 330 "H5LTparse.y" {(yyval.hid) = H5T_C_S1_TOKEN;} break; case 87: /* Line 1792 of yacc.c */ -#line 318 "H5LTparse.y" +#line 331 "H5LTparse.y" {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} break; case 88: /* Line 1792 of yacc.c */ -#line 322 "H5LTparse.y" +#line 335 "H5LTparse.y" { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 89: /* Line 1792 of yacc.c */ -#line 324 "H5LTparse.y" +#line 337 "H5LTparse.y" { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } break; case 92: /* Line 1792 of yacc.c */ -#line 329 "H5LTparse.y" +#line 342 "H5LTparse.y" { is_enum_memb = 1; /*indicate member of enum*/ #ifdef H5_HAVE_WIN32_API @@ -2154,12 +2161,14 @@ yyreduce: #else /* H5_HAVE_WIN32_API */ enum_memb_symbol = strdup(yylval.sval); #endif /* H5_HAVE_WIN32_API */ + free(yylval.sval); + yylval.sval = NULL; } break; case 93: /* Line 1792 of yacc.c */ -#line 338 "H5LTparse.y" +#line 353 "H5LTparse.y" { char char_val=(char)yylval.ival; short short_val=(short)yylval.ival; @@ -2206,7 +2215,7 @@ yyreduce: /* Line 1792 of yacc.c */ -#line 2191 "H5LTparse.c" +#line 2200 "H5LTparse.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 7481a45..71e520d 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -110,7 +110,7 @@ extern int H5LTyydebug; typedef union YYSTYPE { /* Line 2058 of yacc.c */ -#line 66 "H5LTparse.y" +#line 72 "H5LTparse.y" int ival; /*for integer token*/ char *sval; /*for name string*/ diff --git a/hl/src/H5LTparse.y b/hl/src/H5LTparse.y index 0022174..66a8556 100644 --- a/hl/src/H5LTparse.y +++ b/hl/src/H5LTparse.y @@ -11,6 +11,12 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* NOTE! + * + * If you make any changes to H5LTparse.y, please run bin/genparser to + * recreate the output files. + */ + %{ #include <stdio.h> #include <string.h> @@ -188,7 +194,10 @@ memb_def : ddl_type { cmpd_stack[csindex].is_field = 1; /*notify le H5Tinsert(dtype_id, $<sval>4, $<ival>6, $<hid>1); } } - + if($<sval>4) { + free($<sval>4); + $<sval>4 = NULL; + } cmpd_stack[csindex].is_field = 0; H5Tclose($<hid>1); @@ -197,7 +206,9 @@ memb_def : ddl_type { cmpd_stack[csindex].is_field = 1; /*notify le ; field_name : STRING { - $<sval>$ = yylval.sval; + $<sval>$ = strdup(yylval.sval); + free(yylval.sval); + yylval.sval = NULL; } ; field_offset : /*empty*/ @@ -245,6 +256,8 @@ opaque_type : H5T_OPAQUE_TOKEN OPQ_TAG_TOKEN { is_opq_tag = 1; } '"' opaque_tag '"' ';' { H5Tset_tag($<hid>7, yylval.sval); + free(yylval.sval); + yylval.sval = NULL; is_opq_tag = 0; } '}' { $<hid>$ = $<hid>7; } @@ -333,6 +346,8 @@ enum_def : '"' enum_symbol '"' { #else /* H5_HAVE_WIN32_API */ enum_memb_symbol = strdup(yylval.sval); #endif /* H5_HAVE_WIN32_API */ + free(yylval.sval); + yylval.sval = NULL; } enum_val ';' { diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 0581663..b793088 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -406,7 +406,7 @@ AMTAR = @AMTAR@ # AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ # Add include directories to the C preprocessor flags AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src @@ -470,6 +470,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -589,6 +590,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index a2a7ad7..e91bba2 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -19,6 +19,7 @@ configure_file (${HDF5_HL_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ON # -------------------------------------------------------------------- macro (HL_ADD_EXE hl_name) add_executable (hl_${hl_name} ${hl_name}.c) + target_compile_options(hl_${hl_name} PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (hl_${hl_name} PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (hl_${hl_name} STATIC) @@ -40,6 +41,7 @@ endmacro () macro (HL_ADD_ZEXE hl_name) add_executable (hl_${hl_name} ${hl_name}.c) + target_compile_options(hl_${hl_name} PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (hl_${hl_name} PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (hl_${hl_name} STATIC) @@ -69,6 +71,7 @@ HL_ADD_EXE (test_table) # test_packet has two source files add_executable (hl_test_packet test_packet.c test_packet_vlen.c) +target_compile_options(hl_test_packet PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (hl_test_packet PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (hl_test_packet STATIC) @@ -93,6 +96,7 @@ set_target_properties (hl_test_packet PROPERTIES FOLDER test/hl) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) add_executable (hl_gen_test_ds gen_test_ds.c) + target_compile_options(hl_gen_test_ds PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (hl_gen_test_ds PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (hl_gen_test_ds STATIC) target_link_libraries (hl_gen_test_ds PRIVATE diff --git a/hl/test/Makefile.am b/hl/test/Makefile.am index c176f2e..3365dec 100644 --- a/hl/test/Makefile.am +++ b/hl/test/Makefile.am @@ -1,4 +1,3 @@ -# # Copyright by The HDF Group. # Copyright by the Board of Trustees of the University of Illinois. # All rights reserved. diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in index 4dd0b7b..9b45a37 100644 --- a/hl/test/Makefile.in +++ b/hl/test/Makefile.in @@ -14,7 +14,6 @@ @SET_MAKE@ -# # Copyright by The HDF Group. # Copyright by the Board of Trustees of the University of Illinois. # All rights reserved. @@ -440,7 +439,7 @@ AMTAR = @AMTAR@ # AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ # Add include directories to C preprocessor flags AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I. -I$(srcdir) \ @@ -507,6 +506,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -626,6 +626,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/hl/tools/Makefile.in b/hl/tools/Makefile.in index 39b58a2..dbffb8d 100644 --- a/hl/tools/Makefile.in +++ b/hl/tools/Makefile.in @@ -407,7 +407,7 @@ AMTAR = @AMTAR@ # AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -469,6 +469,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -588,6 +589,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ diff --git a/hl/tools/gif2h5/CMakeLists.txt b/hl/tools/gif2h5/CMakeLists.txt index cc2ba68..0b895a3 100644 --- a/hl/tools/gif2h5/CMakeLists.txt +++ b/hl/tools/gif2h5/CMakeLists.txt @@ -16,6 +16,7 @@ set (GIF2H5_SOURCES #-- Add gif2hdf5 program if (NOT ONLY_SHARED_LIBS) add_executable (gif2h5 ${GIF2H5_SOURCES}) + target_compile_options(gif2h5 PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (gif2h5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (gif2h5 STATIC) target_link_libraries (gif2h5 PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) @@ -28,6 +29,7 @@ endif () if (BUILD_SHARED_LIBS) add_executable (gif2h5-shared ${GIF2H5_SOURCES}) + target_compile_options(gif2h5-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (gif2h5-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (gif2h5-shared SHARED) target_link_libraries (gif2h5-shared PRIVATE ${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${HDF5_TOOLS_LIBSH_TARGET}) @@ -45,6 +47,7 @@ set (hdf2gif_SOURCES ) if (NOT ONLY_SHARED_LIBS) add_executable (h52gif ${hdf2gif_SOURCES}) + target_compile_options(h52gif PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (h52gif PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h52gif STATIC) target_link_libraries (h52gif PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) @@ -57,6 +60,7 @@ endif () if (BUILD_SHARED_LIBS) add_executable (h52gif-shared ${hdf2gif_SOURCES}) + target_compile_options(h52gif-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (h52gif-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h52gif-shared SHARED) target_link_libraries (h52gif-shared PRIVATE ${HDF5_HL_LIBSH_TARGET} PRIVATE ${HDF5_LIBSH_TARGET} ${HDF5_TOOLS_LIBSH_TARGET}) diff --git a/hl/tools/gif2h5/Makefile.in b/hl/tools/gif2h5/Makefile.in index efa704e..91a0aef 100644 --- a/hl/tools/gif2h5/Makefile.in +++ b/hl/tools/gif2h5/Makefile.in @@ -419,7 +419,7 @@ AMTAR = @AMTAR@ # AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ # Include src and tools/lib directories AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ @@ -484,6 +484,7 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_ECFLAGS = @H5_ECFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -603,6 +604,7 @@ docdir = $(exec_prefix)/doc dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ +examplesdir = @examplesdir@ exec_prefix = @exec_prefix@ fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ |