diff options
-rw-r--r-- | CTestCustom.cmake.in | 3 | ||||
-rw-r--r-- | Modules/FindHDF5.cmake | 70 | ||||
-rw-r--r-- | Utilities/cmlibuv/src/unix/pipe.c | 7 | ||||
-rw-r--r-- | Utilities/cmlibuv/src/unix/tty.c | 7 |
4 files changed, 68 insertions, 19 deletions
diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in index a39049b..1699492 100644 --- a/CTestCustom.cmake.in +++ b/CTestCustom.cmake.in @@ -62,6 +62,7 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION "warning.*This version of Mac OS X is unsupported" "clang.*: warning: argument unused during compilation: .-g" "note: in expansion of macro" # diagnostic context note + "note: expanded from macro" # diagnostic context note "cm(StringCommand|CTestTestHandler)\\.cxx.*warning.*rand.*may return deterministic values" "cm(StringCommand|CTestTestHandler)\\.cxx.*warning.*rand.*isn.*t random" # we do not do crypto "cm(StringCommand|CTestTestHandler)\\.cxx.*warning.*srand.*seed choices are.*poor" # we do not do crypto @@ -82,6 +83,8 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION "cm_sha2.*warning: Value stored to.*is never read" "testProcess.*warning: Dereference of null pointer .loaded from variable .invalidAddress.." "liblzma/simple/x86.c:[0-9]+:[0-9]+: warning: The result of the '<<' expression is undefined" + "libuv/src/.*:[0-9]+:[0-9]+: warning: Dereference of null pointer" + "libuv/src/.*:[0-9]+:[0-9]+: warning: The left operand of '==' is a garbage value" ) if(NOT "@CMAKE_GENERATOR@" MATCHES "Xcode") diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 5e0996c..2f4ed82 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -183,7 +183,7 @@ endmacro() # Test first if the current compilers automatically wrap HDF5 -function(_HDF5_test_regular_compiler_C success version) +function(_HDF5_test_regular_compiler_C success version is_parallel) set(scratch_directory ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/hdf5) if(NOT ${success} OR @@ -214,10 +214,21 @@ function(_HDF5_test_regular_compiler_C success version) set(${version} ${HDF5_CXX_VERSION}.${CMAKE_MATCH_3}) endif() set(${version} ${${version}} PARENT_SCOPE) + + execute_process(COMMAND ${CMAKE_C_COMPILER} -showconfig + OUTPUT_VARIABLE config_output + ERROR_VARIABLE config_error + RESULT_VARIABLE config_result + ) + if(config_output MATCHES "Parallel HDF5: yes") + set(${is_parallel} TRUE PARENT_SCOPE) + else() + set(${is_parallel} FALSE PARENT_SCOPE) + endif() endif() endfunction() -function(_HDF5_test_regular_compiler_CXX success version) +function(_HDF5_test_regular_compiler_CXX success version is_parallel) set(scratch_directory ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/hdf5) if(NOT ${success} OR NOT EXISTS ${scratch_directory}/compiler_has_h5_cxx) @@ -248,10 +259,21 @@ function(_HDF5_test_regular_compiler_CXX success version) set(${version} ${HDF5_CXX_VERSION}.${CMAKE_MATCH_3}) endif() set(${version} ${${version}} PARENT_SCOPE) + + execute_process(COMMAND ${CMAKE_CXX_COMPILER} -showconfig + OUTPUT_VARIABLE config_output + ERROR_VARIABLE config_error + RESULT_VARIABLE config_result + ) + if(config_output MATCHES "Parallel HDF5: yes") + set(${is_parallel} TRUE PARENT_SCOPE) + else() + set(${is_parallel} FALSE PARENT_SCOPE) + endif() endif() endfunction() -function(_HDF5_test_regular_compiler_Fortran success) +function(_HDF5_test_regular_compiler_Fortran success is_parallel) if(NOT ${success}) set(scratch_directory ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/hdf5) @@ -266,12 +288,24 @@ function(_HDF5_test_regular_compiler_Fortran success) " call h5close_f(error)\n" "end\n") try_compile(${success} ${scratch_directory} ${test_file}) + if(${success}) + execute_process(COMMAND ${CMAKE_Fortran_COMPILER} -showconfig + OUTPUT_VARIABLE config_output + ERROR_VARIABLE config_error + RESULT_VARIABLE config_result + ) + if(config_output MATCHES "Parallel HDF5: yes") + set(${is_parallel} TRUE PARENT_SCOPE) + else() + set(${is_parallel} FALSE PARENT_SCOPE) + endif() + endif() endif() endfunction() # Invoke the HDF5 wrapper compiler. The compiler return value is stored to the # return_value argument, the text output is stored to the output variable. -macro( _HDF5_invoke_compiler language output return_value version) +macro( _HDF5_invoke_compiler language output return_value version is_parallel) set(${version}) if(HDF5_USE_STATIC_LIBRARIES) set(lib_type_args -noshlib) @@ -309,6 +343,11 @@ macro( _HDF5_invoke_compiler language output return_value version) string(REPLACE "HDF5 Version: " "" ${version} "${version_match}") string(REPLACE "-patch" "." ${version} "${${version}}") endif() + if(config_output MATCHES "Parallel HDF5: yes") + set(${is_parallel} TRUE) + else() + set(${is_parallel} FALSE) + endif() endmacro() # Parse a compile line for definitions, includes, library paths, and libraries. @@ -386,6 +425,7 @@ endif() if(NOT HDF5_FOUND AND NOT HDF5_ROOT) find_package(HDF5 QUIET NO_MODULE) if( HDF5_FOUND) + set(HDF5_IS_PARALLEL ${HDF5_ENABLE_PARALLEL}) set(HDF5_INCLUDE_DIRS ${HDF5_INCLUDE_DIR}) set(HDF5_LIBRARIES) set(HDF5_C_TARGET hdf5) @@ -446,14 +486,17 @@ if(NOT HDF5_FOUND AND NOT HDF5_ROOT) if(__lang STREQUAL "C") _HDF5_test_regular_compiler_C( HDF5_${__lang}_COMPILER_NO_INTERROGATE - HDF5_${__lang}_VERSION) + HDF5_${__lang}_VERSION + HDF5_${__lang}_IS_PARALLEL) elseif(__lang STREQUAL "CXX") _HDF5_test_regular_compiler_CXX( HDF5_${__lang}_COMPILER_NO_INTERROGATE - HDF5_${__lang}_VERSION) + HDF5_${__lang}_VERSION + HDF5_${__lang}_IS_PARALLEL) elseif(__lang STREQUAL "Fortran") _HDF5_test_regular_compiler_Fortran( - HDF5_${__lang}_COMPILER_NO_INTERROGATE) + HDF5_${__lang}_COMPILER_NO_INTERROGATE + HDF5_${__lang}_IS_PARALLEL) else() continue() endif() @@ -490,7 +533,7 @@ if(NOT HDF5_FOUND AND NOT HDF5_ROOT) if(HDF5_${__lang}_COMPILER_EXECUTABLE) _HDF5_invoke_compiler(${__lang} HDF5_${__lang}_COMPILE_LINE - HDF5_${__lang}_RETURN_VALUE HDF5_${__lang}_VERSION) + HDF5_${__lang}_RETURN_VALUE HDF5_${__lang}_VERSION HDF5_${__lang}_IS_PARALLEL) if(HDF5_${__lang}_RETURN_VALUE EQUAL 0) message(STATUS "HDF5: Using hdf5 compiler wrapper to determine ${__lang} configuration") _HDF5_parse_compile_line( HDF5_${__lang}_COMPILE_LINE @@ -554,6 +597,15 @@ if(NOT HDF5_FOUND AND NOT HDF5_ROOT) message(WARNING "HDF5 Version found for language ${__lang}, ${HDF5_${__lang}_VERSION} is different than previously found version ${HDF5_VERSION}") endif() endif() + if(DEFINED HDF5_${__lang}_IS_PARALLEL) + if(NOT DEFINED HDF5_IS_PARALLEL) + set(HDF5_IS_PARALLEL ${HDF5_${__lang}_IS_PARALLEL}) + elseif(NOT HDF5_IS_PARALLEL AND HDF5_${__lang}_IS_PARALLEL) + message(WARNING "HDF5 found for language ${__lang} is parallel but previously found language is not parallel.") + elseif(HDF5_IS_PARALLEL AND NOT HDF5_${__lang}_IS_PARALLEL) + message(WARNING "HDF5 found for language ${__lang} is not parallel but previously found language is parallel.") + endif() + endif() endforeach() else() set(_HDF5_NEED_TO_SEARCH True) @@ -613,7 +665,7 @@ if( NOT HDF5_FOUND ) set(HDF5_CXX_HL_LIBRARY_NAMES hdf5_hl_cpp ${HDF5_C_HL_LIBRARY_NAMES} ${HDF5_CXX_LIBRARY_NAMES}) set(HDF5_Fortran_LIBRARY_NAMES hdf5_fortran ${HDF5_C_LIBRARY_NAMES}) - set(HDF5_Fortran_HL_LIBRARY_NAMES hdf5_hl_fortran ${HDF5_C_HL_LIBRARY_NAMES} ${HDF5_Fortran_LIBRARY_NAMES}) + set(HDF5_Fortran_HL_LIBRARY_NAMES hdf5hl_fortran ${HDF5_C_HL_LIBRARY_NAMES} ${HDF5_Fortran_LIBRARY_NAMES}) foreach(__lang IN LISTS HDF5_LANGUAGE_BINDINGS) # find the HDF5 include directories diff --git a/Utilities/cmlibuv/src/unix/pipe.c b/Utilities/cmlibuv/src/unix/pipe.c index b73994c..80f5e6f 100644 --- a/Utilities/cmlibuv/src/unix/pipe.c +++ b/Utilities/cmlibuv/src/unix/pipe.c @@ -42,13 +42,10 @@ int uv_pipe_init(uv_loop_t* loop, uv_pipe_t* handle, int ipc) { int uv_pipe_bind(uv_pipe_t* handle, const char* name) { struct sockaddr_un saddr; - const char* pipe_fname; - int sockfd; + const char* pipe_fname = NULL; + int sockfd = -1; int err; - pipe_fname = NULL; - sockfd = -1; - /* Already bound? */ if (uv__stream_fd(handle) >= 0) return -EINVAL; diff --git a/Utilities/cmlibuv/src/unix/tty.c b/Utilities/cmlibuv/src/unix/tty.c index b2d37f4..ae1018f 100644 --- a/Utilities/cmlibuv/src/unix/tty.c +++ b/Utilities/cmlibuv/src/unix/tty.c @@ -58,8 +58,8 @@ static int uv__tty_is_slave(const int fd) { int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, int fd, int readable) { uv_handle_type type; - int flags; - int newfd; + int flags = 0; + int newfd = -1; int r; int saved_flags; char path[256]; @@ -72,9 +72,6 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, int fd, int readable) { if (type == UV_FILE || type == UV_UNKNOWN_HANDLE) return -EINVAL; - flags = 0; - newfd = -1; - /* Reopen the file descriptor when it refers to a tty. This lets us put the * tty in non-blocking mode without affecting other processes that share it * with us. |