summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2016-09-21 23:12:22 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2016-09-21 23:12:22 (GMT)
commit3291ceb0eeee73321f814bcb509543b2ccaadaab (patch)
treec8b9502ada9ccd59a1871b346db99fadf25f9243
parent7ef33fa7b306338399ac2160a66f421a5a0feccf (diff)
parentbe3ad22522825d170e50a513c2937ca69799d82a (diff)
downloadhdf5-3291ceb0eeee73321f814bcb509543b2ccaadaab.zip
hdf5-3291ceb0eeee73321f814bcb509543b2ccaadaab.tar.gz
hdf5-3291ceb0eeee73321f814bcb509543b2ccaadaab.tar.bz2
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/~bmribler/hdf5_bmr_CppAPI into develop
-rw-r--r--CTestConfig.cmake2
-rw-r--r--config/cmake/FindJNI.cmake31
-rw-r--r--config/cmake/HDF518_Examples.cmake.in15
-rw-r--r--config/cmake/HDF5_Examples.cmake.in15
-rw-r--r--config/cmake/UseJava.cmake169
-rw-r--r--config/cmake_ext_mod/FindMPI.cmake59
-rw-r--r--fortran/src/CMakeLists.txt69
-rw-r--r--fortran/test/CMakeLists.txt72
-rw-r--r--hl/fortran/src/CMakeLists.txt66
-rw-r--r--java/src/jni/h5pImp.c12
-rw-r--r--java/src/jni/h5util.c18
-rw-r--r--tools/h5ls/CMakeTests.cmake1
-rw-r--r--tools/h5ls/CMakeTestsVDS.cmake3
13 files changed, 415 insertions, 117 deletions
diff --git a/CTestConfig.cmake b/CTestConfig.cmake
index 45fa7d5..849d218 100644
--- a/CTestConfig.cmake
+++ b/CTestConfig.cmake
@@ -17,7 +17,7 @@ else (CDASH_LOCAL)
endif (CDASH_LOCAL)
set (CTEST_DROP_SITE_CDASH TRUE)
-set (UPDATE_TYPE svn)
+set (UPDATE_TYPE git)
set (VALGRIND_COMMAND "/usr/bin/valgrind")
set (VALGRIND_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe")
set (CTEST_MEMORYCHECK_COMMAND "/usr/bin/valgrind")
diff --git a/config/cmake/FindJNI.cmake b/config/cmake/FindJNI.cmake
index 440a9889..9105f3d 100644
--- a/config/cmake/FindJNI.cmake
+++ b/config/cmake/FindJNI.cmake
@@ -63,7 +63,7 @@ macro(java_append_library_directories _var)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64")
set(_java_libarch "ppc64" "ppc")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)")
- set(_java_libarch "ppc")
+ set(_java_libarch "ppc" "ppc64")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")
# Both flavours can run on the same processor
set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "sparc" "sparcv9")
@@ -92,10 +92,14 @@ macro(java_append_library_directories _var)
if(_path MATCHES "{libarch}")
foreach(_libarch ${_java_libarch})
string(REPLACE "{libarch}" "${_libarch}" _newpath "${_path}")
- list(APPEND ${_var} "${_newpath}")
+ if(EXISTS ${_newpath})
+ list(APPEND ${_var} "${_newpath}")
+ endif()
endforeach()
else()
- list(APPEND ${_var} "${_path}")
+ if(EXISTS ${_path})
+ list(APPEND ${_var} "${_path}")
+ endif()
endif()
endforeach()
endmacro()
@@ -161,6 +165,10 @@ JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
/usr/lib/jvm/default-java/jre/lib/{libarch}
/usr/lib/jvm/default-java/jre/lib
/usr/lib/jvm/default-java/lib
+ # Ubuntu specific paths for default JVM
+ /usr/lib/jvm/java-8-openjdk-{libarch}/jre/lib/{libarch} # Ubuntu 15.10
+ /usr/lib/jvm/java-7-openjdk-{libarch}/jre/lib/{libarch} # Ubuntu 15.10
+ /usr/lib/jvm/java-6-openjdk-{libarch}/jre/lib/{libarch} # Ubuntu 15.10
# OpenBSD specific paths for default JVM
/usr/local/jdk-1.7.0/jre/lib/{libarch}
/usr/local/jre-1.7.0/lib/{libarch}
@@ -191,6 +199,9 @@ list(APPEND JAVA_AWT_INCLUDE_DIRECTORIES
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/include"
+)
+
+JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_INCLUDE_DIRECTORIES
${_JAVA_HOME}/include
/usr/include
/usr/java/include
@@ -209,6 +220,9 @@ list(APPEND JAVA_AWT_INCLUDE_DIRECTORIES
/usr/lib/jvm/java-7-openjdk-amd64/include
/usr/lib64/jvm/java-7-openjdk/include
/usr/lib64/jvm/java-7-openjdk-amd64/include
+ /usr/lib/jvm/java-8-openjdk-{libarch}/include # ubuntu 15.10
+ /usr/lib/jvm/java-7-openjdk-{libarch}/include # ubuntu 15.10
+ /usr/lib/jvm/java-6-openjdk-{libarch}/include # ubuntu 15.10
/usr/local/share/java/include
/usr/lib/j2sdk1.4-sun/include
/usr/lib/j2sdk1.5-sun/include
@@ -290,7 +304,8 @@ find_path(JAVA_INCLUDE_PATH jni.h
${JAVA_AWT_INCLUDE_DIRECTORIES}
)
-find_path(JAVA_INCLUDE_PATH2 jni_md.h
+find_path(JAVA_INCLUDE_PATH2 NAMES jni_md.h jniport.h
+ PATHS
${JAVA_INCLUDE_PATH}
${JAVA_INCLUDE_PATH}/darwin
${JAVA_INCLUDE_PATH}/win32
@@ -300,6 +315,7 @@ find_path(JAVA_INCLUDE_PATH2 jni_md.h
${JAVA_INCLUDE_PATH}/solaris
${JAVA_INCLUDE_PATH}/hp-ux
${JAVA_INCLUDE_PATH}/alpha
+ ${JAVA_INCLUDE_PATH}/aix
)
find_path(JAVA_AWT_INCLUDE_PATH jawt.h
@@ -316,8 +332,11 @@ endif()
#include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
INCLUDE (FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(JNI DEFAULT_MSG JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY
- JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(JNI DEFAULT_MSG JAVA_AWT_LIBRARY
+ JAVA_JVM_LIBRARY
+ JAVA_INCLUDE_PATH
+ JAVA_INCLUDE_PATH2
+ JAVA_AWT_INCLUDE_PATH)
mark_as_advanced(
JAVA_AWT_LIBRARY
diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in
index 561bdb7..efabbe6 100644
--- a/config/cmake/HDF518_Examples.cmake.in
+++ b/config/cmake/HDF518_Examples.cmake.in
@@ -45,6 +45,18 @@ if(NOT DEFINED FORTRAN_LIBRARIES)
else(NOT DEFINED FORTRAN_LIBRARIES)
set(FORTRANLIBRARIES "YES")
endif()
+if(NOT DEFINED HDF_LOCAL)
+ set(CDASH_LOCAL "NO")
+else(NOT HDF_LOCAL)
+ set(CDASH_LOCAL "YES")
+endif()
+if(NOT DEFINED CTEST_SITE)
+ set(CTEST_SITE "local")
+endif()
+if(NOT DEFINED CTEST_BUILD_NAME)
+ set(CTEST_BUILD_NAME "examples")
+endif()
+set(BUILD_OPTIONS "${BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}")
#TAR_SOURCE - name of tarfile
#if(NOT DEFINED TAR_SOURCE)
@@ -77,6 +89,9 @@ if(${FORTRANLIBRARIES})
else()
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF")
endif()
+if(${CDASH_LOCAL})
+ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCDASH_LOCAL:BOOL=ON")
+endif()
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@")
###############################################################################################################
diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in
index d7e2591..8ea6d18 100644
--- a/config/cmake/HDF5_Examples.cmake.in
+++ b/config/cmake/HDF5_Examples.cmake.in
@@ -51,6 +51,18 @@ if(NOT DEFINED JAVA_LIBRARIES)
else(NOT DEFINED JAVA_LIBRARIES)
set(JAVALIBRARIES "YES")
endif()
+if(NOT DEFINED HDF_LOCAL)
+ set(CDASH_LOCAL "NO")
+else(NOT HDF_LOCAL)
+ set(CDASH_LOCAL "YES")
+endif()
+if(NOT DEFINED CTEST_SITE)
+ set(CTEST_SITE "local")
+endif()
+if(NOT DEFINED CTEST_BUILD_NAME)
+ set(CTEST_BUILD_NAME "examples")
+endif()
+set(BUILD_OPTIONS "${BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}")
#TAR_SOURCE - name of tarfile
#if(NOT DEFINED TAR_SOURCE)
@@ -88,6 +100,9 @@ if(${JAVALIBRARIES})
else()
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=OFF")
endif()
+if(${CDASH_LOCAL})
+ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCDASH_LOCAL:BOOL=ON")
+endif()
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@")
###############################################################################################################
diff --git a/config/cmake/UseJava.cmake b/config/cmake/UseJava.cmake
index 9b2b1e0..4f8e4c8 100644
--- a/config/cmake/UseJava.cmake
+++ b/config/cmake/UseJava.cmake
@@ -169,7 +169,7 @@
#
# ::
#
-# The add_jar() functions sets some target properties. You can get these
+# The add_jar() function sets some target properties. You can get these
# properties with the
# get_property(TARGET <target_name> PROPERTY <propery_name>)
# command.
@@ -217,6 +217,19 @@
# This command installs the TARGET_NAME files to the given DESTINATION.
# It should be called in the same scope as add_jar() or it will fail.
#
+# Target Properties:
+#
+# ::
+#
+# The install_jar() function sets the INSTALL_DESTINATION target property
+# on jars so installed. This property holds the DESTINATION as described
+# above, and is used by install_jar_exports(). You can get this property
+# with the
+# get_property(TARGET <target_name> PROPERTY INSTALL_DESTINATION)
+# command.
+#
+#
+#
# ::
#
# install_jni_symlink(target_name destination)
@@ -228,6 +241,24 @@
#
# ::
#
+# install_jar_exports(TARGETS jar1 [jar2 ...]
+# FILE export_filename
+# DESTINATION destination [COMPONENT component])
+#
+# This command installs a target export file export_filename for the named jar
+# targets to the given DESTINATION. Its function is similar to that of
+# install(EXPORTS).
+#
+# ::
+#
+# export_jars(TARGETS jar1 [jar2 ...]
+# FILE export_filename)
+#
+# This command writes a target export file export_filename for the named jar
+# targets. Its function is similar to that of export().
+#
+# ::
+#
# create_javadoc(<VAR>
# PACKAGES pkg1 [pkg2 ...]
# [SOURCEPATH <sourcepath>]
@@ -324,7 +355,7 @@
# that allow your Java and C code to interact.
#
# There are two main signatures for create_javah. The first signature
-# returns generated files throught variable specified by GENERATED_FILES option:
+# returns generated files through variable specified by GENERATED_FILES option:
#
# ::
#
@@ -389,14 +420,36 @@ include(CMakeParseArguments)
function (__java_copy_file src dest comment)
add_custom_command(
OUTPUT ${dest}
- COMMAND cmake -E copy_if_different
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
ARGS ${src}
${dest}
DEPENDS ${src}
COMMENT ${comment})
endfunction ()
+function(__java_lcat VAR)
+ foreach(_line ${ARGN})
+ set(${VAR} "${${VAR}}${_line}\n")
+ endforeach()
+
+ set(${VAR} "${${VAR}}" PARENT_SCOPE)
+endfunction()
+
+function(__java_export_jar VAR TARGET PATH)
+ get_target_property(_jarpath ${TARGET} JAR_FILE)
+ get_filename_component(_jarname ${_jarpath} NAME)
+ __java_lcat(${VAR}
+ "# Create imported target ${TARGET}"
+ "add_custom_target(${TARGET})"
+ "set_target_properties(${TARGET} PROPERTIES"
+ " JAR_FILE \"${PATH}/${_jarname}\")"
+ ""
+ )
+ set(${VAR} "${${VAR}}" PARENT_SCOPE)
+endfunction()
+
# define helper scripts
+set(_JAVA_EXPORT_TARGETS_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/javaTargets.cmake.in)
set(_JAVA_CLASS_FILELIST_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/UseJavaClassFilelist.cmake)
set(_JAVA_SYMLINK_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/UseJavaSymlinks.cmake)
@@ -435,6 +488,8 @@ function(add_jar _TARGET_NAME)
if (NOT DEFINED _add_jar_OUTPUT_DIR)
set(_add_jar_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
+ else()
+ get_filename_component(_add_jar_OUTPUT_DIR ${_add_jar_OUTPUT_DIR} ABSOLUTE)
endif()
if (_add_jar_ENTRY_POINT)
@@ -554,11 +609,6 @@ function(add_jar _TARGET_NAME)
endif ()
endforeach()
- # create an empty java_class_filelist
- if (NOT EXISTS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist)
- file(WRITE ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist "")
- endif()
-
if (_JAVA_COMPILE_FILES OR _JAVA_COMPILE_FILELISTS)
set (_JAVA_SOURCES_FILELISTS)
@@ -598,6 +648,11 @@ function(add_jar _TARGET_NAME)
DEPENDS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_compiled_${_TARGET_NAME}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
+ else ()
+ # create an empty java_class_filelist
+ if (NOT EXISTS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist)
+ file(WRITE ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist "")
+ endif()
endif ()
# create the jar file
@@ -716,6 +771,13 @@ function(INSTALL_JAR _TARGET_NAME)
PROPERTY
INSTALL_FILES
)
+ set_property(
+ TARGET
+ ${_TARGET_NAME}
+ PROPERTY
+ INSTALL_DESTINATION
+ ${_DESTINATION}
+ )
if (__FILES)
install(
@@ -1348,3 +1410,94 @@ function (create_javah)
set (${_create_javah_GENERATED_FILES} ${_output_files} PARENT_SCOPE)
endif()
endfunction()
+
+function(export_jars)
+ # Parse and validate arguments
+ cmake_parse_arguments(_export_jars
+ ""
+ "FILE"
+ "TARGETS"
+ ${ARGN}
+ )
+ if (NOT _export_jars_FILE)
+ message(SEND_ERROR "export_jars: FILE must be specified.")
+ endif()
+ if (NOT _export_jars_TARGETS)
+ message(SEND_ERROR "export_jars: TARGETS must be specified.")
+ endif()
+
+ # Set content of generated exports file
+ string(REPLACE ";" " " __targets__ "${_export_jars_TARGETS}")
+ set(__targetdefs__ "")
+ foreach(_target ${_export_jars_TARGETS})
+ get_target_property(_jarpath ${_target} JAR_FILE)
+ get_filename_component(_jarpath ${_jarpath} PATH)
+ __java_export_jar(__targetdefs__ ${_target} "${_jarpath}")
+ endforeach()
+
+ # Generate exports file
+ configure_file(
+ ${_JAVA_EXPORT_TARGETS_SCRIPT}
+ ${_export_jars_FILE}
+ @ONLY
+ )
+endfunction()
+
+function(install_jar_exports)
+ # Parse and validate arguments
+ cmake_parse_arguments(_install_jar_exports
+ ""
+ "FILE;DESTINATION;COMPONENT"
+ "TARGETS"
+ ${ARGN}
+ )
+ if (NOT _install_jar_exports_FILE)
+ message(SEND_ERROR "install_jar_exports: FILE must be specified.")
+ endif()
+ if (NOT _install_jar_exports_DESTINATION)
+ message(SEND_ERROR "install_jar_exports: DESTINATION must be specified.")
+ endif()
+ if (NOT _install_jar_exports_TARGETS)
+ message(SEND_ERROR "install_jar_exports: TARGETS must be specified.")
+ endif()
+
+ if (_install_jar_exports_COMPONENT)
+ set (_COMPONENT COMPONENT ${_install_jar_exports_COMPONENT})
+ endif()
+
+ # Determine relative path from installed export file to install prefix
+ if(IS_ABSOLUTE ${_install_jar_exports_DESTINATION})
+ file(RELATIVE_PATH _relpath
+ ${_install_jar_exports_DESTINATION}
+ ${CMAKE_INSTALL_PREFIX}
+ )
+ else()
+ file(RELATIVE_PATH _relpath
+ ${CMAKE_INSTALL_PREFIX}/${_install_jar_exports_DESTINATION}
+ ${CMAKE_INSTALL_PREFIX}
+ )
+ endif()
+
+ # Set up unique location for generated exports file
+ string(SHA256 _hash "${_install_jar_exports_DESTINATION}")
+ set(_tmpdir ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/JavaExports/${_hash})
+
+ # Set content of generated exports file
+ string(REPLACE ";" " " __targets__ "${_install_jar_exports_TARGETS}")
+ set(__targetdefs__ "set(_prefix \${CMAKE_CURRENT_LIST_DIR}/${_relpath})\n\n")
+ foreach(_target ${_install_jar_exports_TARGETS})
+ get_target_property(_dir ${_target} INSTALL_DESTINATION)
+ __java_export_jar(__targetdefs__ ${_target} "\${_prefix}/${_dir}")
+ endforeach()
+ __java_lcat(__targetdefs__ "\nunset(_prefix)")
+
+ # Generate and install exports file
+ configure_file(
+ ${_JAVA_EXPORT_TARGETS_SCRIPT}
+ ${_tmpdir}/${_install_jar_exports_FILE}
+ @ONLY
+ )
+ install(FILES ${_tmpdir}/${_install_jar_exports_FILE}
+ DESTINATION ${_install_jar_exports_DESTINATION}
+ ${_COMPONENT})
+endfunction()
diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake
index 1c9a2e3..80d8511 100644
--- a/config/cmake_ext_mod/FindMPI.cmake
+++ b/config/cmake_ext_mod/FindMPI.cmake
@@ -11,7 +11,8 @@
# of them have somewhat different include paths, libraries to link
# against, etc., and this module tries to smooth out those differences.
#
-# === Variables ===
+# Variables
+# ^^^^^^^^^
#
# This module will set the following variables per language in your
# project, where <lang> is one of C, CXX, or Fortran:
@@ -37,11 +38,12 @@
# before the executable to run.
# MPIEXEC_POSTFLAGS Flags to pass to MPIEXEC after other flags
#
-# === Usage ===
+# Usage
+# ^^^^^
#
# To use this module, simply call FindMPI from a CMakeLists.txt file, or
-# run find_package(MPI), then run CMake. If you are happy with the
-# auto- detected configuration for your language, then you're done. If
+# run ``find_package(MPI)``, then run CMake. If you are happy with the
+# auto-detected configuration for your language, then you're done. If
# not, you have two options:
#
# ::
@@ -55,24 +57,25 @@
# listed above, but these two are required. This will circumvent
# autodetection entirely.
#
-# When configuration is successful, MPI_<lang>_COMPILER will be set to
-# the compiler wrapper for <lang>, if it was found. MPI_<lang>_FOUND
+# When configuration is successful, ``MPI_<lang>_COMPILER`` will be set to
+# the compiler wrapper for <lang>, if it was found. ``MPI_<lang>_FOUND``
# and other variables above will be set if any MPI implementation was
# found for <lang>, regardless of whether a compiler was found.
#
-# When using MPIEXEC to execute MPI applications, you should typically
-# use all of the MPIEXEC flags as follows:
+# When using ``MPIEXEC`` to execute MPI applications, you should typically
+# use all of the ``MPIEXEC`` flags as follows:
#
# ::
#
# ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} PROCS
# ${MPIEXEC_PREFLAGS} EXECUTABLE ${MPIEXEC_POSTFLAGS} ARGS
#
-# where PROCS is the number of processors on which to execute the
-# program, EXECUTABLE is the MPI program, and ARGS are the arguments to
+# where ``PROCS`` is the number of processors on which to execute the
+# program, ``EXECUTABLE`` is the MPI program, and ``ARGS`` are the arguments to
# pass to the MPI program.
#
-# === Backward Compatibility ===
+# Backward Compatibility
+# ^^^^^^^^^^^^^^^^^^^^^^
#
# For backward compatibility with older versions of FindMPI, these
# variables are set, but deprecated:
@@ -83,7 +86,7 @@
# MPI_COMPILE_FLAGS MPI_INCLUDE_PATH MPI_EXTRA_LIBRARY
# MPI_LINK_FLAGS MPI_LIBRARIES
#
-# In new projects, please use the MPI_<lang>_XXX equivalents.
+# In new projects, please use the ``MPI_<lang>_XXX`` equivalents.
#=============================================================================
# Copyright 2001-2011 Kitware, Inc.
@@ -204,7 +207,7 @@ function (_mpi_check_compiler compiler options cmdvar resvar)
# Intel MPI 5.0.1 will return a zero return code even when the
# argument to the MPI compiler wrapper is unknown. Attempt to
# catch this case.
- if("${cmdline}" MATCHES "undefined reference")
+ if(cmdline MATCHES "undefined reference" OR cmdline MATCHES "unrecognized")
set(success 255 )
endif()
set(${cmdvar} "${cmdline}" PARENT_SCOPE)
@@ -325,7 +328,7 @@ function (interrogate_mpi_compiler lang try_libs)
foreach(FLAG ${MPI_ALL_COMPILE_FLAGS})
if (MPI_COMPILE_FLAGS_WORK)
- set(MPI_COMPILE_FLAGS_WORK "${MPI_COMPILE_FLAGS_WORK} ${FLAG}")
+ string(APPEND MPI_COMPILE_FLAGS_WORK " ${FLAG}")
else()
set(MPI_COMPILE_FLAGS_WORK ${FLAG})
endif()
@@ -355,10 +358,10 @@ function (interrogate_mpi_compiler lang try_libs)
endif()
# Extract linker paths from the link command line
- string(REGEX MATCHALL "(^| |-Wl,)-L([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}")
+ string(REGEX MATCHALL "(^| |-Wl,)(-L|/LIBPATH:)([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}")
set(MPI_LINK_PATH)
foreach(LPATH ${MPI_ALL_LINK_PATHS})
- string(REGEX REPLACE "^(| |-Wl,)-L" "" LPATH ${LPATH})
+ string(REGEX REPLACE "^(| |-Wl,)(-L|/LIBPATH:)" "" LPATH ${LPATH})
string(REPLACE "//" "/" LPATH ${LPATH})
list(APPEND MPI_LINK_PATH ${LPATH})
endforeach()
@@ -374,7 +377,7 @@ function (interrogate_mpi_compiler lang try_libs)
set(MPI_LINK_FLAGS_WORK)
foreach(FLAG ${MPI_ALL_LINK_FLAGS})
if (MPI_LINK_FLAGS_WORK)
- set(MPI_LINK_FLAGS_WORK "${MPI_LINK_FLAGS_WORK} ${FLAG}")
+ string(APPEND MPI_LINK_FLAGS_WORK " ${FLAG}")
else()
set(MPI_LINK_FLAGS_WORK ${FLAG})
endif()
@@ -383,20 +386,31 @@ function (interrogate_mpi_compiler lang try_libs)
# Extract the set of libraries to link against from the link command
# line
string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}")
+ if(WIN32)
+ # The intel wrappers on windows link against static versions of the MPI libraries.
+ # The static libraries are simply listed on the command line without -l.
+ # For instance: " icl ... impi.lib "
+ string(REGEX MATCHALL "(^| )([^\" ]+)\\.lib" tmp "${MPI_LINK_CMDLINE}")
+ list(APPEND MPI_LIBNAMES ${tmp})
+ endif()
# add the compiler implicit directories because some compilers
# such as the intel compiler have libraries that show up
# in the showme list that can only be found in the implicit
# link directories of the compiler.
if (DEFINED CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES)
- set(MPI_LINK_PATH
- "${MPI_LINK_PATH};${CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES}")
+ string(APPEND MPI_LINK_PATH
+ ";${CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES}")
endif ()
# Determine full path names for all of the libraries that one needs
# to link against in an MPI program
foreach(LIB ${MPI_LIBNAMES})
string(REGEX REPLACE "^ ?-l" "" LIB ${LIB})
+ if(WIN32)
+ string(REGEX REPLACE "\\.lib$" "" LIB ${LIB})
+ endif()
+ string(STRIP ${LIB} LIB)
# MPI_LIB is cached by find_library, but we don't want that. Clear it first.
set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
find_library(MPI_LIB NAMES ${LIB} HINTS ${MPI_LINK_PATH})
@@ -597,14 +611,13 @@ foreach (lang C CXX Fortran)
if (CMAKE_${lang}_COMPILER_WORKS)
# If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler.
if (MPI_${lang}_COMPILER)
- is_file_executable(MPI_${lang}_COMPILER MPI_COMPILER_IS_EXECUTABLE)
- if (NOT MPI_COMPILER_IS_EXECUTABLE)
+ if (NOT IS_ABSOLUTE "${MPI_${lang}_COMPILER}")
# Get rid of our default list of names and just search for the name the user wants.
set(_MPI_${lang}_COMPILER_NAMES ${MPI_${lang}_COMPILER})
set(MPI_${lang}_COMPILER "MPI_${lang}_COMPILER-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
- # If the user specifies a compiler, we don't want to try to search libraries either.
- set(try_libs FALSE)
endif()
+ # If the user specifies a compiler, we don't want to try to search libraries either.
+ set(try_libs FALSE)
else()
set(try_libs TRUE)
endif()
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt
index ea38c58..d4ca791 100644
--- a/fortran/src/CMakeLists.txt
+++ b/fortran/src/CMakeLists.txt
@@ -65,6 +65,7 @@ set_target_properties (H5_buildiface PROPERTIES
)
if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
+ file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared")
if (WIN32)
set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/\${BUILD_TYPE})
else (WIN32)
@@ -92,6 +93,8 @@ add_custom_command (
WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}
DEPENDS H5match_types
)
+set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5f90i_gen.h PROPERTIES GENERATED TRUE)
+set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 PROPERTIES GENERATED TRUE)
#-----------------------------------------------------------------------------
# f90CStub lib
@@ -114,7 +117,6 @@ set (f90CStub_C_SOURCES
${HDF5_F90_SRC_SOURCE_DIR}/H5Tf.c
${HDF5_F90_SRC_SOURCE_DIR}/H5Zf.c
)
-
set_source_files_properties (${f90CStub_C_SOURCES} PROPERTIES LANGUAGE C)
set (f90CStub_C_HDRS
@@ -150,15 +152,43 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
set (install_targets ${install_targets} ${HDF5_F90_C_LIBSH_TARGET})
endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
-set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5_gen.F90 PROPERTIES GENERATED TRUE)
-
#-----------------------------------------------------------------------------
# Fortran Modules
#-----------------------------------------------------------------------------
-set (f90_F_BASE_SOURCES
- # generated files
- ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90
+set (f90_F_GEN_SOURCES
+ ${HDF5_F90_SRC_SOURCE_DIR}/H5Aff.F90
+ ${HDF5_F90_SRC_SOURCE_DIR}/H5Dff.F90
+ ${HDF5_F90_SRC_SOURCE_DIR}/H5Pff.F90
+)
+set (CMD $<TARGET_FILE:H5_buildiface>)
+add_custom_command (
+ OUTPUT ${HDF5_F90_BINARY_DIR}/H5_gen.F90
+ COMMAND ${CMD}
+ WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}
+ DEPENDS ${f90_F_GEN_SOURCES}
+ COMMENT "Generating the H5_gen.F90 file"
+)
+add_custom_target (H5gen ALL
+ DEPENDS ${HDF5_F90_BINARY_DIR}/H5_gen.F90
+)
+set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5_gen.F90 PROPERTIES GENERATED TRUE)
+if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
+ set (CMDSH $<TARGET_FILE:H5_buildiface>)
+ add_custom_command (
+ OUTPUT ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90
+ COMMAND ${CMDSH}
+ WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/shared
+ DEPENDS ${f90_F_GEN_SOURCES}
+ COMMENT "Generating the H5_gen.F90 shared file"
+ )
+ add_custom_target (H5genSH ALL
+ DEPENDS ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90
+ )
+ set_source_files_properties (${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 PROPERTIES GENERATED TRUE)
+endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
+
+set (f90_F_BASE_SOURCES
# normal distribution
${HDF5_F90_SRC_SOURCE_DIR}/H5f90global.F90
${HDF5_F90_SRC_SOURCE_DIR}/H5fortkit.F90
@@ -179,6 +209,9 @@ set (f90_F_BASE_SOURCES
)
set (f90_F_SOURCES
+ # generated file
+ ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90
+
${f90_F_BASE_SOURCES}
# generated file
@@ -187,16 +220,20 @@ set (f90_F_SOURCES
# normal distribution
${HDF5_F90_SRC_SOURCE_DIR}/HDF5.F90
)
+if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
+ set (f90_F_SOURCES_SHARED
+ # generated file
+ ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90
-set (CMD $<TARGET_FILE:H5_buildiface>)
-add_custom_target (H5gen ALL
- COMMAND ${CMD}
-#v3.2 BYPRODUCT ${HDF5_F90_BINARY_DIR}/H5_gen.F90
- WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}
- DEPENDS ${f90_F_BASE_SOURCES}
-)
+ ${f90_F_BASE_SOURCES}
+
+ # generated file
+ ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90
-set_source_files_properties (${f90_F_SOURCES} PROPERTIES LANGUAGE Fortran)
+ # normal distribution
+ ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.F90
+ )
+endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
#-----------------------------------------------------------------------------
# Add Main fortran library
@@ -222,9 +259,10 @@ if (WIN32)
)
endif (WIN32)
set (install_targets ${install_targets} ${HDF5_F90_LIB_TARGET})
+add_dependencies(${HDF5_F90_LIB_TARGET} H5gen)
if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
- add_library (${HDF5_F90_LIBSH_TARGET} SHARED ${f90_F_SOURCES})
+ add_library (${HDF5_F90_LIBSH_TARGET} SHARED ${f90_F_SOURCES_SHARED})
set (SHARED_LINK_FLAGS " ")
if (WIN32 AND MSVC)
set (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def")
@@ -250,6 +288,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
)
endif (WIN32)
set (install_targets ${install_targets} ${HDF5_F90_LIBSH_TARGET})
+ add_dependencies(${HDF5_F90_LIBSH_TARGET} H5genSH)
endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
#-----------------------------------------------------------------------------
diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt
index d1ca6e8..219f937 100644
--- a/fortran/test/CMakeLists.txt
+++ b/fortran/test/CMakeLists.txt
@@ -32,13 +32,19 @@ set_target_properties (H5_test_buildiface PROPERTIES
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}
)
-if (NOT SKIP_HDF5_FORTRAN_SHARED)
+if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
+ file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared")
if (WIN32)
- set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/\${BUILD_TYPE})
+ set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/\${BUILD_TYPE})
else (WIN32)
- set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static)
+ set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared)
endif (WIN32)
-endif (NOT SKIP_HDF5_FORTRAN_SHARED)
+endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
+if (WIN32)
+ set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/\${BUILD_TYPE})
+else (WIN32)
+ set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static)
+endif (WIN32)
INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${MOD_BUILD_DIR})
@@ -75,29 +81,54 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
)
endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
-set (HDF5_F90_TF_SOURCES
- # generated files
- ${HDF5_F90_BINARY_DIR}/tf_gen.F90
-)
-set_source_files_properties (
- ${HDF5_F90_BINARY_DIR}/tf_gen.F90
- PROPERTIES GENERATED TRUE
-)
-set_source_files_properties (tf.F90 ${HDF5_F90_BINARY_DIR}/${HDF5_F90_TF_SOURCES} PROPERTIES LANGUAGE Fortran)
-
set (CMD $<TARGET_FILE:H5_test_buildiface>)
-add_custom_target (H5testgen ALL
+add_custom_command (
+ OUTPUT ${HDF5_F90_BINARY_DIR}/tf_gen.F90
COMMAND ${CMD}
-#v3.2 BYPRODUCT ${HDF5_F90_BINARY_DIR}/tf_gen.F90
WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}
DEPENDS H5_test_buildiface
+ COMMENT "Generating the tf_gen.F90 file"
)
+add_custom_target (H5testgen ALL
+ DEPENDS ${HDF5_F90_BINARY_DIR}/tf_gen.F90
+)
+set_source_files_properties (${HDF5_F90_BINARY_DIR}/tf_gen.F90 PROPERTIES GENERATED TRUE)
-add_library (${HDF5_F90_TEST_LIB_TARGET} STATIC tf.F90 ${HDF5_F90_TF_SOURCES})
if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
- add_library (${HDF5_F90_TEST_LIBSH_TARGET} SHARED tf.F90 ${HDF5_F90_TF_SOURCES})
+ set (CMDSH $<TARGET_FILE:H5_test_buildiface>)
+ add_custom_command (
+ OUTPUT ${HDF5_F90_BINARY_DIR}/shared/tf_gen.F90
+ COMMAND ${CMDSH}
+ WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/shared
+ DEPENDS H5_test_buildiface
+ COMMENT "Generating the tf_gen.F90 shared file"
+ )
+ add_custom_target (H5testgenSH ALL
+ DEPENDS ${HDF5_F90_BINARY_DIR}/shared/tf_gen.F90
+ )
+ set_source_files_properties (${HDF5_F90_BINARY_DIR}/shared/tf_gen.F90 PROPERTIES GENERATED TRUE)
+endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
+
+set (HDF5_F90_TF_SOURCES
+ # generated files
+ ${HDF5_F90_BINARY_DIR}/tf_gen.F90
+
+ # normal distribution
+ tf.F90
+)
+set_source_files_properties (${HDF5_F90_TF_SOURCES} PROPERTIES LANGUAGE Fortran)
+if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
+ set (HDF5_F90_TF_SOURCES_SHARED
+ # generated file
+ ${HDF5_F90_BINARY_DIR}/shared/tf_gen.F90
+
+ # normal distribution
+ tf.F90
+ )
+ set_source_files_properties (${HDF5_F90_TF_SOURCES_SHARED} PROPERTIES LANGUAGE Fortran)
endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
+add_library (${HDF5_F90_TEST_LIB_TARGET} STATIC ${HDF5_F90_TF_SOURCES})
TARGET_FORTRAN_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} STATIC " " " ")
target_link_libraries (${HDF5_F90_TEST_LIB_TARGET}
${HDF5_F90_C_TEST_LIB_TARGET}
@@ -117,7 +148,10 @@ if (WIN32)
COMPILE_DEFINITIONS "HDF5F90_WINDOWS"
)
endif (WIN32)
+add_dependencies(${HDF5_F90_TEST_LIB_TARGET} H5testgen)
+
if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
+ add_library (${HDF5_F90_TEST_LIBSH_TARGET} SHARED ${HDF5_F90_TF_SOURCES_SHARED})
set (SHARED_LINK_FLAGS " ")
if (WIN32 AND MSVC)
set (SHARED_LINK_FLAGS "/DLL")
@@ -143,6 +177,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
COMPILE_DEFINITIONS "BUILD_HDF5_TEST_DLL;HDF5F90_WINDOWS"
)
endif (WIN32)
+ add_dependencies(${HDF5_F90_TEST_LIBSH_TARGET} H5testgenSH)
endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
#-----------------------------------------------------------------------------
@@ -327,6 +362,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
if (WIN32 AND MSVC)
target_link_libraries (fortranlib_test_F03-shared "ws2_32.lib")
endif (WIN32 AND MSVC)
+
target_include_directories (fortranlib_test_F03-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared)
set_target_properties (fortranlib_test_F03-shared PROPERTIES
LINKER_LANGUAGE Fortran
diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt
index 6419ab8..774aa7c 100644
--- a/hl/fortran/src/CMakeLists.txt
+++ b/hl/fortran/src/CMakeLists.txt
@@ -37,6 +37,7 @@ set_target_properties (H5HL_buildiface PROPERTIES
)
if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
+ file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/shared")
if (WIN32)
set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/\${BUILD_TYPE})
else (WIN32)
@@ -111,30 +112,61 @@ set (HDF5_HL_F90_F_BASE_SOURCES
${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTff.F90
${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMff.F90
)
-set (HDF5_HL_F90_F_SOURCES
- ${HDF5_HL_F90_F_BASE_SOURCES}
- # generated files
- ${HDF5_HL_F90_SRC_BINARY_DIR}/H5LTff_gen.F90
- ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90
+set (CMD $<TARGET_FILE:H5HL_buildiface>)
+add_custom_command (
+ OUTPUT ${HDF5_HL_F90_SRC_BINARY_DIR}/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90
+ COMMAND ${CMD}
+ WORKING_DIRECTORY ${HDF5_HL_F90_SRC_BINARY_DIR}
+ DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES}
+ COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 files"
+)
+add_custom_target (H5HLgen ALL
+ DEPENDS ${HDF5_HL_F90_SRC_BINARY_DIR}/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90
)
-
-set_source_files_properties (${HDF5_HL_F90_F_SOURCES} PROPERTIES LANGUAGE Fortran)
-
set_source_files_properties (
${HDF5_HL_F90_SRC_BINARY_DIR}/H5LTff_gen.F90
${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90
PROPERTIES GENERATED TRUE
)
+if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
+ set (CMDSH $<TARGET_FILE:H5HL_buildiface>)
+ add_custom_command (
+ OUTPUT ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90
+ COMMAND ${CMD}
+ WORKING_DIRECTORY ${HDF5_HL_F90_SRC_BINARY_DIR}/shared
+ DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES}
+ COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 shared files"
+ )
+ add_custom_target (H5HLgenSH ALL
+ DEPENDS ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90
+ )
+ set_source_files_properties (
+ ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5LTff_gen.F90
+ ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90
+ PROPERTIES GENERATED TRUE
+ )
+endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
-set (CMD $<TARGET_FILE:H5HL_buildiface>)
-add_custom_target (H5HLgen ALL
- COMMAND ${CMD}
-#v3.2 BYPRODUCT ${HDF5_HL_F90_SRC_BINARY_DIR}/H5LTff_gen.F90
-#v3.2 ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90
- WORKING_DIRECTORY ${HDF5_HL_F90_SRC_BINARY_DIR}
- DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES}
+set (HDF5_HL_F90_F_SOURCES
+ ${HDF5_HL_F90_F_BASE_SOURCES}
+
+ # generated files
+ ${HDF5_HL_F90_SRC_BINARY_DIR}/H5LTff_gen.F90
+ ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90
)
+set_source_files_properties (${HDF5_HL_F90_F_SOURCES} PROPERTIES LANGUAGE Fortran)
+
+if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
+ set (HDF5_HL_F90_F_SOURCES_SHARED
+ ${HDF5_HL_F90_F_BASE_SOURCES}
+
+ # generated files
+ ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5LTff_gen.F90
+ ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90
+ )
+ set_source_files_properties (${HDF5_HL_F90_F_SOURCES_SHARED} PROPERTIES LANGUAGE Fortran)
+endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
add_library (${HDF5_HL_F90_LIB_TARGET} STATIC ${HDF5_HL_F90_F_SOURCES})
TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} STATIC " " " ")
@@ -153,9 +185,10 @@ if (WIN32)
)
endif (WIN32)
set (install_targets ${install_targets} ${HDF5_HL_F90_LIB_TARGET})
+add_dependencies(${HDF5_HL_F90_LIB_TARGET} H5HLgen)
if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
- add_library (${HDF5_HL_F90_LIBSH_TARGET} SHARED ${HDF5_HL_F90_F_SOURCES})
+ add_library (${HDF5_HL_F90_LIBSH_TARGET} SHARED ${HDF5_HL_F90_F_SOURCES_SHARED})
set (SHARED_LINK_FLAGS " ")
if (WIN32 AND MSVC)
set (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_HL_F90_SRC_BINARY_DIR}/hdf5_hl_fortrandll.def")
@@ -177,6 +210,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
)
endif (WIN32)
set (install_targets ${install_targets} ${HDF5_HL_F90_LIBSH_TARGET})
+ add_dependencies(${HDF5_HL_F90_LIBSH_TARGET} H5HLgenSH)
endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
#-----------------------------------------------------------------------------
diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c
index ad79733..7c71da1 100644
--- a/java/src/jni/h5pImp.c
+++ b/java/src/jni/h5pImp.c
@@ -4947,7 +4947,6 @@ H5P_cls_create_cb
jint status = -1;
jclass cls;
jmethodID mid;
- jmethodID constructor;
if(JVMPTR->AttachCurrentThread(JVMPAR2 (void**)&cbenv, NULL) == 0) {
cls = CBENVPTR->GetObjectClass(CBENVPAR create_callback);
@@ -4972,7 +4971,6 @@ H5P_cls_copy_cb
jint status = -1;
jclass cls;
jmethodID mid;
- jmethodID constructor;
if(JVMPTR->AttachCurrentThread(JVMPAR2 (void**)&cbenv, NULL) == 0) {
cls = CBENVPTR->GetObjectClass(CBENVPAR copy_callback);
@@ -4995,7 +4993,6 @@ H5P_cls_close_cb
jint status = -1;
jclass cls;
jmethodID mid;
- jmethodID constructor;
if(JVMPTR->AttachCurrentThread(JVMPAR2 (void**)&cbenv, NULL) == 0) {
cls = CBENVPTR->GetObjectClass(CBENVPAR close_callback);
@@ -5019,7 +5016,6 @@ H5D_append_cb
jclass cls;
jmethodID mid;
jlongArray cur_dimsArray;
- jsize size;
if(JVMPTR->AttachCurrentThread(JVMPAR2 (void**)&cbenv, NULL) != 0) {
JVMPTR->DetachCurrentThread(JVMPAR);
@@ -5135,7 +5131,6 @@ H5P_prp_create_cb
jint status = -1;
jclass cls;
jmethodID mid;
- jmethodID constructor;
jstring str;
if(JVMPTR->AttachCurrentThread(JVMPAR2 (void**)&cbenv, NULL) == 0) {
@@ -5160,7 +5155,6 @@ H5P_prp_copy_cb
jint status = -1;
jclass cls;
jmethodID mid;
- jmethodID constructor;
jstring str;
if(JVMPTR->AttachCurrentThread(JVMPAR2 (void**)&cbenv, NULL) == 0) {
@@ -5185,7 +5179,6 @@ H5P_prp_close_cb
jint status = -1;
jclass cls;
jmethodID mid;
- jmethodID constructor;
jstring str;
if(JVMPTR->AttachCurrentThread(JVMPAR2 (void**)&cbenv, NULL) == 0) {
@@ -5210,7 +5203,6 @@ H5P_prp_compare_cb
jint status = -1;
jclass cls;
jmethodID mid;
- jmethodID constructor;
if(JVMPTR->AttachCurrentThread(JVMPAR2 (void**)&cbenv, NULL) == 0) {
cls = CBENVPTR->GetObjectClass(CBENVPAR compare_callback);
@@ -5233,7 +5225,6 @@ H5P_prp_get_cb
jint status = -1;
jclass cls;
jmethodID mid;
- jmethodID constructor;
jstring str;
if(JVMPTR->AttachCurrentThread(JVMPAR2 (void**)&cbenv, NULL) == 0) {
@@ -5258,7 +5249,6 @@ H5P_prp_set_cb
jint status = -1;
jclass cls;
jmethodID mid;
- jmethodID constructor;
jstring str;
if(JVMPTR->AttachCurrentThread(JVMPAR2 (void**)&cbenv, NULL) == 0) {
@@ -5283,7 +5273,6 @@ H5P_prp_delete_cb
jint status = -1;
jclass cls;
jmethodID mid;
- jmethodID constructor;
jstring str;
if(JVMPTR->AttachCurrentThread(JVMPAR2 (void**)&cbenv, NULL) == 0) {
@@ -5472,7 +5461,6 @@ H5P_iterate_cb
jclass cls;
jmethodID mid;
jstring str;
- jmethodID constructor;
/* fprintf(stderr, "\nJNI H5P_iterate_cb entered\n"); fflush(stderr); */
if(JVMPTR->AttachCurrentThread(JVMPAR2 (void**)&cbenv, NULL) != 0) {
diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c
index acf57c8..0d2999a 100644
--- a/java/src/jni/h5util.c
+++ b/java/src/jni/h5util.c
@@ -181,7 +181,6 @@ h5str_sprintf
char *this_str;
size_t this_strlen;
int n;
- int len;
hvl_t *vlptr;
char *cptr = (char*) ptr;
unsigned char *ucptr = (unsigned char*) ptr;
@@ -522,7 +521,6 @@ h5str_print_region_data_blocks
hsize_t *count = NULL;
hsize_t blkndx;
hsize_t total_size[H5S_MAX_RANK];
- unsigned int region_flags; /* buffer extent flags */
hsize_t numelem;
hsize_t numindex;
size_t jndx;
@@ -622,7 +620,6 @@ h5str_dump_region_blocks_data
hsize_t *ptdata;
hid_t dtype = -1;
hid_t type_id = -1;
- char tmp_str[256];
int ndims = H5Sget_simple_extent_ndims(region);
/*
@@ -634,8 +631,6 @@ h5str_dump_region_blocks_data
/* Print block information */
if (nblocks > 0) {
- int i;
-
alloc_size = (hsize_t)nblocks * (hsize_t)ndims * 2 * (hsize_t)sizeof(ptdata[0]);
if (alloc_size == (hsize_t)((size_t) alloc_size)) {
ptdata = (hsize_t *)HDmalloc((size_t) alloc_size);
@@ -745,13 +740,10 @@ h5str_print_region_data_points
hsize_t *dims1 = NULL;
hsize_t total_size[H5S_MAX_RANK];
size_t jndx;
- unsigned indx;
size_t type_size;
int ret_value = SUCCEED;
- unsigned int region_flags; /* buffer extent flags */
hid_t mem_space = -1;
void *region_buf = NULL;
- char tmp_str[256];
/* Allocate space for the dimension array */
if((dims1 = (hsize_t *)HDmalloc(sizeof(hsize_t) * (size_t)ndims)) != NULL) {
@@ -810,7 +802,6 @@ h5str_dump_region_points_data
hssize_t npoints;
hsize_t alloc_size;
hsize_t *ptdata;
- char tmp_str[256];
hid_t dtype = -1;
hid_t type_id = -1;
int ndims = H5Sget_simple_extent_ndims(region);
@@ -824,8 +815,6 @@ h5str_dump_region_points_data
/* Print point information */
if (npoints > 0) {
- int i;
-
alloc_size = (hsize_t)npoints * (hsize_t)ndims * (hsize_t)sizeof(ptdata[0]);
if (alloc_size == (hsize_t)((size_t) alloc_size)) {
ptdata = (hsize_t *)HDmalloc((size_t) alloc_size);
@@ -1297,7 +1286,7 @@ h5str_render_bin_output
case H5T_ARRAY:
{
int k, ndims;
- hsize_t i, dims[H5S_MAX_RANK], temp_nelmts, nelmts;
+ hsize_t dims[H5S_MAX_RANK], temp_nelmts, nelmts;
hid_t memb;
/* get the array's base datatype for each element */
@@ -1325,7 +1314,6 @@ h5str_render_bin_output
break;
case H5T_VLEN:
{
- unsigned int i;
hsize_t nelmts;
hid_t memb;
@@ -1416,7 +1404,6 @@ render_bin_output_region_data_blocks
hsize_t *start = NULL;
hsize_t *count = NULL;
hsize_t numelem;
- hsize_t numindex;
hsize_t total_size[H5S_MAX_RANK];
int jndx;
size_t type_size;
@@ -1587,7 +1574,6 @@ render_bin_output_region_data_points
hid_t container, int ndims, hid_t type_id, hssize_t npoints, hsize_t *ptdata)
{
hsize_t *dims1 = NULL;
- int jndx;
size_t type_size;
hid_t mem_space = -1;
void *region_buf = NULL;
@@ -1705,7 +1691,6 @@ h5str_dump_simple_dset
int ndims;
int carry; /* counter carry value */
hsize_t zero[8]; /* vector of zeros */
- unsigned int flags; /* buffer extent flags */
hsize_t total_size[H5S_MAX_RANK]; /* total size of dataset*/
/* Print info */
@@ -1862,7 +1847,6 @@ h5tools_dump_simple_data
int line_count;
unsigned char *mem = (unsigned char*)_mem;
size_t size; /* datum size */
- H5T_class_t type_class;
hsize_t i; /*element counter */
h5str_t buffer; /*string into which to render */
diff --git a/tools/h5ls/CMakeTests.cmake b/tools/h5ls/CMakeTests.cmake
index 009ea79..2367df8 100644
--- a/tools/h5ls/CMakeTests.cmake
+++ b/tools/h5ls/CMakeTests.cmake
@@ -258,6 +258,7 @@
tvldtypes2be.out
tvldtypes2be.out.err
)
+ set_tests_properties (H5LS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
if (NOT "${last_test}" STREQUAL "")
set_tests_properties (H5LS-clearall-objects PROPERTIES DEPENDS ${last_test})
endif (NOT "${last_test}" STREQUAL "")
diff --git a/tools/h5ls/CMakeTestsVDS.cmake b/tools/h5ls/CMakeTestsVDS.cmake
index 0d08774..e6c216d 100644
--- a/tools/h5ls/CMakeTestsVDS.cmake
+++ b/tools/h5ls/CMakeTestsVDS.cmake
@@ -73,7 +73,7 @@
add_test (
NAME H5LS-${resultfile}-clear-objects
COMMAND ${CMAKE_COMMAND}
- -E remove ./testfiles/${resultfile}.out ./testfiles/vds/${resultfile}.out.err
+ -E remove ./testfiles/vds/${resultfile}.out ./testfiles/vds/${resultfile}.out.err
)
add_test (
NAME H5LS-${resultfile}
@@ -127,6 +127,7 @@
tvds_layout-5.out
tvds_layout-5.out.err
)
+ set_tests_properties (H5LS_VDS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds")
if (NOT "${last_test}" STREQUAL "")
set_tests_properties (H5LS_VDS-clearall-objects PROPERTIES DEPENDS ${last_test})
endif (NOT "${last_test}" STREQUAL "")