[med-svn] [Git][med-team/vbz-compression][upstream] New upstream version 1.0.1

Nilesh Patra (@nilesh) gitlab at salsa.debian.org
Sat May 22 15:50:00 BST 2021



Nilesh Patra pushed to branch upstream at Debian Med / vbz-compression


Commits:
0ab35a67 by Nilesh Patra at 2021-05-22T19:23:35+05:30
New upstream version 1.0.1
- - - - -


20 changed files:

- CMakeLists.txt
- + LICENCE.txt
- README.md
- − cmake/FindHDF5.cmake
- + cmake/SignFile.cmake
- + cmake/SigningUtils.cmake
- cmake/conan.cmake
- − conanfile.txt
- − license.txt
- packaging/hdf_plugin_packaging.cmake
- + python/fast5compress/fast5vbz.py
- python/pyvbz/setup.py
- python/test/test_vbz_filter.py
- vbz/v0/vbz_streamvbyte_impl_sse3.h
- vbz_plugin/CMakeLists.txt
- vbz_plugin/hdf_test_utils/CMakeLists.txt
- vbz_plugin/perf/CMakeLists.txt
- vbz_plugin/test/CMakeLists.txt
- vbz_plugin/vbz_plugin.cpp
- vbz_plugin/vbz_plugin_user_utils.h


Changes:

=====================================
CMakeLists.txt
=====================================
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.11.0)
 
 execute_process(
   COMMAND git describe --tags
-  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+  WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
   OUTPUT_VARIABLE GIT_VERSION
   OUTPUT_STRIP_TRAILING_WHITESPACE
 )
@@ -13,14 +13,18 @@ set(GIT_VERSION "${CMAKE_MATCH_1}")
 message(STATUS "Building version ${GIT_VERSION}")
 project(hdf_plugins
     VERSION ${GIT_VERSION}
-    LANGUAGES CXX
+    LANGUAGES CXX C
 )
 
 set(CMAKE_POSITION_INDEPENDENT_CODE ON)
 
 include(ExternalProject)
 include(GenerateExportHeader)
-include(CTest)
+# If we're including hdf_plugins as a subdir then we might not be able
+# to override BUILD_TESTING from CTest's default ON value.
+if (NOT DEFINED BUILD_TESTING OR BUILD_TESTING)
+    include(CTest)
+endif()
 
 if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
     message(STATUS "No CMAKE_BUILD_TYPE set - defaulting to Debug")
@@ -31,6 +35,7 @@ if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
     set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "${_bt_docstring}" FORCE)
 endif()
 
+set(HDF_PLUGIN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
 set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
 
 if (NOT DEFINED VBZ_BUILD_ARCHIVE)
@@ -53,6 +58,17 @@ if (NOT DEFINED ENABLE_CONAN)
     option(ENABLE_CONAN "Enable conan for dependency installation" ON)
 endif()
 
+if (NOT DEFINED STANDARD_LIB_INSTALL)
+    set(STD_LIB_INSTALL_DEFAULT OFF)
+    if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_DIR)
+        set(STD_LIB_INSTALL_DEFAULT ON)
+    endif()
+    option(STANDARD_LIB_INSTALL
+        "Install library to standard lib / bin paths"
+        ${STD_LIB_INSTALL_DEFAULT}
+        )
+endif()
+
 if (NOT VBZ_BUILD_ARCHIVE)
     set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
     set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
@@ -70,8 +86,21 @@ if (ENABLE_CONAN)
     else()
         include(conan)
 
+        set(_requirements
+            "zstd/1.3.4 at nanopore/stable")
+        set(_generators
+            cmake
+            json)
+        set(_imports
+            "bin, *.dll -> ../bin"
+            "lib, *.dylib* -> ../bin")
         set(_extra_args)
 
+        if (ENABLE_PERF_TESTING)
+            list(APPEND _requirements
+                "google-benchmark/1.5 at nanopore/stable"
+                )
+        endif()
         if (CMAKE_BUILD_TYPE)
             set(_build_type_DEBUG Debug)
             set(_build_type_RELEASE Release)
@@ -82,8 +111,18 @@ if (ENABLE_CONAN)
                 list(APPEND _extra_args BUILD_TYPE "${_build_type_${_build_type}}")
             endif()
         endif()
+        if (CONAN_EXTRA_SETTINGS)
+            list(APPEND _extra_args
+                SETTINGS
+                ${CONAN_EXTRA_SETTINGS}
+                )
+        endif()
 
-        conan_cmake_run(CONANFILE conanfile.txt ${_extra_args})
+        conan_cmake_run(
+            GENERATORS ${_generators}
+            REQUIRES ${_requirements}
+            IMPORTS ${_imports}
+            ${_extra_args})
     endif()
     conan_check_compiler()
     conan_define_targets()
@@ -94,10 +133,10 @@ if (ENABLE_PACKAGING)
     include(packaging/hdf_plugin_packaging.cmake)
 endif()
 
-include_directories("${CMAKE_SOURCE_DIR}/third_party")
+include_directories("${CMAKE_CURRENT_SOURCE_DIR}/third_party")
 
 find_package(HDF5 1.8.16)
