From 04634520cf0ee5ef0b9ef145822083b7b7eced2a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Sep 2016 13:32:01 -0500 Subject: Update CMake java functions --- config/cmake/FindJNI.cmake | 31 +++++-- config/cmake/UseJava.cmake | 175 ++++++++++++++++++++++++++++++++++--- config/cmake_ext_mod/FindMPI.cmake | 59 ++++++++----- 3 files changed, 225 insertions(+), 40 deletions(-) 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/UseJava.cmake b/config/cmake/UseJava.cmake index 9b2b1e0..354cfc1 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 PROPERTY ) # 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 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( # PACKAGES pkg1 [pkg2 ...] # [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) @@ -467,7 +522,7 @@ function(add_jar _TARGET_NAME) endif() foreach (JAVA_INCLUDE_DIR ${CMAKE_JAVA_INCLUDE_PATH}) - set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}") + string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}") endforeach() set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${_add_jar_OUTPUT_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir") @@ -539,7 +594,7 @@ function(add_jar _TARGET_NAME) if (TARGET ${_JAVA_INCLUDE_JAR}) get_target_property(_JAVA_JAR_PATH ${_JAVA_INCLUDE_JAR} JAR_FILE) if (_JAVA_JAR_PATH) - set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_JAR_PATH}") + string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_JAR_PATH}") list(APPEND CMAKE_JAVA_INCLUDE_PATH ${_JAVA_JAR_PATH}) list(APPEND _JAVA_DEPENDS ${_JAVA_INCLUDE_JAR}) list(APPEND _JAVA_COMPILE_DEPENDS ${_JAVA_INCLUDE_JAR}) @@ -547,18 +602,13 @@ function(add_jar _TARGET_NAME) message(SEND_ERROR "add_jar: INCLUDE_JARS target ${_JAVA_INCLUDE_JAR} is not a jar") endif () else () - set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_INCLUDE_JAR}") + string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_INCLUDE_JAR}") list(APPEND CMAKE_JAVA_INCLUDE_PATH "${_JAVA_INCLUDE_JAR}") list(APPEND _JAVA_DEPENDS "${_JAVA_INCLUDE_JAR}") list(APPEND _JAVA_COMPILE_DEPENDS "${_JAVA_INCLUDE_JAR}") 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 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__COMPILER will be set to -# the compiler wrapper for , if it was found. MPI__FOUND +# When configuration is successful, ``MPI__COMPILER`` will be set to +# the compiler wrapper for , if it was found. ``MPI__FOUND`` # and other variables above will be set if any MPI implementation was # found for , 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__XXX equivalents. +# In new projects, please use the ``MPI__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() -- cgit v0.12 From a6bff1b7eb8f4edb9bcc46b28be10d4e06d191a2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Sep 2016 13:32:26 -0500 Subject: Change UPDATE_TYPE to git --- CTestConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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") -- cgit v0.12 From 1963f50928089c0ec4a1ff11d54f652a4ab0a498 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Sep 2016 16:07:08 -0500 Subject: Add option to submit to Cdash --- config/cmake/HDF518_Examples.cmake.in | 8 ++++++++ config/cmake/HDF5_Examples.cmake.in | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in index 561bdb7..2f10c72 100644 --- a/config/cmake/HDF518_Examples.cmake.in +++ b/config/cmake/HDF518_Examples.cmake.in @@ -45,6 +45,11 @@ 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() #TAR_SOURCE - name of tarfile #if(NOT DEFINED TAR_SOURCE) @@ -77,6 +82,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..9bc75a5 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -51,6 +51,11 @@ 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() #TAR_SOURCE - name of tarfile #if(NOT DEFINED TAR_SOURCE) @@ -88,6 +93,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@") ############################################################################################################### -- cgit v0.12 From 6a3551eba007e826968361d3525cfa2b9139e553 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 16 Sep 2016 10:08:36 -0500 Subject: Change string to list - older usage --- config/cmake/UseJava.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/cmake/UseJava.cmake b/config/cmake/UseJava.cmake index 354cfc1..59fb364 100644 --- a/config/cmake/UseJava.cmake +++ b/config/cmake/UseJava.cmake @@ -522,7 +522,7 @@ function(add_jar _TARGET_NAME) endif() foreach (JAVA_INCLUDE_DIR ${CMAKE_JAVA_INCLUDE_PATH}) - string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}") + list(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}") endforeach() set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${_add_jar_OUTPUT_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir") @@ -594,7 +594,7 @@ function(add_jar _TARGET_NAME) if (TARGET ${_JAVA_INCLUDE_JAR}) get_target_property(_JAVA_JAR_PATH ${_JAVA_INCLUDE_JAR} JAR_FILE) if (_JAVA_JAR_PATH) - string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_JAR_PATH}") + list(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_JAR_PATH}") list(APPEND CMAKE_JAVA_INCLUDE_PATH ${_JAVA_JAR_PATH}) list(APPEND _JAVA_DEPENDS ${_JAVA_INCLUDE_JAR}) list(APPEND _JAVA_COMPILE_DEPENDS ${_JAVA_INCLUDE_JAR}) @@ -602,7 +602,7 @@ function(add_jar _TARGET_NAME) message(SEND_ERROR "add_jar: INCLUDE_JARS target ${_JAVA_INCLUDE_JAR} is not a jar") endif () else () - string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_INCLUDE_JAR}") + list(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_INCLUDE_JAR}") list(APPEND CMAKE_JAVA_INCLUDE_PATH "${_JAVA_INCLUDE_JAR}") list(APPEND _JAVA_DEPENDS "${_JAVA_INCLUDE_JAR}") list(APPEND _JAVA_COMPILE_DEPENDS "${_JAVA_INCLUDE_JAR}") -- cgit v0.12 From bea6ab9ea44eab3503e7fc3c6f1e7ea0d7c1557a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 16 Sep 2016 11:23:38 -0500 Subject: Revert to using old set command --- config/cmake/UseJava.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/cmake/UseJava.cmake b/config/cmake/UseJava.cmake index 59fb364..4f8e4c8 100644 --- a/config/cmake/UseJava.cmake +++ b/config/cmake/UseJava.cmake @@ -522,7 +522,7 @@ function(add_jar _TARGET_NAME) endif() foreach (JAVA_INCLUDE_DIR ${CMAKE_JAVA_INCLUDE_PATH}) - list(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}") + set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}") endforeach() set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${_add_jar_OUTPUT_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir") @@ -594,7 +594,7 @@ function(add_jar _TARGET_NAME) if (TARGET ${_JAVA_INCLUDE_JAR}) get_target_property(_JAVA_JAR_PATH ${_JAVA_INCLUDE_JAR} JAR_FILE) if (_JAVA_JAR_PATH) - list(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_JAR_PATH}") + set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_JAR_PATH}") list(APPEND CMAKE_JAVA_INCLUDE_PATH ${_JAVA_JAR_PATH}) list(APPEND _JAVA_DEPENDS ${_JAVA_INCLUDE_JAR}) list(APPEND _JAVA_COMPILE_DEPENDS ${_JAVA_INCLUDE_JAR}) @@ -602,7 +602,7 @@ function(add_jar _TARGET_NAME) message(SEND_ERROR "add_jar: INCLUDE_JARS target ${_JAVA_INCLUDE_JAR} is not a jar") endif () else () - list(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_INCLUDE_JAR}") + set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_INCLUDE_JAR}") list(APPEND CMAKE_JAVA_INCLUDE_PATH "${_JAVA_INCLUDE_JAR}") list(APPEND _JAVA_DEPENDS "${_JAVA_INCLUDE_JAR}") list(APPEND _JAVA_COMPILE_DEPENDS "${_JAVA_INCLUDE_JAR}") -- cgit v0.12 From 8efb84b9a8d287cb9c98adf78549a94e555b02ad Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 16 Sep 2016 15:21:08 -0500 Subject: Separate fortran generation into static and shared folders. --- fortran/src/CMakeLists.txt | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index ea38c58..f123420 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) @@ -187,6 +188,18 @@ 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 + ${f90_F_BASE_SOURCES} + + # generated file + ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 + + # normal distribution + ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.F90 + ) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + set (CMD $) add_custom_target (H5gen ALL @@ -195,9 +208,19 @@ add_custom_target (H5gen ALL WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} DEPENDS ${f90_F_BASE_SOURCES} ) - set_source_files_properties (${f90_F_SOURCES} PROPERTIES LANGUAGE Fortran) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + add_custom_target (H5genSH ALL + COMMAND ${CMD} + #v3.2 BYPRODUCT ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 + WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/shared + DEPENDS ${f90_F_BASE_SOURCES} + ) + set_source_files_properties (${f90_F_SOURCES_SHARED} PROPERTIES LANGUAGE Fortran) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + + #----------------------------------------------------------------------------- # Add Main fortran library #----------------------------------------------------------------------------- @@ -224,7 +247,7 @@ endif (WIN32) set (install_targets ${install_targets} ${HDF5_F90_LIB_TARGET}) 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") -- cgit v0.12 From 3585b373508ca5ea940fbf6e7d0ffeed1968a6bf Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 16 Sep 2016 15:57:28 -0500 Subject: Add default site names --- config/cmake/HDF518_Examples.cmake.in | 7 +++++++ config/cmake/HDF5_Examples.cmake.in | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in index 2f10c72..efabbe6 100644 --- a/config/cmake/HDF518_Examples.cmake.in +++ b/config/cmake/HDF518_Examples.cmake.in @@ -50,6 +50,13 @@ if(NOT DEFINED HDF_LOCAL) 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) diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index 9bc75a5..8ea6d18 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -56,6 +56,13 @@ if(NOT DEFINED HDF_LOCAL) 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) -- cgit v0.12 From c635d463115efdd60bbcd9654644d6b298fd7cd3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 19 Sep 2016 10:20:49 -0500 Subject: Add missing command to set shared generated file --- fortran/src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index f123420..278f814 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -151,8 +151,6 @@ 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 #----------------------------------------------------------------------------- @@ -179,6 +177,7 @@ set (f90_F_BASE_SOURCES ${HDF5_F90_SRC_SOURCE_DIR}/H5Zff.F90 ) +set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5_gen.F90 PROPERTIES GENERATED TRUE) set (f90_F_SOURCES ${f90_F_BASE_SOURCES} @@ -189,6 +188,7 @@ set (f90_F_SOURCES ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.F90 ) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + set_source_files_properties (${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 PROPERTIES GENERATED TRUE) set (f90_F_SOURCES_SHARED ${f90_F_BASE_SOURCES} -- cgit v0.12 From ef2e93d23988b44c663b6df583edecd2e604f009 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 19 Sep 2016 14:04:40 -0500 Subject: Eliminate unreferenced local variable warning --- java/src/jni/h5pImp.c | 12 ------------ java/src/jni/h5util.c | 18 +----------------- 2 files changed, 1 insertion(+), 29 deletions(-) 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 */ -- cgit v0.12 From e9d582a034b68a4b4485e2c71c089d9e52b63d52 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 20 Sep 2016 13:38:47 -0500 Subject: Chage command proces to generate file before use. --- fortran/src/CMakeLists.txt | 57 ++++++++++++++++------------------------------ 1 file changed, 20 insertions(+), 37 deletions(-) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 278f814..4a0928e 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -65,7 +65,6 @@ 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) @@ -154,6 +153,23 @@ endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #----------------------------------------------------------------------------- # Fortran Modules #----------------------------------------------------------------------------- +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 $) +add_custom_command ( + OUTPUT ${HDF5_F90_SRC_BINARY_DIR}/H5_gen.F90 + COMMAND ${CMD} + DEPENDS ${f90_F_GEN_SOURCES} +) +add_custom_target (H5gen ALL +#v3.2 BYPRODUCT ${HDF5_F90_SRC_BINARY_DIR}/H5_gen.F90 + #WORKING_DIRECTORY ${HDF5_F90_SRC_BINARY_DIR} + DEPENDS ${HDF5_F90_SRC_BINARY_DIR}/H5_gen.F90 +) + set (f90_F_BASE_SOURCES # generated files ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 @@ -176,50 +192,17 @@ set (f90_F_BASE_SOURCES ${HDF5_F90_SRC_SOURCE_DIR}/H5Tff.F90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Zff.F90 ) - set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5_gen.F90 PROPERTIES GENERATED TRUE) + set (f90_F_SOURCES ${f90_F_BASE_SOURCES} # generated file - ${HDF5_F90_BINARY_DIR}/H5_gen.F90 + ${HDF5_F90_SRC_BINARY_DIR}/H5_gen.F90 # normal distribution ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.F90 ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - set_source_files_properties (${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 PROPERTIES GENERATED TRUE) - set (f90_F_SOURCES_SHARED - ${f90_F_BASE_SOURCES} - - # generated file - ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 - - # normal distribution - ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.F90 - ) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - - -set (CMD $) -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} -) -set_source_files_properties (${f90_F_SOURCES} PROPERTIES LANGUAGE Fortran) - -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - add_custom_target (H5genSH ALL - COMMAND ${CMD} - #v3.2 BYPRODUCT ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 - WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/shared - DEPENDS ${f90_F_BASE_SOURCES} - ) - set_source_files_properties (${f90_F_SOURCES_SHARED} PROPERTIES LANGUAGE Fortran) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - #----------------------------------------------------------------------------- # Add Main fortran library @@ -247,7 +230,7 @@ endif (WIN32) set (install_targets ${install_targets} ${HDF5_F90_LIB_TARGET}) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - add_library (${HDF5_F90_LIBSH_TARGET} SHARED ${f90_F_SOURCES_SHARED}) + add_library (${HDF5_F90_LIBSH_TARGET} SHARED ${f90_F_SOURCES}) set (SHARED_LINK_FLAGS " ") if (WIN32 AND MSVC) set (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def") -- cgit v0.12 From 55fa38f3c9f63953caa25f769fda57dd1ee891b1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 20 Sep 2016 15:27:26 -0500 Subject: Update generated files commands and properties --- fortran/src/CMakeLists.txt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 4a0928e..e346a54 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -92,6 +92,7 @@ add_custom_command ( WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} DEPENDS H5match_types ) +set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 PROPERTIES GENERATED TRUE) #----------------------------------------------------------------------------- # f90CStub lib @@ -114,7 +115,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 @@ -163,17 +163,14 @@ add_custom_command ( OUTPUT ${HDF5_F90_SRC_BINARY_DIR}/H5_gen.F90 COMMAND ${CMD} DEPENDS ${f90_F_GEN_SOURCES} + COMMENT "Generating H5_gen.F90" ) add_custom_target (H5gen ALL -#v3.2 BYPRODUCT ${HDF5_F90_SRC_BINARY_DIR}/H5_gen.F90 - #WORKING_DIRECTORY ${HDF5_F90_SRC_BINARY_DIR} DEPENDS ${HDF5_F90_SRC_BINARY_DIR}/H5_gen.F90 ) +set_source_files_properties (${HDF5_F90_SRC_BINARY_DIR}/H5_gen.F90 PROPERTIES GENERATED TRUE) set (f90_F_BASE_SOURCES - # generated files - ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 - # normal distribution ${HDF5_F90_SRC_SOURCE_DIR}/H5f90global.F90 ${HDF5_F90_SRC_SOURCE_DIR}/H5fortkit.F90 @@ -192,9 +189,11 @@ set (f90_F_BASE_SOURCES ${HDF5_F90_SRC_SOURCE_DIR}/H5Tff.F90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Zff.F90 ) -set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5_gen.F90 PROPERTIES GENERATED TRUE) set (f90_F_SOURCES + # generated file + ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 + ${f90_F_BASE_SOURCES} # generated file -- cgit v0.12 From 347501aba2962691988e73ddb1b384397e507a80 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 20 Sep 2016 15:41:07 -0500 Subject: Add another source property --- fortran/src/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index e346a54..e237ec6 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -92,6 +92,7 @@ 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) #----------------------------------------------------------------------------- -- cgit v0.12 From a3bd6e7aa4d9206004d16ea40aa95178392f2446 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 20 Sep 2016 16:57:42 -0500 Subject: Add target depends require separate folders --- fortran/src/CMakeLists.txt | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index e237ec6..527f71f 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) @@ -161,15 +162,29 @@ set (f90_F_GEN_SOURCES ) set (CMD $) add_custom_command ( - OUTPUT ${HDF5_F90_SRC_BINARY_DIR}/H5_gen.F90 + OUTPUT ${HDF5_F90_BINARY_DIR}/H5_gen.F90 COMMAND ${CMD} DEPENDS ${f90_F_GEN_SOURCES} - COMMENT "Generating H5_gen.F90" + COMMENT "Generating the H5_gen.F90 file" ) add_custom_target (H5gen ALL - DEPENDS ${HDF5_F90_SRC_BINARY_DIR}/H5_gen.F90 + DEPENDS ${HDF5_F90_BINARY_DIR}/H5_gen.F90 ) -set_source_files_properties (${HDF5_F90_SRC_BINARY_DIR}/H5_gen.F90 PROPERTIES GENERATED TRUE) +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 $) + add_custom_command ( + OUTPUT ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 + COMMAND ${CMDSH} + 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 @@ -198,11 +213,25 @@ set (f90_F_SOURCES ${f90_F_BASE_SOURCES} # generated file - ${HDF5_F90_SRC_BINARY_DIR}/H5_gen.F90 + ${HDF5_F90_BINARY_DIR}/H5_gen.F90 # 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 + + ${f90_F_BASE_SOURCES} + + # generated file + ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 + + # normal distribution + ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.F90 + ) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #----------------------------------------------------------------------------- # Add Main fortran library @@ -228,9 +257,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") @@ -256,6 +286,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) #----------------------------------------------------------------------------- -- cgit v0.12 From 60adc706e6c8bdee4a2e9a7c211f2f2a12dfc355 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 20 Sep 2016 17:03:40 -0500 Subject: Add WORKING_DIR to command --- fortran/src/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 527f71f..d4ca791 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -164,6 +164,7 @@ set (CMD $) 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" ) @@ -177,6 +178,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) 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" ) -- cgit v0.12 From e219ee88e42c09ab75e97a04a1b42d0b1410e721 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 21 Sep 2016 10:46:03 -0500 Subject: Add gen file technique to HL and test fortran libraries --- fortran/test/CMakeLists.txt | 71 +++++++++++++++++++++++++++++++------------ hl/fortran/src/CMakeLists.txt | 64 ++++++++++++++++++++++++++++---------- 2 files changed, 100 insertions(+), 35 deletions(-) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index d1ca6e8..fd6dd28 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 $) -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 $) + 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} @@ -118,6 +149,7 @@ if (WIN32) ) endif (WIN32) 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") @@ -326,7 +358,8 @@ 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) + endif (WIN32 AND MSVC)endif (NOT SKIP_HDF5_FORTRAN_SHARED) + 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..82db6fe 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 $) +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 $) + 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 (H5HLgen 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 $) -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 " " " ") @@ -155,7 +187,7 @@ endif (WIN32) set (install_targets ${install_targets} ${HDF5_HL_F90_LIB_TARGET}) 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") -- cgit v0.12 From 408aaba9022e427113db3fcca2c54e2fb6564d7f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 21 Sep 2016 10:48:12 -0500 Subject: Add missing SH to target name --- hl/fortran/src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 82db6fe..ead8aec 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -138,7 +138,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES} COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 shared files" ) - add_custom_target (H5HLgen ALL + 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 ( -- cgit v0.12 From bc1d833a80190a83bb11151f2d60035acdae3d2c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 21 Sep 2016 10:49:48 -0500 Subject: Fix typo --- fortran/test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index fd6dd28..baf7369 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -358,7 +358,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)endif (NOT SKIP_HDF5_FORTRAN_SHARED) + 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 -- cgit v0.12 From a25cf226632b039d8f97839bb160f229fd7d5286 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 21 Sep 2016 12:12:37 -0500 Subject: Correct clear objects working dir --- tools/h5ls/CMakeTests.cmake | 1 + tools/h5ls/CMakeTestsVDS.cmake | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) 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 "") -- cgit v0.12 From 583af563d9f7eb8cedba6a8bb12d3218f55addf6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 21 Sep 2016 12:22:16 -0500 Subject: Add missing target depends command --- fortran/test/CMakeLists.txt | 3 +++ hl/fortran/src/CMakeLists.txt | 2 ++ 2 files changed, 5 insertions(+) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index baf7369..219f937 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -148,6 +148,8 @@ 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 " ") @@ -175,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) #----------------------------------------------------------------------------- diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index ead8aec..774aa7c 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -185,6 +185,7 @@ 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_SHARED}) @@ -209,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) #----------------------------------------------------------------------------- -- cgit v0.12