summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-04-07 14:34:33 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-04-07 14:34:33 (GMT)
commitb27a20f8c0e286ea7c2836605632ea2ee5522d03 (patch)
treef09062688857bd993c8594a10267009473d0c8e2
parentf6514c35ea3786206a8db73e1cad8fce8fe6a715 (diff)
parentf362e14add76bc137c8f9bb8542a697e48900b91 (diff)
downloadhdf5-b27a20f8c0e286ea7c2836605632ea2ee5522d03.zip
hdf5-b27a20f8c0e286ea7c2836605632ea2ee5522d03.tar.gz
hdf5-b27a20f8c0e286ea7c2836605632ea2ee5522d03.tar.bz2
Merge pull request #2489 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop
* commit 'f362e14add76bc137c8f9bb8542a697e48900b91': Hide Frortran directive warnings Remove flag from gfort-general in gfort-5, add /EHsc to Win C++ Update printf pointer syntax and revert fortran to f2003 Reduce window fortran standard to f90 Minor updates and fix settings for fortran flags Update intel flags Fix missing endif Correct improper file move Move intel warnings to subfolder, update autotools files Corrected note Remove overzealous additions Correct whitespace in flags, force list mode Flag construction must be after compiler detection TRILAB-192 add c++ and fortran warnings build systems one file Update release note for CMake warnings Add missing header include
-rw-r--r--CMakeLists.txt2
-rw-r--r--MANIFEST14
-rw-r--r--c++/src/CMakeLists.txt8
-rw-r--r--c++/test/CMakeLists.txt1
-rw-r--r--config/cmake/CTestCustom.cmake9
-rw-r--r--config/cmake/HDFCXXCompilerFlags.cmake326
-rw-r--r--config/cmake/HDFCompilerFlags.cmake88
-rw-r--r--config/cmake/HDFFortranCompilerFlags.cmake142
-rw-r--r--config/cmake/libhdf5.settings.cmake.in2
-rw-r--r--config/gnu-cxxflags885
-rw-r--r--config/gnu-fflags50
-rw-r--r--config/gnu-flags52
-rw-r--r--config/gnu-warnings/cxx-general (renamed from config/intel-warnings-general)13
-rw-r--r--config/gnu-warnings/gfort-4.42
-rw-r--r--config/gnu-warnings/gfort-4.51
-rw-r--r--config/gnu-warnings/gfort-4.72
-rw-r--r--config/gnu-warnings/gfort-4.85
-rw-r--r--config/gnu-warnings/gfort-51
-rw-r--r--config/gnu-warnings/gfort-61
-rw-r--r--config/gnu-warnings/gfort-81
-rw-r--r--config/gnu-warnings/gfort-general12
-rw-r--r--config/intel-fflags27
-rw-r--r--config/intel-flags32
-rw-r--r--config/intel-warnings/general2
-rw-r--r--config/intel-warnings/ifort-general1
-rw-r--r--fortran/examples/CMakeLists.txt103
-rw-r--r--fortran/src/CMakeLists.txt70
-rw-r--r--fortran/test/CMakeLists.txt230
-rw-r--r--fortran/testpar/CMakeLists.txt12
-rw-r--r--hl/c++/src/CMakeLists.txt12
-rw-r--r--hl/c++/test/CMakeLists.txt1
-rw-r--r--hl/fortran/examples/CMakeLists.txt28
-rw-r--r--hl/fortran/src/CMakeLists.txt64
-rw-r--r--hl/fortran/test/CMakeLists.txt29
-rw-r--r--hl/src/CMakeLists.txt12
-rw-r--r--hl/test/CMakeLists.txt4
-rw-r--r--hl/tools/gif2h5/CMakeLists.txt4
-rw-r--r--hl/tools/h5watch/CMakeLists.txt5
-rw-r--r--java/src/jni/CMakeLists.txt4
-rw-r--r--release_docs/RELEASE.txt8
-rw-r--r--src/CMakeLists.txt8
-rw-r--r--src/H5trace.c212
-rw-r--r--test/CMakeLists.txt17
-rw-r--r--testpar/CMakeLists.txt2
-rw-r--r--tools/lib/CMakeLists.txt8
-rw-r--r--tools/libtest/CMakeLists.txt1
-rw-r--r--tools/libtest/h5tools_test_utils.c1
-rw-r--r--tools/src/h5diff/CMakeLists.txt2
48 files changed, 1154 insertions, 1362 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2bad805..b63d579 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -964,6 +964,7 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for
include (${HDF_RESOURCES_EXT_DIR}/HDFUseFortran.cmake)
message (STATUS "Fortran compiler ID is ${CMAKE_Fortran_COMPILER_ID}")
+ include (${HDF_RESOURCES_DIR}/HDFFortranCompilerFlags.cmake)
include (${HDF_RESOURCES_DIR}/HDF5UseFortran.cmake)
set (LINK_Fortran_LIBS ${LINK_LIBS})
@@ -1005,6 +1006,7 @@ if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++")
endif ()
include (${HDF_RESOURCES_EXT_DIR}/HDFUseCXX.cmake)
+ include (${HDF_RESOURCES_DIR}/HDFCXXCompilerFlags.cmake)
if (CMAKE_NO_STD_NAMESPACE)
set (H5_NO_STD 1)
diff --git a/MANIFEST b/MANIFEST
index 7078128..b1be241 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -164,6 +164,7 @@
./config/gnu-warnings/7
./config/gnu-warnings/8
./config/gnu-warnings/9
+./config/gnu-warnings/cxx-general
./config/gnu-warnings/developer-4.5
./config/gnu-warnings/developer-4.6
./config/gnu-warnings/developer-4.7
@@ -175,13 +176,22 @@
./config/gnu-warnings/error-8
./config/gnu-warnings/error-general
./config/gnu-warnings/general
+./config/gnu-warnings/gfort-general
+./config/gnu-warnings/gfort-4.4
+./config/gnu-warnings/gfort-4.5
+./config/gnu-warnings/gfort-4.7
+./config/gnu-warnings/gfort-4.8
+./config/gnu-warnings/gfort-5
+./config/gnu-warnings/gfort-6
+./config/gnu-warnings/gfort-8
./config/gnu-warnings/no-developer-4.5
./config/gnu-warnings/no-developer-4.6
./config/gnu-warnings/no-developer-4.7
./config/gnu-warnings/no-developer-4.8
./config/gnu-warnings/no-developer-8
./config/gnu-warnings/no-developer-general
-./config/intel-warnings-general
+./config/intel-warnings/ifort-general
+./config/intel-warnings/general
./config/site-specific/BlankForm
@@ -3392,6 +3402,8 @@
./config/cmake/hdf5-config.cmake.in
./config/cmake/hdf5-config-version.cmake.in
./config/cmake/HDFCompilerFlags.cmake
+./config/cmake/HDFCXXCompilerFlags.cmake
+./config/cmake/HDFFortranCompilerFlags.cmake
./config/cmake/HDF5_Process_Flex_Files.cmake
./config/cmake/HDF5Macros.cmake
./config/cmake/HDF5UseFortran.cmake
diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt
index fa15c9e..058f457 100644
--- a/c++/src/CMakeLists.txt
+++ b/c++/src/CMakeLists.txt
@@ -90,9 +90,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_CPP_LIB_TARGET}
- PRIVATE "${HDF5_CMAKE_CXX_FLAGS}"
- )
+ target_compile_options(${HDF5_CPP_LIB_TARGET} PRIVATE "${HDF5_CMAKE_CXX_FLAGS}")
target_compile_definitions(${HDF5_CPP_LIB_TARGET}
PRIVATE $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK># Parallel/MPI, prevent spurious cpp/cxx warnings
)
@@ -110,9 +108,7 @@ 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_options(${HDF5_CPP_LIBSH_TARGET}
- PRIVATE "${HDF5_CMAKE_CXX_FLAGS}"
- )
+ target_compile_options(${HDF5_CPP_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_CXX_FLAGS}")
target_compile_definitions(${HDF5_CPP_LIBSH_TARGET}
PUBLIC "H5_BUILT_AS_DYNAMIC_LIB"
PRIVATE $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK># Parallel/MPI, prevent spurious cpp/cxx warnings
diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt
index 29534a7..ca2295e 100644
--- a/c++/test/CMakeLists.txt
+++ b/c++/test/CMakeLists.txt
@@ -39,6 +39,7 @@ configure_file (${HDF5_CPP_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @O
add_executable (cpp_testhdf5 ${CPP_TEST_SOURCES} )
target_include_directories (cpp_testhdf5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+target_compile_options(cpp_testhdf5 PRIVATE "${HDF5_CMAKE_CXX_FLAGS}")
target_compile_definitions(cpp_testhdf5
PRIVATE $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK># Parallel/MPI, prevent spurious cpp/cxx warnings
)
diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake
index 7f71e8d..725e382 100644
--- a/config/cmake/CTestCustom.cmake
+++ b/config/cmake/CTestCustom.cmake
@@ -18,23 +18,18 @@ set (CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 50000)
set (CTEST_CUSTOM_WARNING_EXCEPTION
${CTEST_CUSTOM_WARNING_EXCEPTION}
-# "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning C4090:"
-# "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning:[ \t]*passing argument"
-# "H5detect.c[0-9 \t:]*warning:[ \t]*passing argument"
"note.*expected.*void.*but argument is of type.*volatile"
-# "H5Tconv.c[0-9 \t:]*warning:[ \t]*comparison is always false due to limited range of data type"
-# "H5Ztrans.c.[0-9]+.[ \t]*:[ \t]*warning C4244"
"src.ZLIB.*:[ \t]*warning"
"warning LNK4197:.*ZLIB-prefix"
"src.SZIP.*:[ \t]*warning"
# "POSIX name for this item is deprecated"
"disabling jobserver mode"
"config.cmake.xlatefile.c"
-# "warning.*implicit declaration of function"
"warning.*unknown pragma"
"warning.*unrecognized .pragma"
# "note: expanded from macro"
-# "fpp:[ \t]*warning:[ \t]*cannot remove H5_DEBUG_API - not a predefined macro"
+ # HDDFFV-11074
+ "This directive is not standard"
)
set (CTEST_CUSTOM_MEMCHECK_IGNORE
diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake
new file mode 100644
index 0000000..bf22886
--- /dev/null
+++ b/config/cmake/HDFCXXCompilerFlags.cmake
@@ -0,0 +1,326 @@
+#
+# Copyright by The HDF Group.
+# 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://support.hdfgroup.org/ftp/HDF5/releases.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+#
+set(CMAKE_CXX_STANDARD 98)
+set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
+set(CMAKE_CXX_EXTENSIONS OFF)
+
+macro (ADD_H5_FLAGS h5_flag_var infile)
+ file (STRINGS ${infile} TEST_FLAG_STREAM)
+ #message (STATUS "TEST_FLAG_STREAM=${TEST_FLAG_STREAM}")
+ list (LENGTH TEST_FLAG_STREAM len_flag)
+ if (len_flag GREATER 0)
+ math (EXPR _FP_LEN "${len_flag} - 1")
+ foreach (line RANGE 0 ${_FP_LEN})
+ list (GET TEST_FLAG_STREAM ${line} str_flag)
+ string (REGEX REPLACE "^#.*" "" str_flag "${str_flag}")
+ #message (STATUS "str_flag=${str_flag}")
+ if (str_flag)
+ list (APPEND ${h5_flag_var} "${str_flag}")
+ endif ()
+ endforeach ()
+ endif ()
+ #message (STATUS "h5_flag_var=${${h5_flag_var}}")
+endmacro ()
+
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_SANITIZER_FLAGS} ${CMAKE_CXX_FLAGS}")
+message (STATUS "Warnings Configuration: CXX default: ${CMAKE_CXX_FLAGS}")
+#-----------------------------------------------------------------------------
+# Compiler specific flags : Shouldn't there be compiler tests for these
+#-----------------------------------------------------------------------------
+if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}")
+ if (${HDF_CFG_NAME} MATCHES "Debug")
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ftrapv -fno-common")
+ endif ()
+ else ()
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstdarg-opt")
+ endif ()
+ endif ()
+endif ()
+
+#-----------------------------------------------------------------------------
+# Option to allow the user to disable compiler warnings
+#-----------------------------------------------------------------------------
+if (HDF5_DISABLE_COMPILER_WARNINGS)
+ message (STATUS "....Compiler warnings are suppressed")
+ # MSVC uses /w to suppress warnings. It also complains if another
+ # warning level is given, so remove it.
+ if (MSVC)
+ set (HDF5_WARNINGS_BLOCKED 1)
+ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0")
+ endif ()
+ endif ()
+ if (WIN32)
+ add_definitions (-D_CRT_SECURE_NO_WARNINGS)
+ endif ()
+
+ # Most compilers use -w to suppress warnings.
+ if (NOT HDF5_WARNINGS_BLOCKED)
+ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
+ endif ()
+ endif ()
+endif ()
+
+#-----------------------------------------------------------------------------
+# HDF5 library compile options
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+# CDash is configured to only allow 3000 warnings, so
+# break into groups (from the config/gnu-flags file)
+#-----------------------------------------------------------------------------
+if (NOT MSVC)
+ if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
+ list (APPEND HDF5_CMAKE_CXX_FLAGS "-erroff=%none -DBSD_COMP")
+ else ()
+ # General flags
+ #
+ # Note that some of the flags listed here really should be developer
+ # flags (listed in a separate variable, below) but we put them here
+ # because they are not raised by the current code and we'd like to
+ # know if they do start showing up.
+ #
+ # NOTE: Don't add -Wpadded here since we can't/won't fix the (many)
+ # warnings that are emitted. If you need it, add it at configure time.
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
+ ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/general")
+ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0)
+ list (APPEND H5_CXXFLAGS0 "-Wextra-tokens -Wformat -Wformat-security -Wic-pointer -Wshadow")
+ list (APPEND H5_CXXFLAGS0 "-Wsign-compare -Wtrigraphs -Wwrite-strings")
+ endif()
+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-general")
+ endif ()
+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+ ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/general")
+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "PGI")
+ list (APPEND HDF5_CMAKE_CXX_FLAGS "-Minform=inform")
+ endif ()
+ message (STATUS "CMAKE_CXX_FLAGS_GENERAL=${HDF5_CMAKE_CXX_FLAGS}")
+ endif ()
+
+ #-----------------------------------------------------------------------------
+ # Option to allow the user to enable developer warnings
+ # Developer warnings (suggestions from gcc, not code problems)
+ #-----------------------------------------------------------------------------
+ #if (HDF5_ENABLE_DEV_WARNINGS)
+ # message (STATUS "....HDF5 developer group warnings are enabled")
+ # if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
+ # list (APPEND H5_CXXFLAGS0 "-Winline -Wreorder -Wport -Wstrict-aliasing")
+ # elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ # ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general")
+ # elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+ # ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general")
+ # endif ()
+ #else ()
+ # if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ # ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general")
+ # elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+ # ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general")
+ # endif ()
+ #endif ()
+
+
+ #if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ # # Append warning flags that only gcc 4.3+ knows about
+ # ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.3")
+
+ # # Append more extra warning flags that only gcc 4.4+ know about
+ # if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4)
+ # ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.4")
+ # endif ()
+ #endif ()
+
+ # Append more extra warning flags that only gcc 4.5+ know about
+ #if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.5)
+ # ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.5")
+ # if (HDF5_ENABLE_DEV_WARNINGS)
+ # ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.5")
+ # else ()
+ # ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.5")
+ # endif ()
+ #endif ()
+else ()
+ list (APPEND HDF5_CMAKE_CXX_FLAGS "/EHsc")
+endif ()
+
+#-----------------------------------------------------------------------------
+# Option to allow the user to enable all warnings
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_ALL_WARNINGS)
+ message (STATUS "....All Warnings are enabled")
+ if (MSVC)
+ if (HDF5_ENABLE_DEV_WARNINGS)
+ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ list (APPEND HDF5_CMAKE_CXX_FLAGS "/Wall /wd4668")
+ endif ()
+ else ()
+ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ list (APPEND HDF5_CMAKE_CXX_FLAGS "/W3")
+ endif ()
+ endif ()
+ else ()
+ if (CMAKE_COMPILER_IS_GNUCC)
+ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS0} ${H5_CXXFLAGS1} ${H5_CXXFLAGS2} ${H5_CXXFLAGS3} ${H5_CXXFLAGS4})
+ endif ()
+ endif ()
+ endif ()
+endif ()
+
+#-----------------------------------------------------------------------------
+# Option to allow the user to enable warnings by groups
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_GROUPZERO_WARNINGS)
+ message (STATUS "....Group Zero warnings are enabled")
+ if (MSVC)
+ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}")
+ list (APPEND HDF5_CMAKE_CXX_FLAGS "/W1")
+ endif ()
+ else ()
+ if (CMAKE_COMPILER_IS_GNUCC)
+ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CFLAGS0})
+ endif ()
+ endif ()
+ endif ()
+endif ()
+
+#-----------------------------------------------------------------------------
+# Option to allow the user to enable warnings by groups
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_GROUPONE_WARNINGS)
+ message (STATUS "....Group One warnings are enabled")
+ if (MSVC)
+ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}")
+ list (APPEND HDF5_CMAKE_CXX_FLAGS "/W2")
+ endif ()
+ else ()
+ if (CMAKE_COMPILER_IS_GNUCC)
+ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CFLAGS1})
+ endif ()
+ endif ()
+ endif ()
+endif ()
+
+#-----------------------------------------------------------------------------
+# Option to allow the user to enable warnings by groups
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_GROUPTWO_WARNINGS)
+ message (STATUS "....Group Two warnings are enabled")
+ if (MSVC)
+ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}")
+ list (APPEND HDF5_CMAKE_CXX_FLAGS "/W3")
+ endif ()
+ else ()
+ if (CMAKE_COMPILER_IS_GNUCC)
+ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CFLAGS2})
+ endif ()
+ endif ()
+ endif ()
+endif ()
+
+#-----------------------------------------------------------------------------
+# Option to allow the user to enable warnings by groups
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_GROUPTHREE_WARNINGS)
+ message (STATUS "....Group Three warnings are enabled")
+ if (MSVC)
+ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}")
+ list (APPEND HDF5_CMAKE_CXX_FLAGS "/W4")
+ endif ()
+ else ()
+ if (CMAKE_COMPILER_IS_GNUCC)
+ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CFLAGS3})
+ endif ()
+ endif ()
+ endif ()
+endif ()
+
+#-----------------------------------------------------------------------------
+# Option to allow the user to enable warnings by groups
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_GROUPFOUR_WARNINGS)
+ message (STATUS "....Group Four warnings are enabled")
+ if (NOT MSVC)
+ if (CMAKE_COMPILER_IS_GNUCC)
+ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CFLAGS4})
+ endif ()
+ endif ()
+ endif ()
+endif ()
+
+#-----------------------------------------------------------------------------
+# This is in here to help some of the GCC based IDES like Eclipse
+# and code blocks parse the compiler errors and warnings better.
+#-----------------------------------------------------------------------------
+if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0")
+endif ()
+
+#-----------------------------------------------------------------------------
+# Option for --enable-symbols
+# This option will force/override the default setting for all configurations
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_SYMBOLS MATCHES "YES")
+ if(CMAKE_CXX_COMPILER_LOADED)
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
+ endif ()
+ endif ()
+elseif (HDF5_ENABLE_SYMBOLS MATCHES "NO")
+ if(CMAKE_CXX_COMPILER_LOADED)
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
+ set (CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wl,-s")
+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s")
+ endif ()
+ endif ()
+endif ()
+
+#-----------------------------------------------------------------------------
+# Option for --enable-profiling
+# This option will force/override the default setting for all configurations
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_PROFILING)
+ if(CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS "${PROFILE_CXXFLAGS}")
+ endif ()
+endif ()
+
+#-----------------------------------------------------------------------------
+# Option for --enable-optimization
+# This option will force/override the default setting for all configurations
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_OPTIMIZATION)
+ if(CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS "${OPTIMIZE_CXXFLAGS}")
+ endif ()
+endif ()
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index 03c6936..b255e22 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -49,18 +49,6 @@ if (CMAKE_COMPILER_IS_GNUCC)
endif ()
endif ()
endif ()
-if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
- set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}")
- if (${HDF_CFG_NAME} MATCHES "Debug")
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ftrapv -fno-common")
- endif ()
- else ()
- if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstdarg-opt")
- endif ()
- endif ()
-endif ()
#-----------------------------------------------------------------------------
# Option to allow the user to disable compiler warnings
@@ -74,10 +62,6 @@ if (HDF5_DISABLE_COMPILER_WARNINGS)
set (HDF5_WARNINGS_BLOCKED 1)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W0")
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
- string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0")
- endif ()
endif ()
if (WIN32)
add_definitions (-D_CRT_SECURE_NO_WARNINGS)
@@ -91,9 +75,6 @@ if (HDF5_DISABLE_COMPILER_WARNINGS)
# Most compilers use -w to suppress warnings.
if (NOT HDF5_WARNINGS_BLOCKED)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
- endif ()
endif ()
endif ()
@@ -119,8 +100,7 @@ if (NOT MSVC)
# NOTE: Don't add -Wpadded here since we can't/won't fix the (many)
# warnings that are emitted. If you need it, add it at configure time.
if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
- ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings-general")
- message (STATUS "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}")
+ ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/general")
list (APPEND H5_CFLAGS0 "-Wcomment -Wdeprecated -Wmain -Wmissing-declarations -Wmissing-prototypes -Wp64 -Wpointer-arith")
list (APPEND H5_CFLAGS0 "-Wreturn-type -Wstrict-prototypes -Wuninitialized")
list (APPEND H5_CFLAGS0 "-Wunknown-pragmas -Wunused-function -Wunused-variable")
@@ -132,18 +112,17 @@ if (NOT MSVC)
endif()
elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/general")
- message (STATUS "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}")
ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-general")
# gcc automatically inlines based on the optimization level
# this is just a failsafe
list (APPEND H5_CFLAGS0 "-finline-functions")
elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/general")
- message (STATUS "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}")
ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/error-general")
elseif (CMAKE_C_COMPILER_ID STREQUAL "PGI")
list (APPEND HDF5_CMAKE_C_FLAGS "-Minform=inform")
endif ()
+ message (STATUS "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}")
endif ()
#-----------------------------------------------------------------------------
@@ -287,17 +266,9 @@ if (HDF5_ENABLE_ALL_WARNINGS)
if (HDF5_ENABLE_DEV_WARNINGS)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
list (APPEND HDF5_CMAKE_C_FLAGS "/Wall /wd4668")
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
- string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- list (APPEND HDF5_CMAKE_CXX_FLAGS "/Wall /wd4668")
- endif ()
else ()
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
list (APPEND HDF5_CMAKE_C_FLAGS "/W3")
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
- string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- list (APPEND HDF5_CMAKE_CXX_FLAGS "/W3")
- endif ()
endif ()
else ()
if (CMAKE_COMPILER_IS_GNUCC)
@@ -315,10 +286,6 @@ if (HDF5_ENABLE_GROUPZERO_WARNINGS)
if (MSVC)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}")
list (APPEND HDF5_CMAKE_C_FLAGS "/W1")
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
- string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}")
- list (APPEND HDF5_CMAKE_CXX_FLAGS "/W1")
- endif ()
else ()
if (CMAKE_COMPILER_IS_GNUCC)
list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS0})
@@ -335,12 +302,10 @@ if (HDF5_ENABLE_GROUPONE_WARNINGS)
if (MSVC)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}")
list (APPEND HDF5_CMAKE_C_FLAGS "/W2")
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
- string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}")
- list (APPEND HDF5_CMAKE_CXX_FLAGS "/W2")
- endif ()
else ()
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS1})
+ if (CMAKE_COMPILER_IS_GNUCC)
+ list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS1})
+ endif ()
endif ()
endif ()
@@ -353,12 +318,10 @@ if (HDF5_ENABLE_GROUPTWO_WARNINGS)
if (MSVC)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}")
list (APPEND HDF5_CMAKE_C_FLAGS "/W3")
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
- string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}")
- list (APPEND HDF5_CMAKE_CXX_FLAGS "/W3")
- endif ()
else ()
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS2})
+ if (CMAKE_COMPILER_IS_GNUCC)
+ list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS2})
+ endif ()
endif ()
endif ()
@@ -371,12 +334,10 @@ if (HDF5_ENABLE_GROUPTHREE_WARNINGS)
if (MSVC)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}")
list (APPEND HDF5_CMAKE_C_FLAGS "/W4")
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
- string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}")
- list (APPEND HDF5_CMAKE_CXX_FLAGS "/W4")
- endif ()
else ()
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS3})
+ if (CMAKE_COMPILER_IS_GNUCC)
+ list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS3})
+ endif ()
endif ()
endif ()
@@ -387,7 +348,9 @@ option (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF)
if (HDF5_ENABLE_GROUPFOUR_WARNINGS)
message (STATUS "....Group Four warnings are enabled")
if (NOT MSVC)
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS4})
+ if (CMAKE_COMPILER_IS_GNUCC)
+ list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS4})
+ endif ()
endif ()
endif ()
@@ -398,9 +361,6 @@ endif ()
if (CMAKE_COMPILER_IS_GNUCC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0")
endif ()
-if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0")
-endif ()
#-----------------------------------------------------------------------------
# Option for --enable-asserts
@@ -430,26 +390,12 @@ if (HDF5_ENABLE_SYMBOLS MATCHES "YES")
elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -fno-omit-frame-pointer")
endif ()
- if(CMAKE_CXX_COMPILER_LOADED)
- if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
- elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
- endif ()
- endif ()
elseif (HDF5_ENABLE_SYMBOLS MATCHES "NO")
if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-s")
elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s")
endif ()
- if(CMAKE_CXX_COMPILER_LOADED)
- if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
- set (CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wl,-s")
- elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s")
- endif ()
- endif ()
endif ()
MARK_AS_ADVANCED (HDF5_ENABLE_SYMBOLS)
@@ -460,9 +406,6 @@ MARK_AS_ADVANCED (HDF5_ENABLE_SYMBOLS)
option (HDF5_ENABLE_PROFILING "Enable profiling flags independently from the build mode." OFF)
if (HDF5_ENABLE_PROFILING)
list (APPEND HDF5_CMAKE_C_FLAGS "${PROFILE_CFLAGS}")
- if(CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS "${PROFILE_CXXFLAGS}")
- endif ()
endif ()
MARK_AS_ADVANCED (HDF5_ENABLE_PROFILING)
@@ -473,8 +416,5 @@ MARK_AS_ADVANCED (HDF5_ENABLE_PROFILING)
option (HDF5_ENABLE_OPTIMIZATION "Enable optimization flags/settings independently from the build mode" OFF)
if (HDF5_ENABLE_OPTIMIZATION)
list (APPEND HDF5_CMAKE_C_FLAGS "${OPTIMIZE_CFLAGS}")
- if(CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS "${OPTIMIZE_CXXFLAGS}")
- endif ()
endif ()
MARK_AS_ADVANCED (HDF5_ENABLE_OPTIMIZATION)
diff --git a/config/cmake/HDFFortranCompilerFlags.cmake b/config/cmake/HDFFortranCompilerFlags.cmake
new file mode 100644
index 0000000..f31eba5
--- /dev/null
+++ b/config/cmake/HDFFortranCompilerFlags.cmake
@@ -0,0 +1,142 @@
+#
+# Copyright by The HDF Group.
+# 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://support.hdfgroup.org/ftp/HDF5/releases.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+#
+
+macro (ADD_H5_FFLAGS h5_fflag_var infile)
+ file (STRINGS ${infile} TEST_FLAG_STREAM)
+ #message (STATUS "TEST_FLAG_STREAM=${TEST_FLAG_STREAM}")
+ list (LENGTH TEST_FLAG_STREAM len_flag)
+ if (len_flag GREATER 0)
+ math (EXPR _FP_LEN "${len_flag} - 1")
+ foreach (line RANGE 0 ${_FP_LEN})
+ list (GET TEST_FLAG_STREAM ${line} str_flag)
+ string (REGEX REPLACE "^#.*" "" str_flag "${str_flag}")
+ #message (STATUS "str_flag=${str_flag}")
+ if (str_flag)
+ list (APPEND ${h5_fflag_var} "${str_flag}")
+ endif ()
+ endforeach ()
+ endif ()
+ #message (STATUS "h5_fflag_var=${${h5_fflag_var}}")
+endmacro ()
+
+message (STATUS "Warnings Configuration: default Fortran: ${CMAKE_Fortran_FLAGS}")
+
+#-----------------------------------------------------------------------------
+# Option to allow the user to disable compiler warnings
+#-----------------------------------------------------------------------------
+if (HDF5_DISABLE_COMPILER_WARNINGS)
+ message (STATUS "....Compiler warnings are suppressed")
+ # MSVC uses /w to suppress warnings. It also complains if another
+ # warning level is given, so remove it.
+ if (MSVC)
+ set (HDF5_WARNINGS_BLOCKED 1)
+ if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
+ set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /warn:none")
+ endif ()
+ endif ()
+ if (WIN32)
+ add_definitions (-D_CRT_SECURE_NO_WARNINGS)
+ endif ()
+ # Borland uses -w- to suppress warnings.
+ if (BORLAND)
+ set (HDF5_WARNINGS_BLOCKED 1)
+ set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -w-")
+ endif ()
+
+ # Most compilers use -w to suppress warnings.
+ if (NOT HDF5_WARNINGS_BLOCKED)
+ set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -w")
+ endif ()
+endif ()
+
+#-----------------------------------------------------------------------------
+# HDF5 library compile options
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+# CDash is configured to only allow 3000 warnings, so
+# break into groups (from the config/gnu-flags file)
+#-----------------------------------------------------------------------------
+if (NOT MSVC)
+ # General flags
+ if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
+ ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/ifort-general")
+ list (APPEND HDF5_CMAKE_Fortran_FLAGS "-stand:f03" "-free")
+ elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
+ ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-general")
+ list (APPEND HDF5_CMAKE_Fortran_FLAGS "-ffree-form" "-std=f2008" "-fimplicit-none")
+ elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "PGI")
+ list (APPEND HDF5_CMAKE_Fortran_FLAGS "-Mfreeform" "-Mdclchk" "-Mstandard" "-Mallocatable=03")
+ endif ()
+ message (STATUS "HDF5_CMAKE_Fortran_FLAGS=${HDF5_CMAKE_Fortran_FLAGS}")
+
+ if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
+ # Append warning flags that only gcc 4.4+ knows about
+ ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.4")
+ endif ()
+
+ # Append more extra warning flags that only gcc 4.5+ know about
+ if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.5)
+ ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.5")
+ endif ()
+
+ # Append more extra warning flags that only gcc 4.6+ know about
+ #if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.6)
+ # ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.6")
+ #endif ()
+
+ # Append more extra warning flags that only gcc 4.7+ know about
+ if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.7)
+ ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.7")
+ endif ()
+
+ # Append more extra warning flags that only gcc 4.8+ know about
+ if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.8)
+ ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.8")
+ endif ()
+
+ # Append more extra warning flags that only gcc 4.9+ know about
+ #if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.9)
+ # ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.9")
+ #endif ()
+
+ # Append more extra warning flags that only gcc 5.1+ know about
+ if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 5.0)
+ ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-5")
+ endif ()
+
+ # Append more extra warning flags that only gcc 6.x+ know about
+ if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 6.0)
+ ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-6")
+ endif ()
+
+ # Append more extra warning flags that only gcc 7.x+ know about
+ #if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0)
+ # ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-7")
+ #endif ()
+
+ # Append more extra warning flags that only gcc 8.x+ know about
+ if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 8.0)
+ ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-8")
+ endif ()
+
+ # Append more extra warning flags that only gcc 9.x+ know about
+ #if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 9.0)
+ # ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-9")
+ #endif ()
+else ()
+ if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
+ #ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/win-ifort-general")
+ list (APPEND HDF5_CMAKE_Fortran_FLAGS "/warn:all" "/stand:f03" "/free")
+ endif ()
+endif ()
+
diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in
index 292eaca..e9a8395 100644
--- a/config/cmake/libhdf5.settings.cmake.in
+++ b/config/cmake/libhdf5.settings.cmake.in
@@ -46,7 +46,7 @@ Languages:
Fortran: @HDF5_BUILD_FORTRAN@
@BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Compiler: @CMAKE_Fortran_COMPILER@ @CMAKE_Fortran_COMPILER_VERSION@
@BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Flags: @CMAKE_Fortran_FLAGS@
-@BUILD_FORTRAN_CONDITIONAL_TRUE@ H5 Fortran Flags: @H5_FCFLAGS@
+@BUILD_FORTRAN_CONDITIONAL_TRUE@ H5 Fortran Flags: @HDF5_CMAKE_Fortran_FLAGS@
@BUILD_FORTRAN_CONDITIONAL_TRUE@ AM Fortran Flags: @AM_FCFLAGS@
@BUILD_FORTRAN_CONDITIONAL_TRUE@ Shared Fortran Library: @H5_ENABLE_SHARED_LIB@
@BUILD_FORTRAN_CONDITIONAL_TRUE@ Static Fortran Library: @H5_ENABLE_STATIC_LIB@
diff --git a/config/gnu-cxxflags b/config/gnu-cxxflags
index f8a6d8c..9ae38f6 100644
--- a/config/gnu-cxxflags
+++ b/config/gnu-cxxflags
@@ -1,4 +1,4 @@
-# -*- shell-script -*-
+# -*- shell-script -*-
#
# Copyright by The HDF Group.
# Copyright by the Board of Trustees of the University of Illinois.
@@ -17,19 +17,51 @@
# if the compiler is not GNU; otherwise `cxx_flags_set' is set to `yes'
#
+#
+# For now, do not promote any warnings to errors.
+#
+PROMOTE_ERRORS_DFLT=no
+
+#
+# This filter rewrites -Werror= as -W, in that way demoting warnings
+# promoted to errors back to warnings, if PROMOTE_ERRORS is no.
+#
+demote_errors()
+{
+ if [ ${PROMOTE_ERRORS:-${PROMOTE_ERRORS_DFLT}} = no ]; then
+ sed 's,-Werror=,-W,g'
+ else
+ cat
+ fi
+}
+
+#
+# Prepend `$srcdir/config/gnu-warnings/` to the filename suffix(es) given as
+# subroutine argument(s), remove comments starting with # and ending
+# at EOL, replace spans of whitespace (including newlines) with spaces,
+# and re-emit the file(s) thus filtered on the standard output stream.
+#
+load_gnu_arguments()
+{
+ set -- $(for arg; do
+ sed 's,#.*$,,' $srcdir/config/gnu-warnings/${arg} | demote_errors
+ done)
+ IFS=' ' echo "$*"
+}
+
# Get the compiler version in a way that works for g++
# unless a compiler version is already known
#
# cxx_vendor: The compiler name: g++
# cxx_version: Version number: 2.91.60, 2.7.2.1
#
-if test X = "X$cxx_flags_set"; then
+if test "X-" = "X-$cxx_flags_set"; then
# PathScale compiler spits out gcc version string too. Need to
# filter it out.
# icc beginning with version 12 includes a "gcc version compatiblilty"
- # string, causing the gcc H5_CFLAGS to be erroneously added. The line
+ # string, causing the gcc H5_CXXFLAGS to be erroneously added. The line
# "grep -v 'icc version'" causes the discarding of any output
- # containing 'icc version'. The cc_version for icc is correctly determined
+ # containing 'icc version'. The cxx_version for icc is correctly determined
# and flags added in the intel-flags script.
cxx_version="`$CXX $CXXFLAGS $H5_CXXFLAGS -v 2>&1 | grep -v 'PathScale' |\
grep -v '^icc.*version' |\
@@ -37,13 +69,13 @@ if test X = "X$cxx_flags_set"; then
cxx_vendor=`echo $cxx_version |sed 's/\([a-z]*\).*/\1/'`
cxx_version=`echo $cxx_version |sed 's/[-a-z]//g'`
if test X = "X$cxx_vendor" -a X != "X$cxx_version"; then
- cxx_vendor=g++
+ cxx_vendor=g++
fi
if test "-" != "$cxx_vendor-$cxx_version"; then
- echo "compiler '$CXX' is GNU $cxx_vendor-$cxx_version"
+ echo "compiler '$CXX' is GNU $cxx_vendor-$cxx_version"
fi
- # Some version numbers
+ # Get the compiler version numbers
cxx_vers_major=`echo $cxx_version | cut -f1 -d.`
cxx_vers_minor=`echo $cxx_version | cut -f2 -d.`
cxx_vers_patch=`echo $cxx_version | cut -f3 -d.`
@@ -53,10 +85,12 @@ if test X = "X$cxx_flags_set"; then
cxx_vers_all=`expr $cxx_vers_major '*' 1000000 + $cxx_vers_minor '*' 1000 + $cxx_vers_patch`
fi
-# Common g++ flags for various situations
-case "$cxx_vendor-$cxx_version" in
- g++*)
- # Architecture-specific flags
+if test "X-g++" = "X-$cxx_vendor"; then
+
+ ###############################
+ # Architecture-specific flags #
+ ###############################
+
arch=
case "$host_os-$host_cpu" in
# FreeBSD sets the information from "uname -m" to the general machine
@@ -84,742 +118,197 @@ case "$cxx_vendor-$cxx_version" in
;;
esac
- # Host-specific flags
- case "`hostname`" in
- sleipnir.ncsa.uiuc.edu)
- arch="$arch -pipe"
- ;;
- esac
-
- # General (copied from H5_CFLAGS)
- H5_CXXFLAGS="$H5_CXXFLAGS $arch -pedantic -Wall -W -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wredundant-decls -Winline"
-
# C++-specific
- H5_CXXFLAGS="$H5_CXXFLAGS -Wsign-promo -Woverloaded-virtual -Wold-style-cast -Weffc++ -Wreorder -Wnon-virtual-dtor -Wctor-dtor-privacy -Wabi"
+ H5_CXXFLAGS="$H5_CXXFLAGS $arch
+
+ ##############
+ # Production #
+ ##############
- # Production
# NDEBUG is handled explicitly by the configure script
- case "$cxx_vendor-$cxx_version" in
- g++-[34].*)
+ if test $cxx_vers_major -le 4; then
PROD_CXXFLAGS=
- ;;
- g++-[56].*)
+ else
PROD_CXXFLAGS="-fstdarg-opt"
- ;;
- *)
- PROD_CXXFLAGS="-finline-functions"
- ;;
- esac
+ fi
+
+ #########
+ # Debug #
+ #########
- # Debug
# NDEBUG is handled explicitly by the configure script
- # -g is hanled by the symbols flags
- case "$cxx_vendor-$cxx_version" in
- g++-[56].*)
- DEBUG_CXXFLAGS="-ftrapv -fno-common"
- ;;
- *)
+ # -g is handled by the symbols flags
+ if test $cxx_vers_major -le 4; then
DEBUG_CXXFLAGS=
- ;;
- esac
+ else
+ DEBUG_CXXFLAGS="-ftrapv -fno-common"
+ fi
+
+ ###########
+ # Symbols #
+ ###########
- # Symbols
NO_SYMBOLS_CXXFLAGS="-s"
SYMBOLS_CXXFLAGS="-g"
- # Profile
+ #############
+ # Profiling #
+ #############
+
PROFILE_CXXFLAGS="-pg"
- # Optimization
- case "$cxx_vendor-$cxx_version" in
- g++-[34].*)
+ ################
+ # Optimization #
+ ################
+
+ if test $cxx_vers_major -le 4; then
HIGH_OPT_CXXFLAGS="-O3"
DEBUG_OPT_CXXFLAGS=
- ;;
- g++-[56].*)
+ else
HIGH_OPT_CXXFLAGS="-O3"
DEBUG_OPT_CXXFLAGS="-Og"
- ;;
- *)
- HIGH_OPT_CXXFLAGS="-O"
- DEBUG_OPT_CXXFLAGS=
- ;;
- esac
+ fi
NO_OPT_CXXFLAGS="-O0"
- # Flags are set
- cxx_flags_set=yes
- ;;
-esac
-
-# Version-specific g++ flags
-#
-# Please follow the pattern below by adding new versions at the top, copying
-# the information from the previous version and adding modifications to that.
-case "$cxx_vendor-$cxx_version" in
-
-# Closer to the g++ 5.2 release, we should check for additional flags to
-# include and break it out into it's own section, like the other versions
-# below. -QAK
- g++-[56]*)
+ ############
+ # Warnings #
+ ############
- # Append warning flags from gcc-3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
+# First load the C warnings then add CXX warnings (if needed)
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
+ ###########
+ # General #
+ ###########
- # Enable more format checking flags, beyond the basic -Wformat included
- # in -Wall
- H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2"
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments general)"
+ H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-general)"
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-general)"
+ #H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-cxx-general)"
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
+ ######################
+ # Developer warnings #
+ ######################
- # Append warning flags from gcc-3.3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
+ NO_DEVELOPER_WARNING_CXXFLAGS=$(load_gnu_arguments no-developer-general)
+ DEVELOPER_WARNING_CXXFLAGS=$(load_gnu_arguments developer-general)
- # Append warning flags from gcc-3.4* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch"
+ #######################
+ # gcc 4 special cases #
+ #######################
- # Replace old -W flag with new -Wextra flag
- H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`"
-
- # Append more extra warning flags that only gcc 4.0+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros"
-
- # Append more extra warning flags that only gcc 4.1+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations"
-
- # Append more extra warning flags that only gcc 4.2+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow"
-
- # Append more extra warning flags that only gcc 4.3+ know about
- #
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- H5_CXXFLAGS="$H5_CXXFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla"
-
- # Append more extra warning flags that only gcc 4.4+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
-
- # Append more extra warning flags that only gcc 4.5+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow=5"
-
- # Append more extra warning flags that only gcc 4.6+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines"
-
- # Append more extra warning flags that only gcc 4.7+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn"
-
- # Append more extra warning flags that only gcc 4.8+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wsuggest-attribute=format"
+ # GCC 4.2 through 4.6
+ if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 6; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.2-4.6)"
+ fi
- # Append more extra warning flags that only gcc 4.9+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wdate-time -Wopenmp-simd"
+ # GCC 4.2 through 4.3
+ if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 3; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.2-4.3)"
+ fi
- # (There was no release of gcc 5.0)
+ # GCC 4.5 through 4.6
+ if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 6; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.5-4.6)"
+ fi
- # Append more extra warning flags that only gcc 5.1+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Warray-bounds=2"
- ;;
+ # GCC 4.2 through 4.4
+ if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -a $cc_vers_major -eq 4 -a $cc_vers_minor -le 4; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.2-4.4)"
+ fi
- g++-4.9*)
- # Append warning flags
+ # GCC 4.2 through the end of GCC 4 series
+ if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.2-4.last)"
+ fi
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
+ #############################
+ # Version-specific warnings #
+ #############################
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
+ # gcc >= 4.3
+ if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 3; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.3)"
+ fi
- # Enable more format checking flags, beyond the basic -Wformat included
- # in -Wall
- H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2"
+ # gcc >= 4.4
+ if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 4; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.4)"
+ fi
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
+ # gcc >= 4.5
+ if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 5; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.5)"
+ DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments developer-4.5)"
+ NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments no-developer-4.5)"
+ fi
- # Append warning flags from gcc 3.3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
+ # gcc >= 4.6
+ if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 6; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.6)"
+ DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments developer-4.6)"
+ NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments no-developer-4.6)"
+ fi
- # Append warning flags from gcc 3.4* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch"
+ # gcc >= 4.7
+ if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 7; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.7)"
+ DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments developer-4.7)"
+ NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments no-developer-4.7)"
+ fi
- # Replace old -W flag with new -Wextra flag
- H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`"
+ # gcc >= 4.8
+ if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.8)"
+ DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments developer-4.8)"
+ NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments no-developer-4.8)"
+ fi
- # Append more extra warning flags that only gcc 4.0+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros"
+ # gcc >= 4.9
+ if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 9; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.9)"
+ fi
- # Append more extra warning flags that only gcc 4.1+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations"
+ # gcc >= 5
+ if test $cc_vers_major -ge 5; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 5)"
+ H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-5)"
+ fi
- # Append more extra warning flags that only gcc 4.2+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow"
+ # gcc >= 6
+ if test $cc_vers_major -ge 6; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 6)"
+ fi
- # Append more extra warning flags that only gcc 4.3+ know about
- #
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- H5_CXXFLAGS="$H5_CXXFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla"
+ # gcc >= 7
+ if test $cc_vers_major -ge 7; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 7)"
+ DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments developer-7)"
+ fi
- # Append more extra warning flags that only gcc 4.4+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
+ # gcc 8
+ if test $cc_vers_major -ge 8; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 8)"
+ H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-8)"
+ DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments developer-8)"
+ NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments no-developer-8)"
+ fi
- # Append more extra warning flags that only gcc 4.5+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow=5"
+ # gcc 9
+ if test $cc_vers_major -ge 9; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 9)"
+ fi
- # Append more extra warning flags that only gcc 4.6+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines"
+ #################
+ # Flags are set #
+ #################
+ cxx_flags_set=yes
+fi
- # Append more extra warning flags that only gcc 4.7+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn"
+# Version-specific g++ flags
- # Append more extra warning flags that only gcc 4.8+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wsuggest-attribute=format"
# Append more extra warning flags that only gcc 4.9+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wdate-time -Wopenmp-simd"
- ;;
-
- g++-4.8*)
- # Append warning flags
-
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
-
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
-
- # Enable more format checking flags, beyond the basic -Wformat included
- # in -Wall
- H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2"
-
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
-
- # Append warning flags from gcc-3.3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
-
- # Append warning flags from gcc-3.4* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch"
-
- # Replace old -W flag with new -Wextra flag
- H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`"
-
- # Append more extra warning flags that only gcc 4.0+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros"
-
- # Append more extra warning flags that only gcc 4.1+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations"
-
- # Append more extra warning flags that only gcc 4.2+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow"
-
- # Append more extra warning flags that only gcc 4.3+ know about
- #
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- H5_CXXFLAGS="$H5_CXXFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla"
-
- # Append more extra warning flags that only gcc 4.4+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
-
- # Append more extra warning flags that only gcc 4.5+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow=5"
-
- # Append more extra warning flags that only gcc 4.6+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines"
-
- # Append more extra warning flags that only gcc 4.7+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn"
-
- # Append more extra warning flags that only gcc 4.8+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wsuggest-attribute=format"
- ;;
-
- g++-4.7*)
- # Append warning flags
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
-
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
-
- # Enable more format checking flags, beyond the basic -Wformat included
- # in -Wall
- H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2"
-
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
-
- # Append warning flags from gcc-3.3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
-
- # Append warning flags from gcc-3.4* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch"
-
- # Replace old -W flag with new -Wextra flag
- H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`"
-
- # Append more extra warning flags that only gcc 4.0+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros"
-
- # Append more extra warning flags that only gcc 4.1+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations"
-
- # Append more extra warning flags that only gcc 4.2+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow"
-
- # Append more extra warning flags that only gcc 4.3+ know about
- #
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- H5_CXXFLAGS="$H5_CXXFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla"
-
- # Append more extra warning flags that only gcc 4.4+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
-
- # Append more extra warning flags that only gcc 4.5+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow=5"
-
- # Append more extra warning flags that only gcc 4.6+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines"
-
- # Append more extra warning flags that only gcc 4.7+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn"
- ;;
-
- g++-4.6*)
- # Disable warnings about using 'long long' type
- H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long"
-
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
-
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
-
- # Enable more format checking flags, beyond the basic -Wformat included
- # in -Wall
- H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2"
-
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
-
- # Append warning flags from gcc-3.3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
-
- # Append warning flags from gcc-3.4* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch"
-
- # Replace old -W flag with new -Wextra flag
- H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`"
-
- # Append more extra warning flags that only gcc 4.0+ knows about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros"
-
- # Append more extra warning flags that only gcc 4.1+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations"
-
- # Append more extra warning flags that only gcc 4.2+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow"
-
- # Append more extra warning flags that only gcc 4.3+ know about
- #
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- H5_CXXFLAGS="$H5_CXXFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla"
-
- # Append more extra warning flags that only gcc 4.4+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
-
- # Append more extra warning flags that only gcc 4.5+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-aliasing -Wstrict-overflow=5"
-
- # Append more extra warning flags that only gcc 4.6+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines"
- ;;
-
- g++-4.5*)
- # Disable warnings about using 'long long' type
- H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long"
-
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
-
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
-
- # Enable more format checking flags, beyond the basic -Wformat included
- # in -Wall
- H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2"
-
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
-
- # Append warning flags from gcc-3.3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
-
- # Append warning flags from gcc-3.4* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch"
-
- # Replace old -W flag with new -Wextra flag
- H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`"
-
- # Append more extra warning flags that only gcc4.0+ knows about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros"
-
- # Append more extra warning flags that only gcc 4.1+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations"
-
- # Append more extra warning flags that only gcc 4.2+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow"
-
- # Append more extra warning flags that only gcc 4.3+ know about
- #
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- H5_CXXFLAGS="$H5_CXXFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla"
-
- # Append more extra warning flags that only gcc 4.4+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
-
- # Append more extra warning flags that only gcc 4.5+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-aliasing -Wstrict-overflow=5"
- ;;
-
- g++-4.4*)
- # Disable warnings about using 'long long' type
- H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long"
-
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
-
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
-
- # Enable more format checking flags, beyond the basic -Wformat included
- # in -Wall
- H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2"
-
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
-
- # Append warning flags from gcc-3.3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
-
- # Append warning flags from gcc-3.4* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch"
-
- # Replace old -W flag with new -Wextra flag
- H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`"
-
- # Append more extra warning flags that only gcc 4.0+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros"
-
- # Append more extra warning flags that only gcc 4.1+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations"
-
- # Append more extra warning flags that only gcc 4.2+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow"
-
- # Append more extra warning flags that only gcc 4.3+ know about
- #
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- H5_CXXFLAGS="$H5_CXXFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla"
-
- # Append more extra warning flags that only gcc 4.4+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
- ;;
-
- g++-4.3*)
- # Disable warnings about using 'long long' type
- H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long"
-
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
-
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
-
- # Enable more format checking flags, beyond the basic -Wformat included
- # in -Wall
- H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2"
-
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
-
- # Append warning flags from gcc-3.3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
-
- # Append warning flags from gcc-3.4* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch"
-
- # Replace old -W flag with new -Wextra flag
- H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`"
-
- # Append more extra warning flags that only gcc 4.0+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros"
-
- # Append more extra warning flags that only gcc 4.1+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations -Wvolatile-register-var"
-
- # Append more extra warning flags that only gcc 4.2+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow"
-
- # Append more extra warning flags that only gcc 4.3+ know about
- #
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- H5_CXXFLAGS="$H5_CXXFLAGS -Wlogical-op -Wvla"
- ;;
-
- g++-4.2*)
- # Disable warnings about using 'long long' type
- H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long"
-
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
-
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
-
- # Enable more format checking flags, beyond the basic -Wformat included
- # in -Wall
- H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2"
-
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
-
- # Append warning flags from gcc-3.3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
-
- # Append warning flags from gcc-3.4* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch"
-
- # Replace old -W flag with new -Wextra flag
- H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`"
-
- # Append more extra warning flags that only gcc 4.0+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros"
-
- # Append more extra warning flags that only gcc 4.1+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations -Wvolatile-register-var"
-
- # Append more extra warning flags that only gcc 4.2+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow"
- ;;
-
- g++-4.1.*)
- # Disable warnings about using 'long long' type
- H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long"
-
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
-
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
-
- # Enable more format checking flags, beyond the basic -Wformat included
- # in -Wall
- H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2"
-
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
-
- # Append warning flags from gcc-3.3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
-
- # Append warning flags from gcc-3.4* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch"
-
- # Replace old -W flag with new -Wextra flag
- H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`"
-
- # Append more extra warning flags that only gcc 4.0+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros"
-
- # Append more extra warning flags that only gcc 4.1+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations -Wvolatile-register-var"
- ;;
-
- g++-4.0*)
- # Disable warnings about using 'long long' type
- H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long"
-
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
-
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
-
- # The "format=2" warning generates too many warnings about valid
- # usage in the library.
- #CXXFLAGS="$CXXFLAGS -Wformat=2"
-
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
-
- # Append warning flags from gcc-3.3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
-
- # Append warning flags from gcc-3.4* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch"
-
- # Replace old -W flag with new -Wextra flag
- H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`"
-
- # Append more extra warning flags that only gcc 4.0+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros"
- ;;
-
- g++-3.4*)
- # Disable warnings about using 'long long' type
- H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long"
-
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
-
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
-
- # The "format=2" warning generates too many warnings about valid
- # usage in the library.
- #CXXFLAGS="$CXXFLAGS -Wformat=2"
-
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
-
- # Append warning flags from gcc-3.3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
-
- # Append more extra warning flags that only gcc3.4+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch"
-
- # Replace old -W flag with new -Wextra flag
- H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`"
- ;;
-
- g++-3.3*)
- # Disable warnings about using 'long long' type
- H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long"
-
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
-
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
-
- # The "format=2" warning generates too many warnings about valid
- # usage in the library.
- #CXXFLAGS="$CXXFLAGS -Wformat=2"
-
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
-
- # Append more extra warning flags that only gcc3.3+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
- ;;
-
- g++-3.2*)
- # Disable warnings about using 'long long' type
- H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long"
-
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
-
- # Append more extra warning flags that only gcc3.2+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
-
- # The "format=2" warning generates too many warnings about valid
- # usage in the library.
- #CXXFLAGS="$CXXFLAGS -Wformat=2"
-
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
- ;;
-
- g++-3*)
- # Disable warnings about using 'long long' type
- H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long"
-
- # Append some extra warning flags that only gcc3+ know about
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
- ;;
-esac
+ -Wopenmp-simd"
# Clear cxx info if no flags set
if test "X$cxx_flags_set" = "X"; then
diff --git a/config/gnu-fflags b/config/gnu-fflags
index 185a4c6..2859158 100644
--- a/config/gnu-fflags
+++ b/config/gnu-fflags
@@ -17,6 +17,20 @@
# if the compiler is not GNU; otherwise `f9x_flags_set' is set to `yes'
#
+#
+# Prepend `$srcdir/config/gnu-warnings/` to the filename suffix(es) given as
+# subroutine argument(s), remove comments starting with # and ending
+# at EOL, replace spans of whitespace (including newlines) with spaces,
+# and re-emit the file(s) thus filtered on the standard output stream.
+#
+load_gnu_arguments()
+{
+ set -- $(for arg; do
+ sed 's,#.*$,,' $srcdir/config/gnu-warnings/${arg} | demote_errors
+ done)
+ IFS=' ' echo "$*"
+}
+
# Get the compiler version in a way that works for GNU fortran
# gfortran unless a compiler version is already known
#
@@ -95,8 +109,8 @@ if test "X-gfortran" = "X-$f9x_vendor"; then
# Symbols #
###########
- SYMBOLS_FCFLAGS="-g"
NO_SYMBOLS_FCFLAGS="-s"
+ SYMBOLS_FCFLAGS="-g"
#############
# Profiling #
@@ -125,8 +139,7 @@ if test "X-gfortran" = "X-$f9x_vendor"; then
# General #
###########
- H5_FCFLAGS="$H5_FCFLAGS -pedantic -Wall -Wextra -Wunderflow -Wimplicit-interface -Wsurprising"
- H5_FCFLAGS="$H5_FCFLAGS -Waliasing -Wcharacter-truncation"
+ H5_FCFLAGS="$H5_CFLAGS $(load_gnu_arguments gfort-general)"
#############################
# Version-specific warnings #
@@ -134,48 +147,45 @@ if test "X-gfortran" = "X-$f9x_vendor"; then
# gfortran 4.3 (nothing new)
- # gfortran 4.4
+ # gfortran >= 4.4
if test $f9x_vers_major -ge 5 -o $f9x_vers_major -eq 4 -a $f9x_vers_minor -ge 4; then
- H5_FCFLAGS="$H5_FCFLAGS -Warray-temporaries -Wintrinsics-std"
+ H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-4.4)"
fi
- # gfortran 4.5
+ # gfortran >= 4.5
if test $f9x_vers_major -ge 5 -o $f9x_vers_major -eq 4 -a $f9x_vers_minor -ge 5; then
- H5_FCFLAGS="$H5_FCFLAGS -Wimplicit-procedure"
+ H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-4.5)"
fi
# gfortran 4.6 (nothing new)
- # gfortran 4.7
+ # gfortran >= 4.7
if test $f9x_vers_major -ge 5 -o $f9x_vers_major -eq 4 -a $f9x_vers_minor -ge 7; then
- H5_FCFLAGS="$H5_FCFLAGS -Wreal-q-constant -Wfunction-elimination"
+ H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-4.7)"
fi
- # gfortran 4.8
+ # gfortran >= 4.8
if test $f9x_vers_major -ge 5 -o $f9x_vers_major -eq 4 -a $f9x_vers_minor -ge 8; then
- H5_FCFLAGS="$H5_FCFLAGS -Wrealloc-lhs -Wrealloc-lhs-all"
- # Turn off warnings for passing non-ANSI types to BIND().
- # We pass a lot of hid_t, etc. types so this generates a LOT of spurious warnings.
- H5_FCFLAGS="$H5_FCFLAGS -Wno-c-binding-type"
+ H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-4.8)"
fi
# gfortran 4.9 (nothing new)
- # gfortran 5
+ # gfortran >= 5
if test $f9x_vers_major -ge 5; then
- H5_FCFLAGS="$H5_FCFLAGS -Wuse-without-only"
+ H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-5)"
fi
- # gfortran 6
+ # gfortran >= 6
if test $f9x_vers_major -ge 6; then
- H5_FCFLAGS="$H5_FCFLAGS -Winteger-division"
+ H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-6)"
fi
# gfortran 7 (nothing new)
- # gfortran 8
+ # gfortran >= 8
if test $f9x_vers_major -ge 8; then
- H5_FCFLAGS="$H5_FCFLAGS -Wfrontend-loop-interchange"
+ H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-8)"
fi
# gfortran 9 (nothing new)
diff --git a/config/gnu-flags b/config/gnu-flags
index ca0e1b4..c2904fe 100644
--- a/config/gnu-flags
+++ b/config/gnu-flags
@@ -36,12 +36,12 @@ demote_errors()
}
#
-# Prepend `$srcdir/config/gnu-` to the filename suffix(es) given as
+# Prepend `$srcdir/config/gnu-warnings/` to the filename suffix(es) given as
# subroutine argument(s), remove comments starting with # and ending
# at EOL, replace spans of whitespace (including newlines) with spaces,
# and re-emit the file(s) thus filtered on the standard output stream.
#
-load_gcc_arguments()
+load_gnu_arguments()
{
set -- $(for arg; do
sed 's,#.*$,,' $srcdir/config/gnu-warnings/${arg} | demote_errors
@@ -49,7 +49,6 @@ load_gcc_arguments()
IFS=' ' echo "$*"
}
-
# Get the compiler version in a way that works for gcc
# unless a compiler version is already known
#
@@ -189,15 +188,15 @@ if test "X-gcc" = "X-$cc_vendor"; then
# General #
###########
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments general)"
- H5_ECFLAGS="$H5_ECFLAGS $(load_gcc_arguments error-general)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments general)"
+ H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-general)"
######################
# Developer warnings #
######################
- NO_DEVELOPER_WARNING_CFLAGS=$(load_gcc_arguments no-developer-general)
- DEVELOPER_WARNING_CFLAGS=$(load_gcc_arguments developer-general)
+ NO_DEVELOPER_WARNING_CFLAGS=$(load_gnu_arguments no-developer-general)
+ DEVELOPER_WARNING_CFLAGS=$(load_gnu_arguments developer-general)
#######################
# gcc 4 special cases #
@@ -205,27 +204,27 @@ if test "X-gcc" = "X-$cc_vendor"; then
# GCC 4.2 through 4.6
if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 6; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.2-4.6)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.2-4.6)"
fi
# GCC 4.2 through 4.3
if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 3; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.2-4.3)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.2-4.3)"
fi
# GCC 4.5 through 4.6
if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 6; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.5-4.6)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.5-4.6)"
fi
# GCC 4.2 through 4.4
if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -a $cc_vers_major -eq 4 -a $cc_vers_minor -le 4; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.2-4.4)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.2-4.4)"
fi
# GCC 4.2 through the end of GCC 4 series
if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.2-4.last)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.2-4.last)"
fi
#############################
@@ -234,75 +233,75 @@ if test "X-gcc" = "X-$cc_vendor"; then
# gcc >= 4.3
if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 3; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.3)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.3)"
fi
# gcc >= 4.4
if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 4; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.4)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.4)"
fi
# gcc >= 4.5
if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 5; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.5)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.5)"
DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.5)"
NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.5)"
fi
# gcc >= 4.6
if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 6; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.6)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.6)"
DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.6)"
NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.6)"
fi
# gcc >= 4.7
if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 7; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.7)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.7)"
DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.7)"
NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.7)"
fi
# gcc >= 4.8
if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.8)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.8)"
DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.8)"
NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.8)"
fi
# gcc >= 4.9
if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 9; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.9)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.9)"
fi
# gcc >= 5
if test $cc_vers_major -ge 5; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 5)"
- H5_ECFLAGS="$H5_ECFLAGS $(load_gcc_arguments error-5)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 5)"
+ H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-5)"
fi
# gcc >= 6
if test $cc_vers_major -ge 6; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 6)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 6)"
fi
# gcc >= 7
if test $cc_vers_major -ge 7; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 7)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 7)"
DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-7)"
fi
# gcc 8
if test $cc_vers_major -ge 8; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 8)"
- H5_ECFLAGS="$H5_ECFLAGS $(load_gcc_arguments error-8)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 8)"
+ H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-8)"
DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-8)"
NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-8)"
fi
# gcc 9
if test $cc_vers_major -ge 9; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 9)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 9)"
fi
#################
@@ -316,3 +315,4 @@ if test "X$cc_flags_set" = "X"; then
cc_vendor=
cc_version=
fi
+
diff --git a/config/intel-warnings-general b/config/gnu-warnings/cxx-general
index f4ed24c..ee7ee22 100644
--- a/config/intel-warnings-general
+++ b/config/gnu-warnings/cxx-general
@@ -6,5 +6,14 @@
# NOTE: Don't add -Wpadded here since we can't/won't fix the (many)
# warnings that are emitted. If you need it, add it from the
# environment variable at configure time.
--Wall
--Wcheck \ No newline at end of file
+-Wabi
+-Wctor-dtor-privacy
+-Weffc++
+##-Wendif-labels
+-Wnon-virtual-dtor
+-Wold-style-cast
+-Woverloaded-virtual
+-Wreorder
+-Wsign-promo
+##-Wunreachable-code
+##-Wvariadic-macros
diff --git a/config/gnu-warnings/gfort-4.4 b/config/gnu-warnings/gfort-4.4
new file mode 100644
index 0000000..59fe9a2
--- /dev/null
+++ b/config/gnu-warnings/gfort-4.4
@@ -0,0 +1,2 @@
+-Warray-temporaries
+-Wintrinsics-std \ No newline at end of file
diff --git a/config/gnu-warnings/gfort-4.5 b/config/gnu-warnings/gfort-4.5
new file mode 100644
index 0000000..4490d4e
--- /dev/null
+++ b/config/gnu-warnings/gfort-4.5
@@ -0,0 +1 @@
+-Wimplicit-procedure
diff --git a/config/gnu-warnings/gfort-4.7 b/config/gnu-warnings/gfort-4.7
new file mode 100644
index 0000000..a7532bb
--- /dev/null
+++ b/config/gnu-warnings/gfort-4.7
@@ -0,0 +1,2 @@
+-Wreal-q-constant
+-Wfunction-elimination
diff --git a/config/gnu-warnings/gfort-4.8 b/config/gnu-warnings/gfort-4.8
new file mode 100644
index 0000000..1b96a51
--- /dev/null
+++ b/config/gnu-warnings/gfort-4.8
@@ -0,0 +1,5 @@
+-Wrealloc-lhs
+-Wrealloc-lhs-all
+# Turn off warnings for passing non-ANSI types to BIND().
+# We pass a lot of hid_t, etc. types so this generates a LOT of spurious warnings.
+-Wno-c-binding-type
diff --git a/config/gnu-warnings/gfort-5 b/config/gnu-warnings/gfort-5
new file mode 100644
index 0000000..c5d3850
--- /dev/null
+++ b/config/gnu-warnings/gfort-5
@@ -0,0 +1 @@
+-Wuse-without-only
diff --git a/config/gnu-warnings/gfort-6 b/config/gnu-warnings/gfort-6
new file mode 100644
index 0000000..f70466c
--- /dev/null
+++ b/config/gnu-warnings/gfort-6
@@ -0,0 +1 @@
+-Winteger-division
diff --git a/config/gnu-warnings/gfort-8 b/config/gnu-warnings/gfort-8
new file mode 100644
index 0000000..5097365
--- /dev/null
+++ b/config/gnu-warnings/gfort-8
@@ -0,0 +1 @@
+-Wfrontend-loop-interchange
diff --git a/config/gnu-warnings/gfort-general b/config/gnu-warnings/gfort-general
new file mode 100644
index 0000000..4028316
--- /dev/null
+++ b/config/gnu-warnings/gfort-general
@@ -0,0 +1,12 @@
+# Note that some of the flags listed here really should be developer
+# flags (listed in separate files, gnu-warnings-developer*) but we put
+# them here because they are not raised by the current code and we'd like to
+# know if they do start showing up.
+-Waliasing
+-Wall
+-Wcharacter-truncation
+-Wextra
+-Wimplicit-interface
+-Wsurprising
+-Wunderflow
+-pedantic
diff --git a/config/intel-fflags b/config/intel-fflags
index 8b1110e..ed7ee52 100644
--- a/config/intel-fflags
+++ b/config/intel-fflags
@@ -1,4 +1,4 @@
-# -*- shell-script -*-
+# -*- shell-script -*-
#
# Copyright by The HDF Group.
# Copyright by the Board of Trustees of the University of Illinois.
@@ -17,6 +17,20 @@
# if the compiler is not Intel; otherwise `f9x_flags_set' is set to `yes'
#
+#
+# Prepend `$srcdir/config/intel-warnings/` to the filename suffix(es) given as
+# subroutine argument(s), remove comments starting with # and ending
+# at EOL, replace spans of whitespace (including newlines) with spaces,
+# and re-emit the file(s) thus filtered on the standard output stream.
+#
+load_intel_arguments()
+{
+ set -- $(for arg; do
+ sed 's,#.*$,,' $srcdir/config/intel-warnings/${arg}
+ done)
+ IFS=' ' echo "$*"
+}
+
# Get the compiler version in a way that works for ifort
# ifort unless a compiler version is already known
#
@@ -44,8 +58,8 @@ fi
# Common Intel flags for various situations
if test "X-ifort" = "X-$f9x_vendor"; then
- # Insert section about version specific problems from gnu-flags here, if
- # necessary.
+ # Insert section about version specific problems from compiler flags here,
+ # if necessary.
arch=
# Architecture-specific flags
@@ -68,7 +82,8 @@ if test "X-ifort" = "X-$f9x_vendor"; then
FC_BASENAME=ifort
F9XSUFFIXFLAG=""
FSEARCH_DIRS=""
- H5_FCFLAGS="$H5_FCFLAGS"
+ H5_FCFLAGS="$H5_FCFLAGS -stand:f03 -free"
+ H5_FCFLAGS="$H5_FCFLAGS $(load_intel_arguments ifort-general)"
# Production
PROD_FCFLAGS=
@@ -89,7 +104,9 @@ if test "X-ifort" = "X-$f9x_vendor"; then
DEBUG_OPT_FCFLAGS=
NO_OPT_FCFLAGS=
- # Flags are set
+ #################
+ # Flags are set #
+ #################
f9x_flags_set=yes
fi
diff --git a/config/intel-flags b/config/intel-flags
index 6b4e406..100e68a 100644
--- a/config/intel-flags
+++ b/config/intel-flags
@@ -18,7 +18,7 @@
#
#
-# Prepend `$srcdir/config/intel-` to the filename suffix(es) given as
+# Prepend `$srcdir/config/intel-warnings/` to the filename suffix(es) given as
# subroutine argument(s), remove comments starting with # and ending
# at EOL, replace spans of whitespace (including newlines) with spaces,
# and re-emit the file(s) thus filtered on the standard output stream.
@@ -26,7 +26,7 @@
load_intel_arguments()
{
set -- $(for arg; do
- sed 's,#.*$,,' $srcdir/config/intel-${arg}
+ sed 's,#.*$,,' $srcdir/config/intel-warnings/${arg}
done)
IFS=' ' echo "$*"
}
@@ -81,7 +81,6 @@ if test "X-icc" = "X-$cc_vendor"; then
# General
# Default to C99 standard.
H5_CFLAGS="$H5_CFLAGS $arch -std=c99"
- H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments warnings-general)"
# Production
PROD_CFLAGS=
@@ -103,16 +102,20 @@ if test "X-icc" = "X-$cc_vendor"; then
DEBUG_OPT_CFLAGS="-O0"
NO_OPT_CFLAGS="-O0"
- # Flags are set
- cc_flags_set=yes
+ ############
+ # Warnings #
+ ############
-fi
+ ###########
+ # General #
+ ###########
+
+ H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments general)"
+
+ #############################
+ # Version-specific warnings #
+ #############################
-# Version specific ICC flags
-#
-# Please follow the pattern below by adding new versions at the top, copying
-# the information from the previous version and adding modifications to that.
-# The default at the bottom will apply if no earlier version matches.
case "$cc_vendor-$cc_version" in
icc-1[5-6]*)
H5_CFLAGS="$H5_CFLAGS -Wcomment -Wdeprecated -Wextra-tokens -Wformat -Wformat-security -Wmain -Wmissing-declarations -Wmissing-prototypes -Wp64 -Wpointer-arith -Wreturn-type -Wshadow -Wstrict-prototypes -Wtrigraphs -Wuninitialized -Wunknown-pragmas -Wunused-function -Wunused-variable -Wwrite-strings"
@@ -128,6 +131,13 @@ case "$cc_vendor-$cc_version" in
;;
esac
+ #################
+ # Flags are set #
+ #################
+ cc_flags_set=yes
+
+fi
+
# Clear cc info if no flags set
if test "X-$cc_flags_set" = "X-"; then
cc_vendor=
diff --git a/config/intel-warnings/general b/config/intel-warnings/general
new file mode 100644
index 0000000..d0b2e25
--- /dev/null
+++ b/config/intel-warnings/general
@@ -0,0 +1,2 @@
+-Wall
+-Wcheck \ No newline at end of file
diff --git a/config/intel-warnings/ifort-general b/config/intel-warnings/ifort-general
new file mode 100644
index 0000000..a9da0e5
--- /dev/null
+++ b/config/intel-warnings/ifort-general
@@ -0,0 +1 @@
+-warn:all
diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt
index aa702ff..02a71c3 100644
--- a/fortran/examples/CMakeLists.txt
+++ b/fortran/examples/CMakeLists.txt
@@ -35,28 +35,22 @@ set (F2003_examples
foreach (example ${examples})
add_executable (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90)
- target_compile_options(f90_ex_${example}
- PRIVATE
- $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
- )
-# set_property(TARGET f90_ex_${example} APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-# )
-# set_property(TARGET f90_ex_${example} APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-# )
+ target_compile_options(f90_ex_${example} PRIVATE $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>)
+# set_property(TARGET f90_ex_${example} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">)
+# set_property(TARGET f90_ex_${example} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>)
if(MSVC)
set_property(TARGET f90_ex_${example} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
if (NOT BUILD_SHARED_LIBS)
target_include_directories (f90_ex_${example}
PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static"
- )
- target_link_libraries (f90_ex_${example}
- PRIVATE
- ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/static"
+ "${HDF5_SRC_DIR}"
+ "${HDF5_BINARY_DIR}"
+ "${HDF5_F90_BINARY_DIR}"
+ "${HDF5_F90_BINARY_DIR}/static"
)
+ target_link_libraries (f90_ex_${example} PRIVATE ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET})
set_target_properties (f90_ex_${example} PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER examples/fortran
@@ -65,12 +59,13 @@ foreach (example ${examples})
else ()
target_include_directories (f90_ex_${example}
PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared"
- )
- target_link_libraries (f90_ex_${example}
- PRIVATE
- ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/shared"
+ "${HDF5_SRC_DIR}"
+ "${HDF5_BINARY_DIR}"
+ "${HDF5_F90_BINARY_DIR}"
+ "${HDF5_F90_BINARY_DIR}/shared"
)
+ target_link_libraries (f90_ex_${example} PRIVATE ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
set_target_properties (f90_ex_${example} PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER examples/fortran
@@ -81,28 +76,22 @@ endforeach ()
foreach (example ${F2003_examples})
add_executable (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90)
- target_compile_options(f03_ex_${example}
- PRIVATE
- $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
- )
-# set_property(TARGET f03_ex_${example} APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-# )
-# set_property(TARGET f03_ex_${example} APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-# )
+ target_compile_options(f03_ex_${example} PRIVATE $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>)
+# set_property(TARGET f03_ex_${example} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">)
+# set_property(TARGET f03_ex_${example} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>)
if(MSVC)
set_property(TARGET f03_ex_${example} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
if (NOT ONLY_SHARED_LIBS)
target_include_directories (f03_ex_${example}
PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static"
- )
- target_link_libraries (f03_ex_${example}
- PRIVATE
- ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/static"
+ "${HDF5_SRC_DIR}"
+ "${HDF5_BINARY_DIR}"
+ "${HDF5_F90_BINARY_DIR}"
+ "${HDF5_F90_BINARY_DIR}/static"
)
+ target_link_libraries (f03_ex_${example} PRIVATE ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET})
set_target_properties (f03_ex_${example} PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER examples/fortran03
@@ -111,12 +100,13 @@ foreach (example ${F2003_examples})
else ()
target_include_directories (f03_ex_${example}
PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared"
- )
- target_link_libraries (f03_ex_${example}
- PRIVATE
- ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/shared"
+ "${HDF5_SRC_DIR}"
+ "${HDF5_BINARY_DIR}"
+ "${HDF5_F90_BINARY_DIR}"
+ "${HDF5_F90_BINARY_DIR}/shared"
)
+ target_link_libraries (f03_ex_${example} PRIVATE ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
set_target_properties (f03_ex_${example} PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER examples/fortran03
@@ -127,27 +117,26 @@ endforeach ()
if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
add_executable (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90)
- target_compile_options(f90_ex_ph5example
- PRIVATE
- $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
- )
-# set_property(TARGET f90_ex_ph5example APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-# )
-# set_property(TARGET f90_ex_ph5example APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-# )
+ target_compile_options(f90_ex_ph5example PRIVATE $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>)
+# set_property(TARGET f90_ex_ph5example APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">)
+# set_property(TARGET f90_ex_ph5example APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>)
if(MSVC)
set_property(TARGET f90_ex_ph5example PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
if (NOT ONLY_SHARED_LIBS)
target_include_directories (f90_ex_ph5example
PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/static"
+ "${HDF5_SRC_DIR}"
+ "${HDF5_BINARY_DIR}"
+ "${HDF5_F90_BINARY_DIR}"
+ "${HDF5_F90_BINARY_DIR}/static"
+ "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
)
target_link_libraries (f90_ex_ph5example
PRIVATE
- ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}
+ ${HDF5_F90_LIB_TARGET}
+ ${HDF5_LIB_TARGET}
$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_LIBRARIES}>
)
set_target_properties (f90_ex_ph5example PROPERTIES
@@ -158,11 +147,17 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
else ()
target_include_directories (f90_ex_ph5example
PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
+ "${CMAKE_Fortran_MODULE_DIRECTORY}/shared"
+ "${HDF5_SRC_DIR}"
+ "${HDF5_BINARY_DIR}"
+ "${HDF5_F90_BINARY_DIR}"
+ "${HDF5_F90_BINARY_DIR}/shared"
+ "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
)
target_link_libraries (f90_ex_ph5example
PRIVATE
- ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}
+ ${HDF5_F90_LIBSH_TARGET}
+ ${HDF5_LIBSH_TARGET}
$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_LIBRARIES}>
)
set_target_properties (f90_ex_ph5example PROPERTIES
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt
index b5d1a60..bf2fd84 100644
--- a/fortran/src/CMakeLists.txt
+++ b/fortran/src/CMakeLists.txt
@@ -40,22 +40,14 @@ set (Fortran_COMPILER_ID CMAKE_Fortran_COMPILER_ID)
#-----------------------------------------------------------------------------
add_executable (H5_buildiface ${HDF5_F90_SRC_SOURCE_DIR}/H5_buildiface.F90)
-target_include_directories (H5_buildiface
- PRIVATE
- "${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}"
-)
+target_include_directories (H5_buildiface PRIVATE "${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}")
#if (BUILD_SHARED_LIBS)
-# target_compile_definitions(H5_buildiface
-# PRIVATE
-# $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:/MT>
-# )
+# target_compile_definitions(H5_buildiface PRIVATE $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:/MT>)
#endif ()
if(MSVC)
set_property(TARGET H5_buildiface PROPERTY COMPILE_FLAGS "/MT")
endif()
-#set_property(TARGET H5_buildiface APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-#)
+#set_property(TARGET H5_buildiface APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">)
if(MSVC)
set_property(TARGET H5_buildiface PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE")
endif()
@@ -156,6 +148,7 @@ if (NOT ONLY_SHARED_LIBS)
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_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_F90_C_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
TARGET_C_PROPERTIES (${HDF5_F90_C_LIB_TARGET} STATIC)
target_link_libraries (${HDF5_F90_C_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET})
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}")
@@ -173,9 +166,8 @@ if (BUILD_SHARED_LIBS)
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_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_F90_C_LIBSH_TARGET}
- PUBLIC "H5_BUILT_AS_DYNAMIC_LIB"
- )
+ target_compile_options(${HDF5_F90_C_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
+ target_compile_definitions(${HDF5_F90_C_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB")
TARGET_C_PROPERTIES (${HDF5_F90_C_LIBSH_TARGET} SHARED)
target_link_libraries (${HDF5_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET})
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIBSH_TARGET}")
@@ -288,29 +280,23 @@ endif ()
if (NOT ONLY_SHARED_LIBS)
add_library (${HDF5_F90_LIB_TARGET} STATIC ${f90_F_SOURCES})
target_include_directories (${HDF5_F90_LIB_TARGET}
- PRIVATE
- "${HDF5_F90_SRC_SOURCE_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
- INTERFACE
- "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/static>"
+ PRIVATE "${HDF5_F90_SRC_SOURCE_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
+ INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/static>"
)
+ target_compile_options(${HDF5_F90_LIB_TARGET} PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}")
target_compile_definitions(${HDF5_F90_LIB_TARGET}
PRIVATE
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:HDF5F90_WINDOWS>
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
target_link_libraries (${HDF5_F90_LIB_TARGET}
- PUBLIC
- ${HDF5_F90_C_LIB_TARGET}
+ PUBLIC ${HDF5_F90_C_LIB_TARGET}
PRIVATE
${LINK_Fortran_LIBS}
$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_LIBRARIES}>
)
-# set_property(TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-# )
-# set_property(TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-# )
+# set_property(TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">)
+# set_property(TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>)
if(MSVC)
set_property(TARGET ${HDF5_F90_LIB_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
@@ -328,36 +314,24 @@ endif ()
if (BUILD_SHARED_LIBS)
add_library (${HDF5_F90_LIBSH_TARGET} SHARED ${f90_F_SOURCES_SHARED})
target_include_directories (${HDF5_F90_LIBSH_TARGET}
- PRIVATE
- "${HDF5_F90_SRC_SOURCE_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
- INTERFACE
- "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/shared>"
+ PRIVATE "${HDF5_F90_SRC_SOURCE_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
+ INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/shared>"
)
+ target_compile_options(${HDF5_F90_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}")
target_compile_definitions(${HDF5_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_DLL;HDF5F90_WINDOWS>
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
target_link_libraries (${HDF5_F90_LIBSH_TARGET}
- PUBLIC
- ${HDF5_F90_C_LIBSH_TARGET}
- PRIVATE
- ${LINK_Fortran_LIBS} $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_LIBRARIES}>
+ PUBLIC ${HDF5_F90_C_LIBSH_TARGET}
+ PRIVATE ${LINK_Fortran_LIBS} $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_LIBRARIES}>
)
-# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-# )
-# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-# )
-# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-DLL">
-# )
-# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def">
-# )
+# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">)
+# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>)
+# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-DLL">)
+# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def">)
if(MSVC)
set_property(TARGET ${HDF5_F90_LIBSH_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS} /DLL /DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def")
endif()
diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt
index 5657323..ff7001b 100644
--- a/fortran/test/CMakeLists.txt
+++ b/fortran/test/CMakeLists.txt
@@ -13,8 +13,7 @@ target_include_directories (H5_test_buildiface
)
#if (BUILD_SHARED_LIBS)
# target_compile_definitions(H5_test_buildiface
-# PRIVATE
-# $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:/MT>
+# PRIVATE $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:/MT>
# )
#endif ()
if(MSVC)
@@ -49,6 +48,7 @@ if (NOT BUILD_SHARED_LIBS)
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_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_F90_C_TEST_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} STATIC)
target_link_libraries (${HDF5_F90_C_TEST_LIB_TARGET}
PRIVATE ${HDF5_F90_C_LIB_TARGET}
@@ -65,9 +65,8 @@ else ()
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_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_F90_C_TEST_LIBSH_TARGET}
- PUBLIC "H5_BUILT_AS_DYNAMIC_LIB"
- )
+ target_compile_options(${HDF5_F90_C_TEST_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
+ target_compile_definitions(${HDF5_F90_C_TEST_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB")
TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED)
target_link_libraries (${HDF5_F90_C_TEST_LIBSH_TARGET}
PRIVATE ${HDF5_F90_C_LIBSH_TARGET}
@@ -129,26 +128,18 @@ endif ()
if (NOT BUILD_SHARED_LIBS)
add_library (${HDF5_F90_TEST_LIB_TARGET} STATIC ${HDF5_F90_TF_SOURCES})
target_include_directories (${HDF5_F90_TEST_LIB_TARGET}
- PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static"
- INTERFACE
- "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/static>"
+ PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static"
+ INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/static>"
)
+ target_compile_options(${HDF5_F90_TEST_LIB_TARGET} PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}")
target_compile_definitions(${HDF5_F90_TEST_LIB_TARGET}
PRIVATE
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:HDF5F90_WINDOWS>
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
- target_link_libraries (${HDF5_F90_TEST_LIB_TARGET}
- PUBLIC
- ${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}
- )
-# set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-# )
-# set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-# )
+ target_link_libraries (${HDF5_F90_TEST_LIB_TARGET} PUBLIC ${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET})
+# set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">)
+# set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>)
if(MSVC)
set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
@@ -162,31 +153,20 @@ if (NOT BUILD_SHARED_LIBS)
else ()
add_library (${HDF5_F90_TEST_LIBSH_TARGET} SHARED ${HDF5_F90_TF_SOURCES_SHARED})
target_include_directories (${HDF5_F90_TEST_LIBSH_TARGET}
- PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared"
- INTERFACE
- "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/shared>"
+ PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared"
+ INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/shared>"
)
+ target_compile_options(${HDF5_F90_TEST_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}")
target_compile_definitions(${HDF5_F90_TEST_LIBSH_TARGET}
- PUBLIC
- "H5_BUILT_AS_DYNAMIC_LIB"
+ PUBLIC "H5_BUILT_AS_DYNAMIC_LIB"
PRIVATE
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:BUILD_HDF5_TEST_DLL;HDF5F90_WINDOWS>
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
- target_link_libraries (${HDF5_F90_TEST_LIBSH_TARGET}
- PUBLIC
- ${HDF5_F90_C_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}
- )
-# set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-# )
-# set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-# )
-# set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-DLL">
-# )
+ target_link_libraries (${HDF5_F90_TEST_LIBSH_TARGET} PUBLIC ${HDF5_F90_C_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+# set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">)
+# set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>)
+# set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-DLL">)
if(MSVC)
set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS} -DLL")
endif()
@@ -223,26 +203,17 @@ add_executable (testhdf5_fortran
)
target_compile_options(testhdf5_fortran
PRIVATE
+ "${HDF5_CMAKE_Fortran_FLAGS}"
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
-#set_property(TARGET testhdf5_fortran APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-#)
-#set_property(TARGET testhdf5_fortran APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-#)
+#set_property(TARGET testhdf5_fortran APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">)
+#set_property(TARGET testhdf5_fortran APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>)
if(MSVC)
set_property(TARGET testhdf5_fortran PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
if (NOT BUILD_SHARED_LIBS)
- target_include_directories (testhdf5_fortran
- PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static"
- )
- target_link_libraries (testhdf5_fortran
- PRIVATE
- ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
- )
+ target_include_directories (testhdf5_fortran PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static")
+ target_link_libraries (testhdf5_fortran PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>)
set_target_properties (testhdf5_fortran PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
@@ -250,14 +221,8 @@ if (NOT BUILD_SHARED_LIBS)
)
add_dependencies (testhdf5_fortran ${HDF5_F90_TEST_LIB_TARGET})
else ()
- target_include_directories (testhdf5_fortran
- PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared"
- )
- target_link_libraries (testhdf5_fortran
- PRIVATE
- ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
- )
+ target_include_directories (testhdf5_fortran PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared")
+ target_link_libraries (testhdf5_fortran PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>)
set_target_properties (testhdf5_fortran PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
@@ -277,26 +242,17 @@ add_executable (testhdf5_fortran_1_8
)
target_compile_options(testhdf5_fortran_1_8
PRIVATE
+ "${HDF5_CMAKE_Fortran_FLAGS}"
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
-#set_property(TARGET testhdf5_fortran_1_8 APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-#)
-#set_property(TARGET testhdf5_fortran_1_8 APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-#)
+#set_property(TARGET testhdf5_fortran_1_8 APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">)
+#set_property(TARGET testhdf5_fortran_1_8 APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>)
if(MSVC)
set_property(TARGET testhdf5_fortran_1_8 PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
if (NOT BUILD_SHARED_LIBS)
- target_include_directories (testhdf5_fortran_1_8
- PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static"
- )
- target_link_libraries (testhdf5_fortran_1_8
- PRIVATE
- ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
- )
+ target_include_directories (testhdf5_fortran_1_8 PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static")
+ target_link_libraries (testhdf5_fortran_1_8 PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>)
set_target_properties (testhdf5_fortran_1_8 PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
@@ -304,14 +260,8 @@ if (NOT BUILD_SHARED_LIBS)
)
add_dependencies (testhdf5_fortran_1_8 ${HDF5_F90_TEST_LIB_TARGET})
else ()
- target_include_directories (testhdf5_fortran_1_8
- PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared"
- )
- target_link_libraries (testhdf5_fortran_1_8
- PRIVATE
- ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
- )
+ target_include_directories (testhdf5_fortran_1_8 PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared")
+ target_link_libraries (testhdf5_fortran_1_8 PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>)
set_target_properties (testhdf5_fortran_1_8 PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
@@ -333,26 +283,17 @@ add_executable (fortranlib_test_F03
)
target_compile_options(fortranlib_test_F03
PRIVATE
+ "${HDF5_CMAKE_Fortran_FLAGS}"
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
-#set_property(TARGET fortranlib_test_F03 APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-#)
-#set_property(TARGET fortranlib_test_F03 APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-#)
+#set_property(TARGET fortranlib_test_F03 APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">)
+#set_property(TARGET fortranlib_test_F03 APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>)
if(MSVC)
set_property(TARGET fortranlib_test_F03 PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
if (NOT BUILD_SHARED_LIBS)
- target_include_directories (fortranlib_test_F03
- PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static"
- )
- target_link_libraries (fortranlib_test_F03
- PRIVATE
- ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
- )
+ target_include_directories (fortranlib_test_F03 PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static")
+ target_link_libraries (fortranlib_test_F03 PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>)
set_target_properties (fortranlib_test_F03 PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
@@ -360,14 +301,8 @@ if (NOT BUILD_SHARED_LIBS)
)
add_dependencies (fortranlib_test_F03 ${HDF5_F90_TEST_LIB_TARGET})
else ()
- target_include_directories (fortranlib_test_F03
- PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared"
- )
- target_link_libraries (fortranlib_test_F03
- PRIVATE
- ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
- )
+ target_include_directories (fortranlib_test_F03 PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared")
+ target_link_libraries (fortranlib_test_F03 PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>)
set_target_properties (fortranlib_test_F03 PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
@@ -380,26 +315,17 @@ endif ()
add_executable (fflush1 fflush1.F90)
target_compile_options(fflush1
PRIVATE
+ "${HDF5_CMAKE_Fortran_FLAGS}"
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
-#set_property(TARGET fflush1 APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-#)
-#set_property(TARGET fflush1 APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-#)
+#set_property(TARGET fflush1 APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">)
+#set_property(TARGET fflush1 APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>)
if(MSVC)
set_property(TARGET fflush1 PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
if (NOT BUILD_SHARED_LIBS)
- target_include_directories (fflush1
- PRIVATE
- ${CMAKE_Fortran_MODULE_DIRECTORY}/static
- )
- target_link_libraries (fflush1
- PRIVATE
- ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
- )
+ target_include_directories (fflush1 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static)
+ target_link_libraries (fflush1 PRIVATE ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>)
set_target_properties (fflush1 PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
@@ -407,14 +333,8 @@ if (NOT BUILD_SHARED_LIBS)
)
add_dependencies (fflush1 ${HDF5_F90_TEST_LIB_TARGET})
else ()
- target_include_directories (fflush1
- PRIVATE
- ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
- )
- target_link_libraries (fflush1
- PRIVATE
- ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
- )
+ target_include_directories (fflush1 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared)
+ target_link_libraries (fflush1 PRIVATE ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>)
set_target_properties (fflush1 PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
@@ -427,26 +347,17 @@ endif ()
add_executable (fflush2 fflush2.F90)
target_compile_options (fflush2
PRIVATE
+ "${HDF5_CMAKE_Fortran_FLAGS}"
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
-#set_property(TARGET fflush2 APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-#)
-#set_property(TARGET fflush2 APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-#)
+#set_property(TARGET fflush2 APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">)
+#set_property(TARGET fflush2 APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>)
if(MSVC)
set_property(TARGET fflush2 PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
if (NOT BUILD_SHARED_LIBS)
- target_include_directories (fflush2
- PRIVATE
- ${CMAKE_Fortran_MODULE_DIRECTORY}/static
- )
- target_link_libraries (fflush2
- PRIVATE
- ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
- )
+ target_include_directories (fflush2 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static)
+ target_link_libraries (fflush2 PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>)
set_target_properties (fflush2 PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
@@ -454,14 +365,8 @@ if (NOT BUILD_SHARED_LIBS)
)
add_dependencies (fflush2 ${HDF5_F90_TEST_LIB_TARGET})
else ()
- target_include_directories (fflush2
- PRIVATE
- ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
- )
- target_link_libraries (fflush2
- PRIVATE
- ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
- )
+ target_include_directories (fflush2 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared)
+ target_link_libraries (fflush2 PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>)
set_target_properties (fflush2 PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
@@ -474,26 +379,17 @@ endif ()
add_executable (vol_connector vol_connector.F90)
target_compile_options(vol_connector
PRIVATE
+ "${HDF5_CMAKE_Fortran_FLAGS}"
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
-#set_property(TARGET vol_connector APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-#)
-#set_property(TARGET vol_connector APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-#)
+#set_property(TARGET vol_connector APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">)
+#set_property(TARGET vol_connector APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>)
if(MSVC)
set_property(TARGET vol_connector PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
if (NOT BUILD_SHARED_LIBS)
- target_include_directories (vol_connector
- PRIVATE
- ${CMAKE_Fortran_MODULE_DIRECTORY}/static
- )
- target_link_libraries (vol_connector
- PRIVATE
- ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
- )
+ target_include_directories (vol_connector PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static)
+ target_link_libraries (vol_connector PRIVATE ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>)
set_target_properties (vol_connector PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
@@ -501,14 +397,8 @@ if (NOT BUILD_SHARED_LIBS)
)
add_dependencies (vol_connector ${HDF5_F90_TEST_LIB_TARGET})
else ()
- target_include_directories (vol_connector
- PRIVATE
- ${CMAKE_Fortran_MODULE_DIRECTORY}/shared
- )
- target_link_libraries (vol_connector
- PRIVATE
- ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>
- )
+ target_include_directories (vol_connector PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared)
+ target_link_libraries (vol_connector PRIVATE ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>)
set_target_properties (vol_connector PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt
index 5c80fd6..12489528 100644
--- a/fortran/testpar/CMakeLists.txt
+++ b/fortran/testpar/CMakeLists.txt
@@ -22,11 +22,11 @@ add_executable (parallel_test
mdset.f90
)
target_include_directories (parallel_test
- PRIVATE
- ${TESTPAR_INCLUDES}
+ PRIVATE ${TESTPAR_INCLUDES}
)
target_compile_options(parallel_test
PRIVATE
+ "${HDF5_CMAKE_Fortran_FLAGS}"
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
if (NOT BUILD_SHARED_LIBS)
@@ -53,12 +53,8 @@ else ()
)
endif ()
-#set_property(TARGET parallel_test APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
-#)
-#set_property(TARGET parallel_test APPEND PROPERTY
-# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
-#)
+#set_property(TARGET parallel_test APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">)
+#set_property(TARGET parallel_test APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>)
if(MSVC)
set_property(TARGET parallel_test PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt
index 01c8126..fbabc86 100644
--- a/hl/c++/src/CMakeLists.txt
+++ b/hl/c++/src/CMakeLists.txt
@@ -14,9 +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_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}")
@@ -31,12 +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_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_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++/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/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt
index 265d8db..e6411c1 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 (NOT BUILD_SHARED_LIBS)
- 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
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
)
else ()
- 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
diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt
index d4979ba..71b9380 100644
--- a/hl/fortran/src/CMakeLists.txt
+++ b/hl/fortran/src/CMakeLists.txt
@@ -62,6 +62,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}")
@@ -78,9 +79,8 @@ if (BUILD_SHARED_LIBS)
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}")
@@ -161,27 +161,17 @@ endif ()
if (NOT ONLY_SHARED_LIBS)
add_library (${HDF5_HL_F90_LIB_TARGET} STATIC ${HDF5_HL_F90_F_SOURCES})
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()
@@ -198,36 +188,24 @@ endif ()
if (BUILD_SHARED_LIBS)
add_library (${HDF5_HL_F90_LIBSH_TARGET} SHARED ${HDF5_HL_F90_F_SOURCES_SHARED})
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}
+ 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">
-# )
+# 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 -DEF:${HDF5_HL_F90_SRC_BINARY_DIR}/hdf5_hl_fortrandll.def")
endif()
diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt
index 269cefb..e2872ac 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 (NOT BUILD_SHARED_LIBS)
- 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
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
)
else ()
- 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
diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt
index 7975a1a..c4ddf19 100644
--- a/hl/src/CMakeLists.txt
+++ b/hl/src/CMakeLists.txt
@@ -38,9 +38,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_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)
@@ -55,12 +53,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_options(${HDF5_HL_LIBSH_TARGET}
- PRIVATE "${HDF5_CMAKE_C_FLAGS}"
- )
- 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/test/CMakeLists.txt b/hl/test/CMakeLists.txt
index 43fc312..6349bb3 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)
@@ -49,6 +50,7 @@ HL_ADD_EXE (test_h5do_compat)
# 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)
@@ -73,6 +75,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
@@ -83,6 +86,7 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
set_target_properties (hl_gen_test_ds PROPERTIES FOLDER test/hl/gen)
add_executable (hl_gen_test_ld gen_test_ld.c)
+ target_compile_options(hl_gen_test_ld PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (hl_gen_test_ld PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (hl_gen_test_ld STATIC)
target_link_libraries (hl_gen_test_ld PRIVATE
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/h5watch/CMakeLists.txt b/hl/tools/h5watch/CMakeLists.txt
index 9329c97..c5ad976 100644
--- a/hl/tools/h5watch/CMakeLists.txt
+++ b/hl/tools/h5watch/CMakeLists.txt
@@ -11,6 +11,7 @@ set (H5WATCH_SOURCES
#-- Add h5watch program
if (NOT ONLY_SHARED_LIBS)
add_executable (h5watch ${H5WATCH_SOURCES})
+ target_compile_options(h5watch PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (h5watch PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5watch STATIC)
target_link_libraries (h5watch PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
@@ -19,6 +20,7 @@ if (NOT ONLY_SHARED_LIBS)
endif ()
if (BUILD_SHARED_LIBS)
add_executable (h5watch-shared ${H5WATCH_SOURCES})
+ target_compile_options(h5watch-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (h5watch-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5watch-shared SHARED)
target_link_libraries (h5watch-shared PRIVATE ${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${HDF5_TOOLS_LIBSH_TARGET})
@@ -32,6 +34,7 @@ if (BUILD_TESTING AND HDF5_TEST_SWMR AND HDF5_TEST_SERIAL)
${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_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT ONLY_SHARED_LIBS)
TARGET_C_PROPERTIES (hl_swmr_check_compat_vfd STATIC)
@@ -47,6 +50,7 @@ if (BUILD_TESTING AND HDF5_TEST_SWMR AND HDF5_TEST_SERIAL)
${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/extend_dset.c
)
add_executable (extend_dset ${extend_dset_SOURCES})
+ target_compile_options(extend_dset PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (extend_dset PRIVATE "${HDF5_HL_SRC_DIR}/test;${HDF5_HL_SRC_DIR}/src;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT ONLY_SHARED_LIBS)
TARGET_C_PROPERTIES (extend_dset STATIC)
@@ -58,6 +62,7 @@ if (BUILD_TESTING AND HDF5_TEST_SWMR AND HDF5_TEST_SERIAL)
set_target_properties (extend_dset PROPERTIES FOLDER tools/hl)
add_executable (h5watchgentest ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/h5watchgentest.c)
+ target_compile_options(h5watchgentest PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (h5watchgentest PRIVATE "${HDF5_HL_SRC_DIR}/src;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT ONLY_SHARED_LIBS)
TARGET_C_PROPERTIES (h5watchgentest STATIC)
diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt
index dc9b223..3f71122 100644
--- a/java/src/jni/CMakeLists.txt
+++ b/java/src/jni/CMakeLists.txt
@@ -79,9 +79,7 @@ add_library (${HDF5_JAVA_JNI_LIB_TARGET} SHARED ${HDF5_JAVA_JNI_CSRCS} ${HDF5_JA
target_include_directories (${HDF5_JAVA_JNI_LIB_TARGET}
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_JAVA_JNI_SOURCE_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
)
-target_compile_options(${HDF5_JAVA_JNI_LIB_TARGET}
- PRIVATE "${HDF5_CMAKE_C_FLAGS}"
-)
+target_compile_options(${HDF5_JAVA_JNI_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
TARGET_C_PROPERTIES (${HDF5_JAVA_JNI_LIB_TARGET} SHARED)
target_link_libraries (${HDF5_JAVA_JNI_LIB_TARGET} PUBLIC ${HDF5_LIBSH_TARGET})
set_target_properties (${HDF5_JAVA_JNI_LIB_TARGET} PROPERTIES FOLDER libraries/jni)
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index ff1d99b..1f1ad60 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -57,11 +57,13 @@ New Features
- Both build systems use same set of warnings flags
- GNU C warnings flags were moved to files in a config sub-folder
- named gnu-warnings. Flags that only are available for a specific
+ GNU C, C++ and gfortran warnings flags were moved to files in a config
+ sub-folder named gnu-warnings. Flags that only are available for a specific
version of the compiler are in files named with that version.
Clang C warnings flags were moved to files in a config sub-folder
named clang-warnings.
+ Intel C, Fortran warnings flags were moved to files in a config sub-folder
+ named intel-warnings.
There are flags in named "error-xxx" files with warnings that may
be promoted to errors. Some source files may still need fixes.
@@ -70,6 +72,8 @@ New Features
that are chosen by the CMake option:HDF5_ENABLE_DEV_WARNINGS or the
configure option:--enable-developer-warnings.
+ In addition, CMake no longer applies these warnings for examples.
+
(ADB - 2020/03/24, TRILAB-192)
- Added test script for file size compare
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3f7d73a..3682caa 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1137,9 +1137,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_LIB_TARGET}
- PRIVATE "${HDF5_CMAKE_C_FLAGS}"
- )
+ target_compile_options(${HDF5_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_compile_definitions(${HDF5_LIB_TARGET}
PUBLIC
${HDF_EXTRA_C_FLAGS}
@@ -1176,9 +1174,7 @@ if (BUILD_SHARED_LIBS)
PUBLIC "$<$<BOOL:${HDF5_ENABLE_HDFS}>:${HDFS_INCLUDE_DIR}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
- target_compile_options(${HDF5_LIBSH_TARGET}
- PRIVATE "${HDF5_CMAKE_C_FLAGS}"
- )
+ target_compile_options(${HDF5_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_compile_definitions(${HDF5_LIBSH_TARGET}
PUBLIC
"H5_BUILT_AS_DYNAMIC_LIB"
diff --git a/src/H5trace.c b/src/H5trace.c
index 03d9e7c..f9f96e2 100644
--- a/src/H5trace.c
+++ b/src/H5trace.c
@@ -249,7 +249,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'a':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -263,7 +263,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'b':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -282,7 +282,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'd':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -298,7 +298,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'a':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -336,7 +336,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'c':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -362,7 +362,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'f':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -396,7 +396,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'F':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -430,7 +430,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'h':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -460,7 +460,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'i':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -498,7 +498,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'k':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -544,7 +544,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'l':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -586,7 +586,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'n':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -633,7 +633,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'o':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -663,7 +663,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -697,7 +697,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -723,7 +723,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'v':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -759,7 +759,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'e':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -778,7 +778,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'd':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -804,21 +804,21 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'e':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
H5E_error2_t *error = HDva_arg(ap, H5E_error2_t *);
- HDfprintf(out, "0x%lx", (unsigned long)error);
+ HDfprintf(out, "0x%p", error);
} /* end else */
break;
case 's':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -849,7 +849,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -883,7 +883,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'd':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -917,7 +917,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'f':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -952,7 +952,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'm':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -1003,7 +1003,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -1029,7 +1029,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -1038,7 +1038,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'v':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -1088,7 +1088,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'o':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -1136,14 +1136,14 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
H5G_stat_t *statbuf = HDva_arg(ap, H5G_stat_t*);
- HDfprintf(out, "0x%lx", (unsigned long)statbuf);
+ HDfprintf(out, "0x%p", statbuf);
}
break;
#endif /* H5_NO_DEPRECATED_SYMBOLS */
@@ -1157,7 +1157,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'h':
if(ptr) {
if(vp) {
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
if(asize_idx >= 0 && asize[asize_idx] >= 0) {
hsize_t *p = (hsize_t *)vp;
@@ -1191,7 +1191,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if(ptr) {
if(vp) {
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
if(asize_idx >= 0 && asize[asize_idx] >= 0) {
hssize_t *p = (hssize_t *)vp;
@@ -1221,7 +1221,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'i':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -1417,7 +1417,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'i':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -1451,7 +1451,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'o':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -1489,7 +1489,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if(ptr) {
if(vp) {
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
if(asize_idx >= 0 && asize[asize_idx] >= 0) {
int *p = (int*)vp;
@@ -1513,7 +1513,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -1603,7 +1603,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'u':
if(ptr) {
if(vp) {
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
if(asize_idx >= 0 && asize[asize_idx] >= 0) {
unsigned *p = (unsigned*)vp;
@@ -1633,7 +1633,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'k':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -1651,7 +1651,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'l':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -1697,7 +1697,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'c':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -1713,7 +1713,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'i':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -1729,7 +1729,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -1788,7 +1788,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'o':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -1804,7 +1804,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -1852,7 +1852,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'p':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -1879,7 +1879,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'o':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -1893,7 +1893,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'd':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -1907,7 +1907,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'r':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -1921,7 +1921,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -1975,7 +1975,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'c':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2009,7 +2009,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2067,7 +2067,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2115,7 +2115,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2131,7 +2131,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'c':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2178,7 +2178,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'd':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2208,7 +2208,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'e':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2238,7 +2238,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'n':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2272,7 +2272,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'o':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2314,7 +2314,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'p':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2352,7 +2352,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2386,7 +2386,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2456,7 +2456,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'z':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2512,7 +2512,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2533,7 +2533,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'l':
if(ptr) {
if(vp) {
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
if(asize_idx >= 0 && asize[asize_idx] >= 0) {
unsigned long *p = (unsigned long *)vp;
@@ -2557,7 +2557,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'L':
if(ptr) {
if(vp) {
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
if(asize_idx >= 0 && asize[asize_idx] >= 0) {
unsigned long long *p = (unsigned long long *)vp;
@@ -2589,7 +2589,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'a':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2625,7 +2625,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'A':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2643,7 +2643,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'b':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2673,7 +2673,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'B':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2703,7 +2703,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'C':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2720,7 +2720,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'c':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2756,7 +2756,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'd':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2783,7 +2783,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'e':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2807,7 +2807,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'f':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2831,7 +2831,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'g':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2873,7 +2873,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'h':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2912,7 +2912,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'i':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2936,7 +2936,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'j':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2960,7 +2960,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'k':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -2987,7 +2987,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'l':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -3014,7 +3014,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'L':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -3038,7 +3038,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'm':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -3065,7 +3065,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'n':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -3095,7 +3095,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'o':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -3131,7 +3131,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'r':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -3158,7 +3158,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -3181,7 +3181,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'S':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -3238,7 +3238,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -3286,7 +3286,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'u':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -3304,7 +3304,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'v':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -3409,7 +3409,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'w':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -3435,7 +3435,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'x':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -3453,7 +3453,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'y':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -3489,7 +3489,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'z':
if(ptr) {
if(vp)
- HDfprintf (out, "0x%lx", (unsigned long)vp);
+ HDfprintf (out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -3513,14 +3513,14 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'x':
if(ptr) {
if(vp) {
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
if(asize_idx >= 0 && asize[asize_idx] >= 0) {
void **p = (void**)vp;
HDfprintf(out, " {");
for(i = 0; i < asize[asize_idx]; i++) {
if(p[i])
- HDfprintf(out, "%s0x%lx", (i ? ", " : ""), (unsigned long)(p[i]));
+ HDfprintf(out, "%s0x%p", (i ? ", " : ""), p[i]);
else
HDfprintf(out, "%sNULL", (i ? ", " : ""));
} /* end for */
@@ -3534,7 +3534,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
vp = HDva_arg (ap, void *);
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end else */
@@ -3543,7 +3543,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'z':
if(ptr) {
if(vp) {
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
if(asize_idx >= 0 && asize[asize_idx] >= 0) {
size_t *p = (size_t *)vp;
@@ -3569,7 +3569,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'a':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -3599,21 +3599,21 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'c':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
H5Z_class2_t *filter = HDva_arg(ap, H5Z_class2_t*);
- HDfprintf(out, "0x%lx", (unsigned long)filter);
+ HDfprintf(out, "0x%p", filter);
} /* end else */
break;
case 'e':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -3632,7 +3632,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'f':
if(ptr) {
if(vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
@@ -3649,7 +3649,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if(ptr) {
if(vp) {
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
if(asize_idx >= 0 && asize[asize_idx] >= 0) {
ssize_t *p = (ssize_t *)vp;
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 7929e2c..7a0b2dd 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -32,6 +32,7 @@ if (NOT ONLY_SHARED_LIBS)
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
+ target_compile_options(${HDF5_TEST_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} STATIC)
target_link_libraries (${HDF5_TEST_LIB_TARGET}
PUBLIC ${LINK_LIBS} ${HDF5_LIB_TARGET}
@@ -50,9 +51,8 @@ if (BUILD_SHARED_LIBS)
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
- target_compile_definitions(${HDF5_TEST_LIBSH_TARGET}
- PUBLIC "H5_BUILT_AS_DYNAMIC_LIB"
- )
+ target_compile_options(${HDF5_TEST_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
+ target_compile_definitions(${HDF5_TEST_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB")
TARGET_C_PROPERTIES (${HDF5_TEST_LIBSH_TARGET} SHARED)
target_link_libraries (${HDF5_TEST_LIBSH_TARGET}
PUBLIC ${LINK_LIBS} ${HDF5_LIBSH_TARGET}
@@ -294,6 +294,7 @@ set (H5_TESTS
macro (ADD_H5_EXE file)
add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c)
target_include_directories (${file} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_compile_options(${file} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (${file} STATIC)
target_link_libraries (${file} PRIVATE ${HDF5_TEST_LIB_TARGET})
@@ -325,6 +326,7 @@ endforeach ()
######### Also special handling of link libs #############
#-- Adding test for chunk_info
add_executable (chunk_info ${HDF5_TEST_SOURCE_DIR}/chunk_info.c)
+target_compile_options(chunk_info PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (chunk_info PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (chunk_info STATIC)
@@ -337,6 +339,7 @@ set_target_properties (chunk_info PROPERTIES FOLDER test)
#-- Adding test for direct_chunk
add_executable (direct_chunk ${HDF5_TEST_SOURCE_DIR}/direct_chunk.c)
+target_compile_options(direct_chunk PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (direct_chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (direct_chunk STATIC)
@@ -351,6 +354,7 @@ set_target_properties (direct_chunk PROPERTIES FOLDER test)
######### Special handling for multiple sources #############
#-- Adding test for testhdf5
add_executable (testhdf5 ${testhdf5_SOURCES})
+target_compile_options(testhdf5 PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (testhdf5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (testhdf5 STATIC)
@@ -363,6 +367,7 @@ set_target_properties (testhdf5 PROPERTIES FOLDER test)
#-- Adding test for cache_image
add_executable (cache_image ${cache_image_SOURCES})
+target_compile_options(cache_image PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (cache_image PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (cache_image STATIC)
@@ -375,6 +380,7 @@ set_target_properties (cache_image PROPERTIES FOLDER test)
#-- Adding test for ttsafe
add_executable (ttsafe ${ttsafe_SOURCES})
+target_compile_options(ttsafe PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (ttsafe PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (ttsafe STATIC)
@@ -393,6 +399,7 @@ set_target_properties (ttsafe PROPERTIES FOLDER test)
######### Special handling for extra link lib of threads #############
#-- Adding test for thread_id
add_executable (thread_id ${HDF5_TEST_SOURCE_DIR}/thread_id.c)
+target_compile_options(thread_id PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (thread_id PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (thread_id STATIC)
@@ -476,6 +483,7 @@ endforeach ()
# This has to be copied to the test directory for execve() to find it
# and it can't be renamed (i.e., no <foo>-shared).
add_executable (accum_swmr_reader ${HDF5_TEST_SOURCE_DIR}/accum_swmr_reader.c)
+target_compile_options(accum_swmr_reader PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (accum_swmr_reader PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (accum_swmr_reader STATIC)
@@ -511,6 +519,7 @@ endif ()
##############################################################################
set (use_append_chunk_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_chunk.c ${HDF5_TEST_SOURCE_DIR}/use_common.c)
add_executable (use_append_chunk ${use_append_chunk_SOURCES})
+target_compile_options(use_append_chunk PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (use_append_chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (use_append_chunk STATIC)
@@ -523,6 +532,7 @@ set_target_properties (use_append_chunk PROPERTIES FOLDER test)
set (use_append_mchunks_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_mchunks.c ${HDF5_TEST_SOURCE_DIR}/use_common.c)
add_executable (use_append_mchunks ${use_append_mchunks_SOURCES})
+target_compile_options(use_append_mchunks PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (use_append_mchunks PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (use_append_mchunks STATIC)
@@ -535,6 +545,7 @@ set_target_properties (use_append_mchunks PROPERTIES FOLDER test)
set (use_disable_mdc_flushes_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_disable_mdc_flushes.c)
add_executable (use_disable_mdc_flushes ${use_disable_mdc_flushes_SOURCES})
+target_compile_options(use_disable_mdc_flushes PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (use_disable_mdc_flushes PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (use_disable_mdc_flushes STATIC)
diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt
index d88e27f..a9f45d5 100644
--- a/testpar/CMakeLists.txt
+++ b/testpar/CMakeLists.txt
@@ -22,6 +22,7 @@ set (testphdf5_SOURCES
#-- Adding test for testhdf5
add_executable (testphdf5 ${testphdf5_SOURCES})
+target_compile_options(testphdf5 PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (testphdf5
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
)
@@ -40,6 +41,7 @@ set_target_properties (testphdf5 PROPERTIES FOLDER test/par)
MACRO (ADD_H5P_EXE file)
add_executable (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c)
+ target_compile_options(${file} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (${file}
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
)
diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt
index 306c033..ff9ca43 100644
--- a/tools/lib/CMakeLists.txt
+++ b/tools/lib/CMakeLists.txt
@@ -38,9 +38,7 @@ if (NOT ONLY_SHARED_LIBS)
PRIVATE "${HDF5_TOOLS_LIB_SOURCE_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
- target_compile_options(${HDF5_TOOLS_LIB_TARGET}
- PRIVATE "${HDF5_CMAKE_C_FLAGS}"
- )
+ target_compile_options(${HDF5_TOOLS_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
#target_compile_definitions(${HDF5_TOOLS_LIB_TARGET} PRIVATE H5_TOOLS_DEBUG)
#target_compile_definitions(${HDF5_TOOLS_LIB_TARGET} PRIVATE H5DIFF_DEBUG)
TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} STATIC)
@@ -60,9 +58,7 @@ if (BUILD_SHARED_LIBS)
PRIVATE "${HDF5_TOOLS_LIB_SOURCE_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
- target_compile_options(${HDF5_TOOLS_LIBSH_TARGET}
- PRIVATE "${HDF5_CMAKE_C_FLAGS}"
- )
+ target_compile_options(${HDF5_TOOLS_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_compile_definitions(${HDF5_TOOLS_LIBSH_TARGET}
PUBLIC "H5_BUILT_AS_DYNAMIC_LIB"
#PRIVATE H5_TOOLS_DEBUG
diff --git a/tools/libtest/CMakeLists.txt b/tools/libtest/CMakeLists.txt
index 7246e66..3e0f671 100644
--- a/tools/libtest/CMakeLists.txt
+++ b/tools/libtest/CMakeLists.txt
@@ -5,6 +5,7 @@ project (HDF5_TOOLS_LIBTEST C)
# Add the h5tools_utils test executables
#-----------------------------------------------------------------------------
add_executable (h5tools_test_utils ${HDF5_TOOLS_LIBTEST_SOURCE_DIR}/h5tools_test_utils.c)
+target_compile_options(h5tools_test_utils PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories(h5tools_test_utils PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT ONLY_SHARED_LIBS)
TARGET_C_PROPERTIES (h5tools_test_utils STATIC)
diff --git a/tools/libtest/h5tools_test_utils.c b/tools/libtest/h5tools_test_utils.c
index 2f9958b..8956bb5 100644
--- a/tools/libtest/h5tools_test_utils.c
+++ b/tools/libtest/h5tools_test_utils.c
@@ -16,6 +16,7 @@
* Jacob Smith 2017-11-10
*/
+#include "h5tools.h"
#include "h5tools_utils.h"
#include "h5test.h"
diff --git a/tools/src/h5diff/CMakeLists.txt b/tools/src/h5diff/CMakeLists.txt
index eec7246..4087ab4 100644
--- a/tools/src/h5diff/CMakeLists.txt
+++ b/tools/src/h5diff/CMakeLists.txt
@@ -42,6 +42,7 @@ if (H5_HAVE_PARALLEL)
${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/ph5diff_main.c
)
target_include_directories (ph5diff PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_compile_options(ph5diff PRIVATE "${HDF5_CMAKE_C_FLAGS}")
TARGET_C_PROPERTIES (ph5diff STATIC)
target_link_libraries (ph5diff PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>")
set_target_properties (ph5diff PROPERTIES FOLDER tools)
@@ -54,6 +55,7 @@ if (H5_HAVE_PARALLEL)
${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/ph5diff_main.c
)
target_include_directories (ph5diff-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_compile_options(ph5diff-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}")
TARGET_C_PROPERTIES (ph5diff-shared SHARED)
target_link_libraries (ph5diff-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>")
set_target_properties (ph5diff-shared PROPERTIES FOLDER tools)