-find_package(zstd 1.3.3 REQUIRED)
+find_package(zstd 1.3.1 REQUIRED)
 find_package(Sanitizers)
 
 get_filename_component(STREAMVBYTE_SOURCE_DIR
@@ -117,7 +156,7 @@ ExternalProject_Add(
     SOURCE_DIR ${STREAMVBYTE_SOURCE_DIR}
     UPDATE_DISCONNECTED TRUE
     PREFIX ${STREAMVBYTE_PREFIX}
-    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${STREAMVBYTE_INSTALL_DIR} -DSTREAMVBYTE_DISABLE_NATIVE=ON
+    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${STREAMVBYTE_INSTALL_DIR} -DSTREAMVBYTE_DISABLE_NATIVE=ON -DSTD_FLAGS="-std=c99"
     # We need to tell CMake about libraries we will link to, otherwise some generators (eg: Ninja)
     # complain about how knowing how to build libstreamvbyte_static.a, for example.
     # Ideally, we'd set a hypothetical INSTALL_BYPRODUCTS, and link to the installed file, but that
@@ -199,6 +238,8 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # AppleClang and Clang
         )
 endif()
 
+include(SigningUtils)
+
 if (ENABLE_PYTHON)
     add_subdirectory(python)
 endif()


=====================================
LICENCE.txt
=====================================
@@ -0,0 +1,374 @@
+Mozilla Public License Version 2.0
+==================================
+
+1. Definitions
+--------------
+
+1.1. "Contributor"
+    means each individual or legal entity that creates, contributes to
+    the creation of, or owns Covered Software.
+
+1.2. "Contributor Version"
+    means the combination of the Contributions of others (if any) used
+    by a Contributor and that particular Contributor's Contribution.
+
+1.3. "Contribution"
+    means Covered Software of a particular Contributor.
+
+1.4. "Covered Software"
+    means Source Code Form to which the initial Contributor has attached
+    the notice in Exhibit A, the Executable Form of such Source Code
+    Form, and Modifications of such Source Code Form, in each case
+    including portions thereof.
+
+1.5. "Incompatible With Secondary Licenses"
+    means
+
+    (a) that the initial Contributor has attached the notice described
+        in Exhibit B to the Covered Software; or
+
+    (b) that the Covered Software was made available under the terms of
+        version 1.1 or earlier of the License, but not also under the
+        terms of a Secondary License.
+
+1.6. "Executable Form"
+    means any form of the work other than Source Code Form.
+
+1.7. "Larger Work"
+    means a work that combines Covered Software with other material, in
+    a separate file or files, that is not Covered Software.
+
+1.8. "License"
+    means this document.
+
+1.9. "Licensable"
+    means having the right to grant, to the maximum extent possible,
+    whether at the time of the initial grant or subsequently, any and
+    all of the rights conveyed by this License.
+
+1.10. "Modifications"
+    means any of the following:
+
+    (a) any file in Source Code Form that results from an addition to,
+        deletion from, or modification of the contents of Covered
+        Software; or
+
+    (b) any new file in Source Code Form that contains any Covered
+        Software.
+
+1.11. "Patent Claims" of a Contributor
+    means any patent claim(s), including without limitation, method,
+    process, and apparatus claims, in any patent Licensable by such
+    Contributor that would be infringed, but for the grant of the
+    License, by the making, using, selling, offering for sale, having
+    made, import, or transfer of either its Contributions or its
+    Contributor Version.
+
+1.12. "Secondary License"
+    means either the GNU General Public License, Version 2.0, the GNU
+    Lesser General Public License, Version 2.1, the GNU Affero General
+    Public License, Version 3.0, or any later versions of those
+    licenses.
+
+1.13. "Source Code Form"
+    means the form of the work preferred for making modifications.
+
+1.14. "You" (or "Your")
+    means an individual or a legal entity exercising rights under this
+    License. For legal entities, "You" includes any entity that
+    controls, is controlled by, or is under common control with You. For
+    purposes of this definition, "control" means (a) the power, direct
+    or indirect, to cause the direction or management of such entity,
+    whether by contract or otherwise, or (b) ownership of more than
+    fifty percent (50%) of the outstanding shares or beneficial
+    ownership of such entity.
+
+2. License Grants and Conditions
+--------------------------------
+
+2.1. Grants
+
+Each Contributor hereby grants You a world-wide, royalty-free,
+non-exclusive license:
+
+(a) under intellectual property rights (other than patent or trademark)
+    Licensable by such Contributor to use, reproduce, make available,
+    modify, display, perform, distribute, and otherwise exploit its
+    Contributions, either on an unmodified basis, with Modifications, or
+    as part of a Larger Work; and
+
+(b) under Patent Claims of such Contributor to make, use, sell, offer
+    for sale, have made, import, and otherwise transfer either its
+    Contributions or its Contributor Version.
+
+2.2. Effective Date
+
+The licenses granted in Section 2.1 with respect to any Contribution
+become effective for each Contribution on the date the Contributor first
+distributes such Contribution.
+
+2.3. Limitations on Grant Scope
+
+The licenses granted in this Section 2 are the only rights granted under
+this License. No additional rights or licenses will be implied from the
+distribution or licensing of Covered Software under this License.
+Notwithstanding Section 2.1(b) above, no patent license is granted by a
+Contributor:
+
+(a) for any code that a Contributor has removed from Covered Software;
+    or
+
+(b) for infringements caused by: (i) Your and any other third party's
+    modifications of Covered Software, or (ii) the combination of its
+    Contributions with other software (except as part of its Contributor
+    Version); or
+
+(c) under Patent Claims infringed by Covered Software in the absence of
+    its Contributions.
+
+This License does not grant any rights in the trademarks, service marks,
+or logos of any Contributor (except as may be necessary to comply with
+the notice requirements in Section 3.4).
+
+2.4. Subsequent Licenses
+
+No Contributor makes additional grants as a result of Your choice to
+distribute the Covered Software under a subsequent version of this
+License (see Section 10.2) or under the terms of a Secondary License (if
+permitted under the terms of Section 3.3).
+
+2.5. Representation
+
+Each Contributor represents that the Contributor believes its
+Contributions are its original creation(s) or it has sufficient rights
+to grant the rights to its Contributions conveyed by this License.
+
+2.6. Fair Use
+
+This License is not intended to limit any rights You have under
+applicable copyright doctrines of fair use, fair dealing, or other
+equivalents.
+
+2.7. Conditions
+
+Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
+in Section 2.1.
+
+3. Responsibilities
+-------------------
+
+3.1. Distribution of Source Form
+
+All distribution of Covered Software in Source Code Form, including any
+Modifications that You create or to which You contribute, must be under
+the terms of this License. You must inform recipients that the Source
+Code Form of the Covered Software is governed by the terms of this
+License, and how they can obtain a copy of this License. You may not
+attempt to alter or restrict the recipients' rights in the Source Code
+Form.
+
+3.2. Distribution of Executable Form
+
+If You distribute Covered Software in Executable Form then:
+
+(a) such Covered Software must also be made available in Source Code
+    Form, as described in Section 3.1, and You must inform recipients of
+    the Executable Form how they can obtain a copy of such Source Code
+    Form by reasonable means in a timely manner, at a charge no more
+    than the cost of distribution to the recipient; and
+
+(b) You may distribute such Executable Form under the terms of this
+    License, or sublicense it under different terms, provided that the
+    license for the Executable Form does not attempt to limit or alter
+    the recipients' rights in the Source Code Form under this License.
+
+3.3. Distribution of a Larger Work
+
+You may create and distribute a Larger Work under terms of Your choice,
+provided that You also comply with the requirements of this License for
+the Covered Software. If the Larger Work is a combination of Covered
+Software with a work governed by one or more Secondary Licenses, and the
+Covered Software is not Incompatible With Secondary Licenses, this
+License permits You to additionally distribute such Covered Software
+under the terms of such Secondary License(s), so that the recipient of
+the Larger Work may, at their option, further distribute the Covered
+Software under the terms of either this License or such Secondary
+License(s).
+
+3.4. Notices
+
+You may not remove or alter the substance of any license notices
+(including copyright notices, patent notices, disclaimers of warranty,
+or limitations of liability) contained within the Source Code Form of
+the Covered Software, except that You may alter any license notices to
+the extent required to remedy known factual inaccuracies.
+
+3.5. Application of Additional Terms
+
+You may choose to offer, and to charge a fee for, warranty, support,
+indemnity or liability obligations to one or more recipients of Covered
+Software. However, You may do so only on Your own behalf, and not on
+behalf of any Contributor. You must make it absolutely clear that any
+such warranty, support, indemnity, or liability obligation is offered by
+You alone, and You hereby agree to indemnify every Contributor for any
+liability incurred by such Contributor as a result of warranty, support,
+indemnity or liability terms You offer. You may include additional
+disclaimers of warranty and limitations of liability specific to any
+jurisdiction.
+
+4. Inability to Comply Due to Statute or Regulation
+---------------------------------------------------
+
+If it is impossible for You to comply with any of the terms of this
+License with respect to some or all of the Covered Software due to
+statute, judicial order, or regulation then You must: (a) comply with
+the terms of this License to the maximum extent possible; and (b)
+describe the limitations and the code they affect. Such description must
+be placed in a text file included with all distributions of the Covered
+Software under this License. Except to the extent prohibited by statute
+or regulation, such description must be sufficiently detailed for a
+recipient of ordinary skill to be able to understand it.
+
+5. Termination
+--------------
+
+5.1. The rights granted under this License will terminate automatically
+if You fail to comply with any of its terms. However, if You become
+compliant, then the rights granted under this License from a particular
+Contributor are reinstated (a) provisionally, unless and until such
+Contributor explicitly and finally terminates Your grants, and (b) on an
+ongoing basis, if such Contributor fails to notify You of the
+non-compliance by some reasonable means prior to 60 days after You have
+come back into compliance. Moreover, Your grants from a particular
+Contributor are reinstated on an ongoing basis if such Contributor
+notifies You of the non-compliance by some reasonable means, this is the
+first time You have received notice of non-compliance with this License
+from such Contributor, and You become compliant prior to 30 days after
+Your receipt of the notice.
+
+5.2. If You initiate litigation against any entity by asserting a patent
+infringement claim (excluding declaratory judgment actions,
+counter-claims, and cross-claims) alleging that a Contributor Version
+directly or indirectly infringes any patent, then the rights granted to
+You by any and all Contributors for the Covered Software under Section
+2.1 of this License shall terminate.
+
+5.3. In the event of termination under Sections 5.1 or 5.2 above, all
+end user license agreements (excluding distributors and resellers) which
+have been validly granted by You or Your distributors under this License
+prior to termination shall survive termination.
+
+************************************************************************
+*                                                                      *
+*  6. Disclaimer of Warranty                                           *
+*  -------------------------                                           *
+*                                                                      *
+*  Covered Software is provided under this License on an "as is"       *
+*  basis, without warranty of any kind, either expressed, implied, or  *
+*  statutory, including, without limitation, warranties that the       *
+*  Covered Software is free of defects, merchantable, fit for a        *
+*  particular purpose or non-infringing. The entire risk as to the     *
+*  quality and performance of the Covered Software is with You.        *
+*  Should any Covered Software prove defective in any respect, You     *
+*  (not any Contributor) assume the cost of any necessary servicing,   *
+*  repair, or correction. This disclaimer of warranty constitutes an   *
+*  essential part of this License. No use of any Covered Software is   *
+*  authorized under this License except under this disclaimer.         *
+*                                                                      *
+************************************************************************
+
+************************************************************************
+*                                                                      *
+*  7. Limitation of Liability                                          *
+*  --------------------------                                          *
+*                                                                      *
+*  Under no circumstances and under no legal theory, whether tort      *
+*  (including negligence), contract, or otherwise, shall any           *
+*  Contributor, or anyone who distributes Covered Software as          *
+*  permitted above, be liable to You for any direct, indirect,         *
+*  special, incidental, or consequential damages of any character      *
+*  including, without limitation, damages for lost profits, loss of    *
+*  goodwill, work stoppage, computer failure or malfunction, or any    *
+*  and all other commercial damages or losses, even if such party      *
+*  shall have been informed of the possibility of such damages. This   *
+*  limitation of liability shall not apply to liability for death or   *
+*  personal injury resulting from such party's negligence to the       *
+*  extent applicable law prohibits such limitation. Some               *
+*  jurisdictions do not allow the exclusion or limitation of           *
+*  incidental or consequential damages, so this exclusion and          *
+*  limitation may not apply to You.                                    *
+*                                                                      *
+************************************************************************
+
+8. Litigation
+-------------
+
+Any litigation relating to this License may be brought only in the
+courts of a jurisdiction where the defendant maintains its principal
+place of business and such litigation shall be governed by laws of that
+jurisdiction, without reference to its conflict-of-law provisions.
+Nothing in this Section shall prevent a party's ability to bring
+cross-claims or counter-claims.
+
+9. Miscellaneous
+----------------
+
+This License represents the complete agreement concerning the subject
+matter hereof. If any provision of this License is held to be
+unenforceable, such provision shall be reformed only to the extent
+necessary to make it enforceable. Any law or regulation which provides
+that the language of a contract shall be construed against the drafter
+shall not be used to construe this License against a Contributor.
+
+10. Versions of the License
+---------------------------
+
+10.1. New Versions
+
+Mozilla Foundation is the license steward. Except as provided in Section
+10.3, no one other than the license steward has the right to modify or
+publish new versions of this License. Each version will be given a
+distinguishing version number.
+
+10.2. Effect of New Versions
+
+You may distribute the Covered Software under the terms of the version
+of the License under which You originally received the Covered Software,
+or under the terms of any subsequent version published by the license
+steward.
+
+10.3. Modified Versions
+
+If you create software not governed by this License, and you want to
+create a new license for such software, you may create and use a
+modified version of this License if you rename the license and remove
+any references to the name of the license steward (except to note that
+such modified license differs from this License).
+
+10.4. Distributing Source Code Form that is Incompatible With Secondary
+Licenses
+
+If You choose to distribute Source Code Form that is Incompatible With
+Secondary Licenses under the terms of this version of the License, the
+notice described in Exhibit B of this License must be attached.
+
+Exhibit A - Source Code Form License Notice
+-------------------------------------------
+
+  This Source Code Form is subject to the terms of the Mozilla Public
+  License, v. 2.0. If a copy of the MPL was not distributed with this
+  file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+If it is not possible or desirable to put the notice in a particular
+file, then You may include the notice in a location (such as a LICENSE
+file in a relevant directory) where a recipient would be likely to look
+for such a notice.
+
+You may add additional accurate notices of copyright ownership.
+
+Exhibit B - "Incompatible With Secondary Licenses" Notice
+---------------------------------------------------------
+
+  This Source Code Form is "Incompatible With Secondary Licenses", as
+  defined by the Mozilla Public License, v. 2.0.
+


=====================================
README.md
=====================================
@@ -72,6 +72,6 @@ Then configure the project using:
 > git submodule update --init
 > mkdir build
 > cd build
-> cmake -D ENABLE_CONAN=OFF ..
+> cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_CONAN=OFF -D ENABLE_PERF_TESTING=OFF -D ENABLE_PYTHON=OFF ..
 > make -j
-```
\ No newline at end of file
+```


=====================================
cmake/FindHDF5.cmake deleted
=====================================
@@ -1,88 +0,0 @@
-include(ONTFindModuleHelpers)
-
-set(HDF5_known_components
-    Z
-    C
-    CXX
-    HL
-    HL_CXX
-    Tools
-)
-foreach(_comp ${HDF5_known_components})
-    set(HDF5_${_comp}_compile_opts "-DH5_BUILT_AS_DYNAMIC_LIB=1")
-endforeach()
-
-set(HDF5_Z_compile_opts "")
-set(HDF5_Z_lib_names_debug "zlibd;zd")
-set(HDF5_Z_lib_names_release "zlib;z")
-set(HDF5_Z_component_deps)
-
-set(HDF5_C_lib_names_release "hdf5")
-set(HDF5_C_header_names "hdf5.h")
-set(HDF5_C_component_deps Z)
-
-set(HDF5_CXX_lib_names_release "hdf5_cpp")
-set(HDF5_CXX_header_names "H5Cpp.h")
-set(HDF5_CXX_component_deps C)
-
-set(HDF5_HL_lib_names_release "hdf5_hl")
-set(HDF5_HL_header_names "hdf5_hl.h")
-set(HDF5_HL_component_deps C)
-
-set(HDF5_HL_CXX_lib_names_release "hdf5_hl_cpp")
-set(HDF5_HL_CXX_header_names "H5PacketTable.h")
-set(HDF5_HL_CXX_component_deps HL CXX)
-
-set(HDF5_Tools_lib_names_release "hdf5_tools")
-set(HDF5_Tools_header_names "h5tools.h")
-set(HDF5_Tools_component_deps C)
-
-foreach(_comp ${HDF5_known_components})
-    if(NOT _comp STREQUAL "Z")
-        set(HDF5_${_comp}_lib_names_debug)
-        foreach(_name ${HDF5_${_comp}_lib_names_release})
-            list(APPEND HDF5_${_comp}_lib_names_debug "${_name}_D")
-        endforeach()
-    endif()
-endforeach()
-
-ont_find_package_parse_components(HDF5
-    RESULT_VAR HDF5_components
-    KNOWN_COMPONENTS ${HDF5_known_components}
-)
-ont_find_package_handle_library_components(HDF5
-    COMPONENTS ${HDF5_components}
-    DEBUG_AND_RELEASE
-    SKIP_PKG_CONFIG
-)
-
-find_path(HDF5_INCLUDE_DIR
-    NAMES H5public.h
-    HINTS ${PKG_HDF5_C_INCLUDE_DIRS} 
-)
-mark_as_advanced(HDF5_INCLUDE_DIR)
-if(HDF5_INCLUDE_DIR AND EXISTS "${HDF5_INCLUDE_DIR}/H5public.h")
-    set(HDF5_PUBLIC_HEADER "${HDF5_INCLUDE_DIR}/H5public.h")
-    file(STRINGS ${HDF5_PUBLIC_HEADER} _hdf5_version_lines
-        REGEX "^#define[ \t]+H5_VERS")
-    string(REGEX MATCH "H5_VERS_MAJOR[\t ]+([0-9]+)" _dummy ${_hdf5_version_lines})
-    set(_hdf5_version_major "${CMAKE_MATCH_1}")
-    string(REGEX MATCH "H5_VERS_MINOR[\t ]+([0-9]+)" _dummy ${_hdf5_version_lines})
-    set(_hdf5_version_minor "${CMAKE_MATCH_1}")
-    string(REGEX MATCH "H5_VERS_RELEASE[\t ]+([0-9]+)" _dummy ${_hdf5_version_lines})
-    set(_hdf5_version_release "${CMAKE_MATCH_1}")
-    unset(_hdf5_version_lines)
-    set(HDF5_VERSION "${_hdf5_version_major}.${_hdf5_version_minor}.${_hdf5_version_release}")
-endif()
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(HDF5
-    FOUND_VAR
-        HDF5_FOUND
-    REQUIRED_VARS
-        HDF5_LIBRARIES
-        HDF5_INCLUDE_DIR
-    VERSION_VAR
-        HDF5_VERSION
-    HANDLE_COMPONENTS
-)


=====================================
cmake/SignFile.cmake
=====================================
@@ -0,0 +1,47 @@
+set(file_to_sign ${CMAKE_ARGV3})
+
+# Pull from command line by default - otherwise require an environment variable.
+if (NOT MINKNOW_CODE_SIGN_IDENTITY)
+    if ("$ENV{MINKNOW_CODE_SIGN_IDENTITY}" STREQUAL "")
+        message(FATAL_ERROR "Caller must specify code sign identiyy in environment variable 'MINKNOW_CODE_SIGN_IDENTITY'")
+    endif()
+
+    set(MINKNOW_CODE_SIGN_IDENTITY "$ENV{MINKNOW_CODE_SIGN_IDENTITY}")
+endif()
+
+if (APPLE)
+    message("Signing file... ${file_to_sign}${keychain_comment}")
+    set(SIGN_COMMAND 
+        codesign -s ${MINKNOW_CODE_SIGN_IDENTITY} ${keychain_arg} --force --deep -vvvv ${file_to_sign})
+elseif(WIN32)
+    find_program(
+        SIGNTOOL_EXE "Signtool.exe"
+        PATHS "C:\\Program Files (x86)\\Windows Kits\\10\\App Certification Kit")
+
+    if (NOT SIGNTOOL_EXE)
+        message(FATAL_ERROR "Failed to find signtool executable")
+    endif()
+
+    message("Signing file... ${file_to_sign}${comment}")
+    set(SIGN_COMMAND ${SIGNTOOL_EXE} sign "/v" "/sha1" "${MINKNOW_CODE_SIGN_IDENTITY}"
+        "/t" "http://timestamp.globalsign.com/scripts/"
+        ${file_to_sign}
+    )
+
+else()
+    message(FATAL_ERROR "Cannot sign code on this platform.")
+endif()
+
+message("Running sign command: ${SIGN_COMMAND}")
+execute_process(
+    COMMAND ${SIGN_COMMAND}
+    RESULT_VARIABLE result
+    OUTPUT_VARIABLE output
+    ERROR_VARIABLE output
+)
+
+if (NOT result EQUAL 0)
+    message(FATAL_ERROR "Could not sign file: ${result}: ${output}")
+else()
+    message("Signed file: ${output}")
+endif()
\ No newline at end of file


=====================================
cmake/SigningUtils.cmake
=====================================
@@ -0,0 +1,25 @@
+function(hdf_add_signing_command target)
+    set(options)
+    set(oneValArgs FILE)
+    set(multiValArgs)
+    cmake_parse_arguments(ARG "${options}" "${oneValArgs}" "${multiValArgs}" ${ARGN})
+
+    if (ARG_UNPARSED_ARGUMENTS)
+        message(FATAL_ERROR "Unexpected arguments to hdf_add_signing_command: ${ARG_UNPARSED_ARGUMENTS}")
+    endif()
+
+    if (NOT APPLE AND NOT WIN32)
+        message(FATAL_ERROR "hdf_add_signing_command called on unsupported platform - platform=${CMAKE_SYSTEM_NAME}, target=${target}")
+    endif()
+
+    if (NOT ARG_FILE)
+        set(ARG_FILE $<TARGET_FILE:${target}>)
+    endif()
+
+    add_custom_command(
+        TARGET ${target}
+        POST_BUILD
+            COMMAND ${CMAKE_COMMAND} -P ${HDF_PLUGIN_SOURCE_DIR}/cmake/SignFile.cmake ${ARG_FILE}
+            COMMENT "Signing ${target}"
+    )
+endfunction()


=====================================
cmake/conan.cmake
=====================================
@@ -195,6 +195,19 @@ function(conan_cmake_settings result)
         elseif(CMAKE_VS_PLATFORM_TOOLSET AND (CMAKE_GENERATOR STREQUAL "Ninja"))
             set(_SETTINGS ${_SETTINGS} -s compiler.toolset=${CMAKE_VS_PLATFORM_TOOLSET})
         endif()
+    # Temp fix due to https://github.com/conan-io/cmake-conan/issues/166
+    elseif (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL Intel)
+        string(REPLACE "." ";" VERSION_LIST ${CMAKE_${LANGUAGE}_COMPILER_VERSION})
+        list(GET VERSION_LIST 0 MAJOR)
+        list(GET VERSION_LIST 1 MINOR)
+        set(COMPILER_VERSION ${MAJOR}.${MINOR})
+        set(_CONAN_SETTING_COMPILER icc)
+        set(_CONAN_SETTING_COMPILER_VERSION ${COMPILER_VERSION})
+        set(_SETTINGS ${_SETTINGS} -s compiler=icc -s compiler.version=${COMPILER_VERSION})
+        if (USING_CXX)
+            conan_cmake_detect_gnu_libcxx(_LIBCXX)
+            set(_CONAN_SETTING_COMPILER_LIBCXX ${_LIBCXX})
+        endif ()
     else()
         message(FATAL_ERROR "Conan: compiler setup not recognized")
     endif()


=====================================
conanfile.txt deleted
=====================================
@@ -1,12 +0,0 @@
-[requires]
-zstd/1.3.4 at nanopore/stable
-google-benchmark/1.5 at nanopore/stable
-
-[generators]
-cmake
-json
-
-[imports]
-# Copy runtime files to the bin folder
-bin, *.dll -> ../bin
-lib, *.dylib* -> ../bin


=====================================
license.txt deleted
=====================================
@@ -1,4 +0,0 @@
-The vbz-plugin software is provided under the Terms and Conditions of the Nanopore Community.
-
-These are available on the Oxford Nanopore Technologies website (https://nanoporetech.com) and
-also inthe included pdf file, "Nanopore Community TCs 09 September 2016.pdf".


=====================================
packaging/hdf_plugin_packaging.cmake
=====================================
@@ -7,7 +7,7 @@ set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
 if (NOT VBZ_BUILD_ARCHIVE)
     set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/packaging/readme.txt")
     set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/packaging/readme.txt")
-    set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/license.txt")
+    set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENCE.txt")
     
     cpack_add_component(
             hdf_plugin


=====================================
python/fast5compress/fast5vbz.py
=====================================
@@ -0,0 +1,74 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+"""
+Fast5 compression filter for demonstrating vbz compression
+"""
+
+import os
+import h5py
+import argparse
+from shutil import copy2
+
+__version__ = "0.1.1"
+
+
+def compress_fast5(filename, output_suffix, vbz_version=0, decompress=False):
+    """
+    (De)compress the raw signal in the fast5
+    """
+    # create a copy of the input file for compressing
+    filename = os.path.abspath(filename)
+    out_filename = filename + output_suffix
+    copy2(filename, out_filename)
+
+    # open the copy and compress the signal datasets only
+    with h5py.File(out_filename, 'r+') as fast5:
+
+        if decompress:
+            compression_opts = {
+                "compression": "gzip", "compression_opts": 1
+            }
+        else:
+            compression_opts = {
+                "compression": 32020,
+                # 2 byte integers with zig zag + level 1 zstd
+                "compression_opts": (vbz_version, 2, 1, 1) 
+            }
+
+        # multi read files
+        for read in fast5:
+            if not read.startswith("read_"):
+                continue
+            
+            # read the signal dataset
+            group = '%s/Raw/' % read
+            raw = fast5[group]["Signal"][:]
+            
+            # remove the dataset
+            del fast5[group]["Signal"]
+
+            # store the dataset with the new compression
+            fast5[group].create_dataset(
+                "Signal",
+                data=raw,
+                **compression_opts,
+                chunks=(len(raw),)
+            )
+
+    return out_filename
+
+
+def main(args, print_help):
+    for filename in args.files:
+        print(compress_fast5(filename, args.output_suffix, args.vbz_version, args.decompress))
+
+
+if __name__ == "__main__":
+    parser = argparse.ArgumentParser("fast5compress")
+    parser.add_argument('files', nargs='*', help='input files')
+    parser.add_argument("-d", "--decompress", action="store_true", default=False)
+    parser.add_argument("-s", "--output-suffix", default=".tmp")
+    parser.add_argument('-v', '--version', action='version', version=__version__)
+    parser.add_argument('--vbz-version', type=int, default=1)
+    main(parser.parse_args(), parser.print_help)


=====================================
python/pyvbz/setup.py
=====================================
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
 
 setup(
     name='pyvbz',
-    version='1.0.0',
+    version='1.0.1',
     url='https://nanoporetech.com',
     author='Oxford Nanopore Technologies, Limited',
     author_email="support at nanoporetech.com",
@@ -16,7 +16,7 @@ setup(
         'Environment :: Console',
         'Intended Audience :: Developers',
         'Intended Audience :: Science/Research',
-        'License :: Other/Proprietary License',
+        'License :: OSI Approved :: Mozilla Public License 2.0',
         'Natural Language :: English',
         'Operating System :: POSIX :: Linux',
         'Programming Language :: Python :: 2',


=====================================
python/test/test_vbz_filter.py
=====================================
@@ -10,7 +10,7 @@ class TestVbzFilter(unittest.TestCase):
     VBZ_VERISON = 0
 
     def test_simple_range(self):
-        original_data = numpy.array(range(1, 100), dtype="i2")
+        original_data = numpy.arange(1, 100, dtype="i2")
 
         with  h5py.File("test_file.h5", "w") as f:
             f.create_dataset("bar", compression=32020, compression_opts=(self.VBZ_VERISON, 2, 1, 1), data=original_data)


=====================================
vbz/v0/vbz_streamvbyte_impl_sse3.h
=====================================
@@ -3,7 +3,11 @@
 #include <cstring>
 #include <iostream>
 
+#if (defined __INTEL_COMPILER) && (defined WIN32)
+#include <intrin.h>
+#else
 #include <x86intrin.h>
+#endif
 
 // See: https://github.com/lemire/streamvbyte
 static const uint8_t encode_shuf_lut[64*16] = {


=====================================
vbz_plugin/CMakeLists.txt
=====================================
@@ -24,6 +24,19 @@ target_link_libraries(vbz_hdf_plugin
         vbz
 )
 
+if (${CMAKE_CXX_COMPILER_ID} MATCHES "Intel" AND NOT WIN32)
+    target_link_libraries(vbz_hdf_plugin
+        PRIVATE
+        $<$<CXX_COMPILER_ID:Intel>:-static-intel>
+        $<$<CXX_COMPILER_ID:Intel>:-mkl=sequential>
+        $<$<CXX_COMPILER_ID:Intel>:-wd10237>
+        )
+endif()
+
+if (ENABLE_CODE_SIGNING)
+    hdf_add_signing_command(vbz_hdf_plugin)
+endif()
+
 if (WIN32)
     target_compile_definitions(vbz_hdf_plugin
         PRIVATE
@@ -49,9 +62,26 @@ if (NOT VBZ_BUILD_ARCHIVE)
     set(VBZ_PLUGIN_COMPONENT COMPONENT hdf_plugin)
 endif()
 
+set(INSTALL_DESTINATION "hdf5/lib/plugin")
+if (STANDARD_LIB_INSTALL)
+    set(VBZ_PLUGIN_COMPONENT COMPONENT vbz_hdf_plugin)
+    set_target_properties(vbz_hdf_plugin
+        PROPERTIES
+        VERSION ${PROJECT_VERSION}
+        SOVERSION ${PROJECT_VERSION_MAJOR}
+        )
+    if(WIN32)
+        set(INSTALL_DESTINATION "bin")
+    else()
+        set(INSTALL_DESTINATION "lib")
+    endif()
+elseif (VBZ_BUILD_ARCHIVE)
+    set(INSTALL_DESTINATION "bin")
+endif()
+
 install(
     TARGETS vbz_hdf_plugin
-    DESTINATION "hdf5/lib/plugin"
+    DESTINATION ${INSTALL_DESTINATION}
     ${VBZ_PLUGIN_COMPONENT}
 )
 


=====================================
vbz_plugin/hdf_test_utils/CMakeLists.txt
=====================================
@@ -7,10 +7,11 @@ set_property(TARGET hdf_test_utils PROPERTY CXX_STANDARD 11)
 
 target_include_directories(hdf_test_utils
     PUBLIC
-        ${CMAKE_CURRENT_SOURCE_DIR}
+    ${CMAKE_CURRENT_SOURCE_DIR}
+    ${HDF5_C_INCLUDE_DIRS}
 )
 
 target_link_libraries(hdf_test_utils
     PRIVATE
-        HDF5::C
-)
\ No newline at end of file
+        ${HDF5_C_LIBRARIES}
+)


=====================================
vbz_plugin/perf/CMakeLists.txt
=====================================
@@ -8,7 +8,7 @@ add_sanitizers(vbz_hdf_perf_test)
 target_link_libraries(vbz_hdf_perf_test
     PRIVATE
         google::benchmark
-        HDF5::C
+        ${HDF5_C_LIBRARIES}
         hdf_test_utils
         vbz_hdf_plugin
 )
@@ -19,4 +19,4 @@ add_test(
     NAME vbz_hdf_perf_test
     COMMAND vbz_hdf_perf_test
     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
-)
\ No newline at end of file
+)


=====================================
vbz_plugin/test/CMakeLists.txt
=====================================
@@ -9,7 +9,7 @@ set_property(TARGET vbz_hdf_plugin_test PROPERTY CXX_STANDARD 11)
 target_link_libraries(vbz_hdf_plugin_test
     PUBLIC
         vbz_hdf_plugin
-        HDF5::C
+        ${HDF5_C_LIBRARIES}
         hdf_test_utils
 )
 
@@ -17,4 +17,4 @@ add_test(
     NAME vbz_hdf_plugin_test
     COMMAND vbz_hdf_plugin_test "${CMAKE_SOURCE_DIR}/test_data"
     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
-)
\ No newline at end of file
+)


=====================================
vbz_plugin/vbz_plugin.cpp
=====================================
@@ -108,7 +108,7 @@ size_t vbz_filter(
 
     if (cd_nelmts < 3)
     {
-        return -1;
+        return 0;
     }
 
     unsigned int vbz_version = cd_values[FILTER_VBZ_VERSION_OPTION];
@@ -139,7 +139,7 @@ size_t vbz_filter(
         if (input_span.size() > std::numeric_limits<vbz_size_t>::max())
         {
             std::cerr << "vbz_filter: Chunk size too large." << std::endl;
-            return -1;
+            return 0;
         }
 
 #if VBZ_DEBUG
@@ -153,7 +153,7 @@ size_t vbz_filter(
         if (vbz_is_error(expected_uncompressed_size))
         {
             std::cerr << "vbz_filter: size error" << std::endl;
-            return -1;
+            return 0;
         }
         outbuf.reset(h5_malloc(expected_uncompressed_size));
 
@@ -166,13 +166,13 @@ size_t vbz_filter(
         if (vbz_is_error(outbuf_used_size))
         {
             std::cerr << "vbz_filter: compression error" << std::endl;
-            return -1;
+            return 0;
         }
         
         if (outbuf_used_size != expected_uncompressed_size)
         {
             std::cerr << "vbz_filter: decompressed size error" << std::endl;
-            return -1;
+            return 0;
         }
 
 #if VBZ_DEBUG
@@ -188,14 +188,14 @@ size_t vbz_filter(
         if (*buf_size > std::numeric_limits<vbz_size_t>::max())
         {
             std::cerr << "vbz_filter: Chunk size too large." << std::endl;
-            return -1;
+            return 0;
         }
 
         auto const byte_remainder = *buf_size % integer_size;
         if (byte_remainder != 0)
         {
             std::cerr << "vbz_filter: Invalid integer_size specified" << std::endl;
-            return -1;
+            return 0;
         }
 
         outbuf_size = vbz_max_compressed_size(vbz_size_t(*buf_size), &options);
@@ -214,7 +214,7 @@ size_t vbz_filter(
         if (vbz_is_error(outbuf_used_size))
         {
             std::cerr << "vbz_filter: compression error" << std::endl;;
-            return -1;
+            return 0;
         }
 
 #if VBZ_DEBUG


=====================================
vbz_plugin/vbz_plugin_user_utils.h
=====================================
@@ -1,6 +1,7 @@
 #pragma once
 
 #include <hdf5.h>
+#include "vbz_plugin.h"
 
 #define FILTER_VBZ_VERSION 1
 



View it on GitLab: https://salsa.debian.org/med-team/vbz-compression/-/commit/0ab35a67f05333a77dde9dba973a7672433b3a84

-- 
View it on GitLab: https://salsa.debian.org/med-team/vbz-compression/-/commit/0ab35a67f05333a77dde9dba973a7672433b3a84
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20210522/9c2d5f1f/attachment-0001.htm>


More information about the debian-med-commit mailing list