diff --git a/src/compression_tools/blosc/lib/blosc-1.21.6/CMakeLists.txt b/src/compression_tools/blosc/lib/blosc-1.21.6/CMakeLists.txt
deleted file mode 100644
index 7e6b765..0000000
--- a/src/compression_tools/blosc/lib/blosc-1.21.6/CMakeLists.txt
+++ /dev/null
@@ -1,241 +0,0 @@
-# a simple way to detect that we are using CMAKE
-add_definitions(-DUSING_CMAKE)
-
-set(INTERNAL_LIBS ${PROJECT_SOURCE_DIR}/internal-complibs)
-
-if(HIDE_SYMBOLS)
-  set(CMAKE_C_VISIBILITY_PRESET hidden)
-endif(HIDE_SYMBOLS)
-
-# includes
-set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR})
-if(NOT DEACTIVATE_LZ4)
-    if (LZ4_FOUND)
-        set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${LZ4_INCLUDE_DIR})
-    else(LZ4_FOUND)
-        set(LZ4_LOCAL_DIR ${INTERNAL_LIBS}/lz4-1.9.4)
-        set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${LZ4_LOCAL_DIR})
-    endif(LZ4_FOUND)
-endif(NOT DEACTIVATE_LZ4)
-
-if(NOT DEACTIVATE_SNAPPY)
-    if (SNAPPY_FOUND)
-        set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${SNAPPY_INCLUDE_DIR})
-    else(SNAPPY_FOUND)
-        set(SNAPPY_LOCAL_DIR ${INTERNAL_LIBS}/snappy-1.1.1)
-        set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${SNAPPY_LOCAL_DIR})
-    endif(SNAPPY_FOUND)
-endif(NOT DEACTIVATE_SNAPPY)
-
-if(NOT DEACTIVATE_ZLIB)
-    if (ZLIB_FOUND)
-        set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR})
-    else(ZLIB_FOUND)
-        set(ZLIB_LOCAL_DIR ${INTERNAL_LIBS}/zlib-1.3.1)
-        set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZLIB_LOCAL_DIR})
-    endif(ZLIB_FOUND)
-endif(NOT DEACTIVATE_ZLIB)
-
-if (NOT DEACTIVATE_ZSTD)
-    if (ZSTD_FOUND)
-        set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZSTD_INCLUDE_DIR})
-    else (ZSTD_FOUND)
-        set(ZSTD_LOCAL_DIR ${INTERNAL_LIBS}/zstd-1.5.6)
-        set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZSTD_LOCAL_DIR} ${ZSTD_LOCAL_DIR}/common)
-    endif (ZSTD_FOUND)
-endif (NOT DEACTIVATE_ZSTD)
-
-include_directories(${BLOSC_INCLUDE_DIRS})
-
-# library sources
-set(SOURCES blosc.c blosclz.c fastcopy.c shuffle-generic.c bitshuffle-generic.c
-        blosc-common.h blosc-export.h)
-if(COMPILER_SUPPORT_SSE2)
-    message(STATUS "Adding run-time support for SSE2")
-    set(SOURCES ${SOURCES} shuffle-sse2.c bitshuffle-sse2.c)
-endif(COMPILER_SUPPORT_SSE2)
-if(COMPILER_SUPPORT_AVX2)
-    message(STATUS "Adding run-time support for AVX2")
-    set(SOURCES ${SOURCES} shuffle-avx2.c bitshuffle-avx2.c)
-endif(COMPILER_SUPPORT_AVX2)
-set(SOURCES ${SOURCES} shuffle.c)
-
-set(version_string ${BLOSC_VERSION_MAJOR}.${BLOSC_VERSION_MINOR}.${BLOSC_VERSION_PATCH})
-
-set(CMAKE_THREAD_PREFER_PTHREAD TRUE) # pre 3.1
-set(THREADS_PREFER_PTHREAD_FLAG TRUE) # CMake 3.1+
-if(WIN32)
-    # try to use the system library
-    find_package(Threads)
-    if(NOT Threads_FOUND)
-        message(STATUS "using the internal pthread library for win32 systems.")
-        set(SOURCES ${SOURCES} win32/pthread.c)
-    else(NOT Threads_FOUND)
-        if(CMAKE_VERSION VERSION_LESS 3.1)
-            set(LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT})
-        else()
-            set(LIBS ${LIBS} Threads::Threads)
-        endif()
-    endif(NOT Threads_FOUND)
-else(WIN32)
-    find_package(Threads REQUIRED)
-    if(CMAKE_VERSION VERSION_LESS 3.1)
-        set(LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT})
-    else()
-        set(LIBS ${LIBS} Threads::Threads)
-    endif()
-endif(WIN32)
-
-if(NOT DEACTIVATE_LZ4)
-    if(LZ4_FOUND)
-        set(LIBS ${LIBS} ${LZ4_LIBRARY})
-    else(LZ4_FOUND)
-        file(GLOB LZ4_FILES ${LZ4_LOCAL_DIR}/*.c)
-        set(SOURCES ${SOURCES} ${LZ4_FILES})
-        source_group("LZ4" FILES ${LZ4_FILES})
-    endif(LZ4_FOUND)
-endif(NOT DEACTIVATE_LZ4)
-
-if(NOT DEACTIVATE_SNAPPY)
-    if(SNAPPY_FOUND)
-        set(LIBS ${LIBS} ${SNAPPY_LIBRARY})
-    else(SNAPPY_FOUND)
-        file(GLOB SNAPPY_FILES ${SNAPPY_LOCAL_DIR}/*.cc)
-        set(SOURCES ${SOURCES} ${SNAPPY_FILES})
-        source_group("Snappy" FILES ${SNAPPY_FILES})
-    endif(SNAPPY_FOUND)
-endif(NOT DEACTIVATE_SNAPPY)
-
-if(NOT DEACTIVATE_ZLIB)
-    if(ZLIB_FOUND)
-        set(LIBS ${LIBS} ${ZLIB_LIBRARY})
-    else(ZLIB_FOUND)
-        file(GLOB ZLIB_FILES ${ZLIB_LOCAL_DIR}/*.c)
-        set(SOURCES ${SOURCES} ${ZLIB_FILES})
-        source_group("Zlib" FILES ${ZLIB_FILES})
-    endif(ZLIB_FOUND)
-endif(NOT DEACTIVATE_ZLIB)
-
-if (NOT DEACTIVATE_ZSTD)
-    if (ZSTD_FOUND)
-        set(LIBS ${LIBS} ${ZSTD_LIBRARY})
-    else (ZSTD_FOUND)
-        # Enable assembly code only when not using MSVC *and* x86 is there
-        if((NOT MSVC) AND COMPILER_SUPPORT_SSE2)   # if SSE2 is here, this is an x86 platform
-            message(STATUS "Adding support for assembly sources in ZSTD")
-            file(GLOB ZSTD_DECOMPRESS_FILES ${ZSTD_LOCAL_DIR}/decompress/*.S)
-        else()
-            message(STATUS "Disabling support for assembly sources in ZSTD")
-            add_compile_definitions("ZSTD_DISABLE_ASM")
-        endif()
-        file(GLOB ZSTD_DECOMPRESS_FILES ${ZSTD_DECOMPRESS_FILES}
-                ${ZSTD_LOCAL_DIR}/decompress/*.c)
-        file(GLOB ZSTD_COMMON_FILES ${ZSTD_LOCAL_DIR}/common/*.c)
-        file(GLOB ZSTD_COMPRESS_FILES ${ZSTD_LOCAL_DIR}/compress/*.c)
-        file(GLOB ZSTD_DICT_FILES ${ZSTD_LOCAL_DIR}/dictBuilder/*.c)
-        set(ZSTD_FILES ${ZSTD_COMMON_FILES} ${ZSTD_COMPRESS_FILES}
-            ${ZSTD_DECOMPRESS_FILES} ${ZSTD_DICT_FILES})
-        set(SOURCES ${SOURCES} ${ZSTD_FILES})
-        source_group("Zstd" FILES ${ZSTD_FILES})
-    endif (ZSTD_FOUND)
-endif (NOT DEACTIVATE_ZSTD)
-
-
-# targets
-if (BUILD_SHARED)
-    add_library(blosc_shared SHARED ${SOURCES})
-    set_target_properties(blosc_shared PROPERTIES OUTPUT_NAME blosc)
-    set_target_properties(blosc_shared PROPERTIES
-            VERSION ${version_string}
-            SOVERSION 1  # Change this when an ABI change happens
-        )
-    set_property(
-        TARGET blosc_shared
-        APPEND PROPERTY COMPILE_DEFINITIONS BLOSC_SHARED_LIBRARY)
-endif()
-
-# Based on the target architecture and hardware features supported
-# by the C compiler, set hardware architecture optimization flags
-# for specific shuffle implementations.
-if(COMPILER_SUPPORT_SSE2)
-    if (MSVC)
-        # MSVC targets SSE2 by default on 64-bit configurations, but not 32-bit configurations.
-        if (${CMAKE_SIZEOF_VOID_P} EQUAL 4)
-            set_source_files_properties(shuffle-sse2.c bitshuffle-sse2.c PROPERTIES COMPILE_FLAGS "/arch:SSE2")
-        endif (${CMAKE_SIZEOF_VOID_P} EQUAL 4)
-    else (MSVC)
-        set_source_files_properties(shuffle-sse2.c bitshuffle-sse2.c PROPERTIES COMPILE_FLAGS -msse2)
-    endif (MSVC)
-
-    # Define a symbol for the shuffle-dispatch implementation
-    # so it knows SSE2 is supported even though that file is
-    # compiled without SSE2 support (for portability).
-    set_property(
-        SOURCE shuffle.c
-        APPEND PROPERTY COMPILE_DEFINITIONS SHUFFLE_SSE2_ENABLED)
-endif(COMPILER_SUPPORT_SSE2)
-if(COMPILER_SUPPORT_AVX2)
-    if (MSVC)
-        set_source_files_properties(shuffle-avx2.c bitshuffle-avx2.c
-                PROPERTIES COMPILE_FLAGS "/arch:AVX2")
-    else (MSVC)
-        set_source_files_properties(shuffle-avx2.c bitshuffle-avx2.c
-                PROPERTIES COMPILE_FLAGS -mavx2)
-    endif (MSVC)
-
-    # Define a symbol for the shuffle-dispatch implementation
-    # so it knows AVX2 is supported even though that file is
-    # compiled without AVX2 support (for portability).
-    set_property(
-        SOURCE shuffle.c
-        APPEND PROPERTY COMPILE_DEFINITIONS SHUFFLE_AVX2_ENABLED)
-endif(COMPILER_SUPPORT_AVX2)
-
-# When the option has been selected to compile the test suite,
-# compile an additional version of blosc_shared which exports
-# some normally-hidden symbols (to facilitate unit testing).
-if (BUILD_TESTS)
-    add_library(blosc_shared_testing SHARED ${SOURCES})
-    set_target_properties(blosc_shared_testing PROPERTIES OUTPUT_NAME blosc_testing)
-    set_property(
-        TARGET blosc_shared_testing
-        APPEND PROPERTY COMPILE_DEFINITIONS BLOSC_SHARED_LIBRARY)
-    set_property(
-        TARGET blosc_shared_testing
-        APPEND PROPERTY COMPILE_DEFINITIONS BLOSC_TESTING)
-endif()
-
-if (BUILD_SHARED)
-    target_link_libraries(blosc_shared ${LIBS})
-    target_include_directories(blosc_shared PUBLIC ${BLOSC_INCLUDE_DIRS})
-endif()
-
-if (BUILD_TESTS)
-    target_link_libraries(blosc_shared_testing ${LIBS})
-    target_include_directories(blosc_shared_testing PUBLIC ${BLOSC_INCLUDE_DIRS})
-endif()
-
-if(BUILD_STATIC)
-    add_library(blosc_static STATIC ${SOURCES})
-    set_target_properties(blosc_static PROPERTIES OUTPUT_NAME blosc)
-    if (MSVC)
-        set_target_properties(blosc_static PROPERTIES PREFIX lib)
-    endif()
-    target_link_libraries(blosc_static ${LIBS})
-    target_include_directories(blosc_static PUBLIC ${BLOSC_INCLUDE_DIRS})
-endif(BUILD_STATIC)
-
-# install
-if(BLOSC_INSTALL)
-    install(FILES blosc.h blosc-export.h
-            DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT DEV)
-    if(BUILD_SHARED)
-        install(TARGETS blosc_shared
-                LIBRARY COMPONENT LIB
-                ARCHIVE COMPONENT DEV
-                RUNTIME COMPONENT LIB)
-    endif(BUILD_SHARED)
-    if(BUILD_STATIC)
-        install(TARGETS blosc_static COMPONENT DEV)
-    endif(BUILD_STATIC)
-endif(BLOSC_INSTALL)
diff --git a/src/compression_tools/blosc/lib/blosc-1.21.6/Makefile.in b/src/compression_tools/blosc/lib/blosc-1.21.6/Makefile.in
new file mode 100644
index 0000000..3e9e604
--- /dev/null
+++ b/src/compression_tools/blosc/lib/blosc-1.21.6/Makefile.in
@@ -0,0 +1,29 @@
+EXTRA_FLAGS=-I../lz4-1.9.4 -I../snappy-1.1.1 -I../../../zstd @MSSE2@ @MAVX2@
+FLAGS=$(PKG_CFLAGS) $(PKG_CPICFLAGS) $(PKG_CPPFLAGS) $(EXTRA_FLAGS)
+
+BLOSC_FILES := $(sort $(wildcard *.c))
+
+BLOSC_OBJS=	@AVX2_BITSHUFFLE_OBJ@ @AVX2_SHUFFLE_OBJ@ @SSE2_BITSHUFFLE_OBJ@ @SSE2_SHUFFLE_OBJ@ bitshuffle-generic.o shuffle-generic.o shuffle.o blosclz.o blosc.o fastcopy.o
+
+
+all: $(BLOSC_OBJS)
+
+@AVX2_BITSHUFFLE@
+@AVX2_SHUFFLE@
+@SSE2_BITSHUFFLE@
+@SSE2_SHUFFLE@
+bitshuffle-generic.o: bitshuffle-generic.c
+	$(CC) $(FLAGS) -c bitshuffle-generic.c
+shuffle-generic.o: shuffle-generic.c
+	$(CC) $(FLAGS) -c shuffle-generic.c
+shuffle.o: shuffle.c
+	$(CC) $(FLAGS) @SSE2@ @AVX2@ -c shuffle.c
+blosclz.o: blosclz.c
+	$(CC) $(FLAGS) -c blosclz.c
+blosc.o: blosc.c
+	$(CC) $(FLAGS) -c blosc.c
+fastcopy.o: fastcopy.c
+	$(CC) $(FLAGS) -c fastcopy.c
+
+clean:
+	rm -f *.o
diff --git a/src/compression_tools/blosc/lib/blosc-1.21.6/blosc-common.h b/src/compression_tools/blosc/lib/blosc-1.21.6/blosc-common.h
index de77317..2901a80 100644
--- a/src/compression_tools/blosc/lib/blosc-1.21.6/blosc-common.h
+++ b/src/compression_tools/blosc/lib/blosc-1.21.6/blosc-common.h
@@ -9,6 +9,18 @@
 #ifndef SHUFFLE_COMMON_H
 #define SHUFFLE_COMMON_H
 
+#if !defined(NO_RLIB)
+#  include <R_ext/Print.h>
+#  include <R_ext/Error.h>
+#else
+#  ifndef Rprintf
+#    define Rprintf(...) (printf(__VA_ARGS__))
+#  endif
+#  ifndef REprintf
+#    define REprintf(...) (fprintf(stderr, __VA_ARGS__))
+#  endif
+#endif
+
 #include "blosc-export.h"
 #include <string.h>
 
diff --git a/src/compression_tools/blosc/lib/blosc-1.21.6/blosc.c b/src/compression_tools/blosc/lib/blosc-1.21.6/blosc.c
index a3d137d..5431c4b 100644
--- a/src/compression_tools/blosc/lib/blosc-1.21.6/blosc.c
+++ b/src/compression_tools/blosc/lib/blosc-1.21.6/blosc.c
@@ -13,13 +13,17 @@
 #include <errno.h>
 #include <string.h>
 #include <sys/types.h>
-#include <assert.h>
+#if !defined(USING_R)
+#  include <assert.h>
+#else
+#  ifndef assert
+#    define assert(condition) ((void)0)
+#  endif
+#endif
 
 #include "fastcopy.h"
 
-#if defined(USING_CMAKE)
-  #include "config.h"
-#endif /*  USING_CMAKE */
+#include "config.h"
 #include "blosc.h"
 #include "shuffle.h"
 #include "blosclz.h"
@@ -57,12 +61,14 @@
 #endif  /* _WIN32 */
 
 /* Include the win32/pthread.h library for all the Windows builds. See #224. */
-#if defined(_WIN32)
-  #include "win32/pthread.h"
-  #include "win32/pthread.c"
-#else
-  #include <pthread.h>
-#endif
+/* pthread is included in rtools, so we don't need the bundled
+ * version here.  If this is included we get a 'multiple definitions' error. */
+// #if defined(_WIN32)
+//   #include "win32/pthread.h"
+//   #include "win32/pthread.c"
+// #else
+//   #include <pthread.h>
+// #endif
 
 
 /* Some useful units */
@@ -164,7 +170,7 @@ int blosc_release_threadpool(struct blosc_context* context);
 #define WAIT_INIT(RET_VAL, CONTEXT_PTR)  \
   rc = pthread_barrier_wait(&CONTEXT_PTR->barr_init); \
   if (rc != 0 && rc != PTHREAD_BARRIER_SERIAL_THREAD) { \
-    printf("Could not wait on barrier (init): %d\n", rc); \
+    Rprintf("Could not wait on barrier (init): %d\n", rc); \
     return((RET_VAL));                            \
   }
 #else
@@ -185,7 +191,7 @@ int blosc_release_threadpool(struct blosc_context* context);
 #define WAIT_FINISH(RET_VAL, CONTEXT_PTR)   \
   rc = pthread_barrier_wait(&CONTEXT_PTR->barr_finish); \
   if (rc != 0 && rc != PTHREAD_BARRIER_SERIAL_THREAD) { \
-    printf("Could not wait on barrier (finish)\n"); \
+    Rprintf("Could not wait on barrier (finish)\n"); \
     return((RET_VAL));                              \
   }
 #else
@@ -220,7 +226,7 @@ static uint8_t *my_malloc(size_t size)
 #endif  /* _WIN32 */
 
   if (block == NULL || res != 0) {
-    printf("Error allocating memory!");
+    Rprintf("Error allocating memory!");
     return NULL;
   }
 
@@ -689,8 +695,8 @@ static int blosc_c(const struct blosc_context* context, int32_t blocksize,
       if (compname == NULL) {
           compname = "(null)";
       }
-      fprintf(stderr, "Blosc has not been compiled with '%s' ", compname);
-      fprintf(stderr, "compression support.  Please use one having it.");
+      REprintf("Blosc has not been compiled with '%s' ", compname);
+      REprintf("compression support.  Please use one having it.");
       return -5;    /* signals no compression support */
     }
 
@@ -956,7 +962,7 @@ static int split_block(int compcode, int typesize, int blocksize) {
                     (blocksize / typesize) >= MIN_BUFFERSIZE);
       break;
     default:
-      fprintf(stderr, "Split mode %d not supported", g_splitmode);
+      REprintf("Split mode %d not supported", g_splitmode);
   }
   return splitblock;
 }
@@ -1097,14 +1103,14 @@ static int initialize_context_compression(struct blosc_context* context,
   /* Check buffer size limits */
   if (sourcesize > BLOSC_MAX_BUFFERSIZE) {
     if (warnlvl > 0) {
-      fprintf(stderr, "Input buffer size cannot exceed %d bytes\n",
+      REprintf("Input buffer size cannot exceed %d bytes\n",
               BLOSC_MAX_BUFFERSIZE);
     }
     return 0;
   }
   if (destsize < BLOSC_MAX_OVERHEAD) {
     if (warnlvl > 0) {
-      fprintf(stderr, "Output buffer size should be larger than %d bytes\n",
+      REprintf("Output buffer size should be larger than %d bytes\n",
               BLOSC_MAX_OVERHEAD);
     }
     return 0;
@@ -1112,13 +1118,13 @@ static int initialize_context_compression(struct blosc_context* context,
 
   /* Compression level */
   if (clevel < 0 || clevel > 9) {
-    fprintf(stderr, "`clevel` parameter must be between 0 and 9!\n");
+    REprintf("`clevel` parameter must be between 0 and 9!\n");
     return -10;
   }
 
   /* Shuffle */
   if (doshuffle != 0 && doshuffle != 1 && doshuffle != 2) {
-    fprintf(stderr, "`shuffle` parameter must be either 0, 1 or 2!\n");
+    REprintf("`shuffle` parameter must be either 0, 1 or 2!\n");
     return -10;
   }
 
@@ -1196,8 +1202,8 @@ static int write_compression_header(struct blosc_context* context, int clevel, i
     if (compname == NULL) {
         compname = "(null)";
     }
-    fprintf(stderr, "Blosc has not been compiled with '%s' ", compname);
-    fprintf(stderr, "compression support.  Please use one having it.");
+    REprintf("Blosc has not been compiled with '%s' ", compname);
+    REprintf("compression support.  Please use one having it.");
     return -5;    /* signals no compression support */
     break;
   }
@@ -1384,7 +1390,7 @@ int blosc_compress(int clevel, int doshuffle, size_t typesize, size_t nbytes,
       blosc_set_splitmode(BLOSC_NEVER_SPLIT);
     }
     else {
-      fprintf(stderr, "BLOSC_SPLITMODE environment variable '%s' not recognized\n", envvar);
+      REprintf("BLOSC_SPLITMODE environment variable '%s' not recognized\n", envvar);
       return -1;
     }
   }
@@ -1633,12 +1639,12 @@ int blosc_getitem(const void* src, int start, int nitems, void* dest) {
 
   /* Check region boundaries */
   if ((start < 0) || (start*typesize > nbytes)) {
-    fprintf(stderr, "`start` out of bounds");
+    REprintf("`start` out of bounds");
     return -1;
   }
 
   if ((stop < 0) || (stop*typesize > nbytes)) {
-    fprintf(stderr, "`start`+`nitems` out of bounds");
+    REprintf("`start`+`nitems` out of bounds");
     return -1;
   }
 
@@ -1928,8 +1934,8 @@ static int init_threads(struct blosc_context* context)
     rc2 = pthread_create(&context->threads[tid], NULL, t_blosc, (void *)thread_context);
 #endif
     if (rc2) {
-      fprintf(stderr, "ERROR; return code from pthread_create() is %d\n", rc2);
-      fprintf(stderr, "\tError detail: %s\n", strerror(rc2));
+      REprintf("ERROR; return code from pthread_create() is %d\n", rc2);
+      REprintf("\tError detail: %s\n", strerror(rc2));
       return(-1);
     }
   }
@@ -1965,13 +1971,13 @@ int blosc_set_nthreads(int nthreads_new)
 int blosc_set_nthreads_(struct blosc_context* context)
 {
   if (context->numthreads > BLOSC_MAX_THREADS) {
-    fprintf(stderr,
+    REprintf(
             "Error.  nthreads cannot be larger than BLOSC_MAX_THREADS (%d)",
             BLOSC_MAX_THREADS);
     return -1;
   }
   else if (context->numthreads <= 0) {
-    fprintf(stderr, "Error.  nthreads must be a positive integer");
+    REprintf("Error.  nthreads must be a positive integer");
     return -1;
   }
 
@@ -2039,64 +2045,64 @@ const char* blosc_get_version_string(void)
   return BLOSC_VERSION_STRING;
 }
 
-int blosc_get_complib_info(const char *compname, char **complib, char **version)
-{
-  int clibcode;
-  const char *clibname;
-  const char *clibversion = "unknown";
-
-#if (defined(HAVE_LZ4) && defined(LZ4_VERSION_MAJOR)) || (defined(HAVE_SNAPPY) && defined(SNAPPY_VERSION)) || defined(ZSTD_VERSION_MAJOR)
-  char sbuffer[256];
-#endif
-
-  clibcode = compname_to_clibcode(compname);
-  clibname = clibcode_to_clibname(clibcode);
-
-  /* complib version */
-  if (clibcode == BLOSC_BLOSCLZ_LIB) {
-    clibversion = BLOSCLZ_VERSION_STRING;
-  }
-#if defined(HAVE_LZ4)
-  else if (clibcode == BLOSC_LZ4_LIB) {
-#if defined(LZ4_VERSION_MAJOR)
-    sprintf(sbuffer, "%d.%d.%d",
-            LZ4_VERSION_MAJOR, LZ4_VERSION_MINOR, LZ4_VERSION_RELEASE);
-    clibversion = sbuffer;
-#endif /* LZ4_VERSION_MAJOR */
-  }
-#endif /* HAVE_LZ4 */
-#if defined(HAVE_SNAPPY)
-  else if (clibcode == BLOSC_SNAPPY_LIB) {
-#if defined(SNAPPY_VERSION)
-    sprintf(sbuffer, "%d.%d.%d", SNAPPY_MAJOR, SNAPPY_MINOR, SNAPPY_PATCHLEVEL);
-    clibversion = sbuffer;
-#endif /* SNAPPY_VERSION */
-  }
-#endif /* HAVE_SNAPPY */
-#if defined(HAVE_ZLIB)
-  else if (clibcode == BLOSC_ZLIB_LIB) {
-    clibversion = ZLIB_VERSION;
-  }
-#endif /* HAVE_ZLIB */
-#if defined(HAVE_ZSTD)
-  else if (clibcode == BLOSC_ZSTD_LIB) {
-    sprintf(sbuffer, "%d.%d.%d",
-            ZSTD_VERSION_MAJOR, ZSTD_VERSION_MINOR, ZSTD_VERSION_RELEASE);
-    clibversion = sbuffer;
-  }
-#endif /* HAVE_ZSTD */
-  else {
-    /* Unsupported library */
-    if (complib != NULL) *complib = NULL;
-    if (version != NULL) *version = NULL;
-    return -1;
-  }
-
-  if (complib != NULL) *complib = strdup(clibname);
-  if (version != NULL) *version = strdup(clibversion);
-
-  return clibcode;
-}
+// int blosc_get_complib_info(const char *compname, char **complib, char **version)
+// {
+//   int clibcode;
+//   const char *clibname;
+//   const char *clibversion = "unknown";
+// 
+// #if (defined(HAVE_LZ4) && defined(LZ4_VERSION_MAJOR)) || (defined(HAVE_SNAPPY) && defined(SNAPPY_VERSION)) || defined(ZSTD_VERSION_MAJOR)
+//   char sbuffer[256];
+// #endif
+// 
+//   clibcode = compname_to_clibcode(compname);
+//   clibname = clibcode_to_clibname(clibcode);
+// 
+//   /* complib version */
+//   if (clibcode == BLOSC_BLOSCLZ_LIB) {
+//     clibversion = BLOSCLZ_VERSION_STRING;
+//   }
+// #if defined(HAVE_LZ4)
+//   else if (clibcode == BLOSC_LZ4_LIB) {
+// #if defined(LZ4_VERSION_MAJOR)
+//     sprintf(sbuffer, "%d.%d.%d",
+//             LZ4_VERSION_MAJOR, LZ4_VERSION_MINOR, LZ4_VERSION_RELEASE);
+//     clibversion = sbuffer;
+// #endif /* LZ4_VERSION_MAJOR */
+//   }
+// #endif /* HAVE_LZ4 */
+// #if defined(HAVE_SNAPPY)
+//   else if (clibcode == BLOSC_SNAPPY_LIB) {
+// #if defined(SNAPPY_VERSION)
+//     sprintf(sbuffer, "%d.%d.%d", SNAPPY_MAJOR, SNAPPY_MINOR, SNAPPY_PATCHLEVEL);
+//     clibversion = sbuffer;
+// #endif /* SNAPPY_VERSION */
+//   }
+// #endif /* HAVE_SNAPPY */
+// #if defined(HAVE_ZLIB)
+//   else if (clibcode == BLOSC_ZLIB_LIB) {
+//     clibversion = ZLIB_VERSION;
+//   }
+// #endif /* HAVE_ZLIB */
+// #if defined(HAVE_ZSTD)
+//   else if (clibcode == BLOSC_ZSTD_LIB) {
+//     sprintf(sbuffer, "%d.%d.%d",
+//             ZSTD_VERSION_MAJOR, ZSTD_VERSION_MINOR, ZSTD_VERSION_RELEASE);
+//     clibversion = sbuffer;
+//   }
+// #endif /* HAVE_ZSTD */
+//   else {
+//     /* Unsupported library */
+//     if (complib != NULL) *complib = NULL;
+//     if (version != NULL) *version = NULL;
+//     return -1;
+//   }
+// 
+//   if (complib != NULL) *complib = strdup(clibname);
+//   if (version != NULL) *version = strdup(clibversion);
+// 
+//   return clibcode;
+// }
 
 /* Return `nbytes`, `cbytes` and `blocksize` from a compressed buffer. */
 void blosc_cbuffer_sizes(const void *cbuffer, size_t *nbytes,
@@ -2269,8 +2275,8 @@ int blosc_release_threadpool(struct blosc_context* context)
     for (t=0; t<context->threads_started; t++) {
       rc2 = pthread_join(context->threads[t], &status);
       if (rc2) {
-        fprintf(stderr, "ERROR; return code from pthread_join() is %d\n", rc2);
-        fprintf(stderr, "\tError detail: %s\n", strerror(rc2));
+        REprintf("ERROR; return code from pthread_join() is %d\n", rc2);
+        REprintf("\tError detail: %s\n", strerror(rc2));
       }
     }
 
diff --git a/src/compression_tools/blosc/lib/blosc-1.21.6/blosc.h b/src/compression_tools/blosc/lib/blosc-1.21.6/blosc.h
index c9dc8ed..fca0cf9 100644
--- a/src/compression_tools/blosc/lib/blosc-1.21.6/blosc.h
+++ b/src/compression_tools/blosc/lib/blosc-1.21.6/blosc.h
@@ -400,7 +400,7 @@ BLOSC_EXPORT const char* blosc_get_version_string(void);
   If the compressor is supported, it returns the code for the library
   (>=0).  If it is not supported, this function returns -1.
   */
-BLOSC_EXPORT int blosc_get_complib_info(const char *compname, char **complib, char **version);
+//BLOSC_EXPORT int blosc_get_complib_info(const char *compname, char **complib, char **version);
 
 
 /**
diff --git a/src/compression_tools/blosc/lib/blosc-1.21.6/config.h b/src/compression_tools/blosc/lib/blosc-1.21.6/config.h
new file mode 100644
index 0000000..eb5b6e6
--- /dev/null
+++ b/src/compression_tools/blosc/lib/blosc-1.21.6/config.h
@@ -0,0 +1,9 @@
+#ifndef _CONFIGURATION_HEADER_GUARD_H_
+#define _CONFIGURATION_HEADER_GUARD_H_
+
+#define HAVE_LZ4 TRUE
+#define HAVE_SNAPPY TRUE
+#define HAVE_ZLIB TRUE
+#define HAVE_ZSTD TRUE
+
+#endif
\ No newline at end of file
diff --git a/src/compression_tools/blosc/lib/blosc-1.21.6/config.h.in b/src/compression_tools/blosc/lib/blosc-1.21.6/config.h.in
deleted file mode 100644
index 8b518c2..0000000
--- a/src/compression_tools/blosc/lib/blosc-1.21.6/config.h.in
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef _CONFIGURATION_HEADER_GUARD_H_
-#define _CONFIGURATION_HEADER_GUARD_H_
-
-#cmakedefine HAVE_LZ4 @HAVE_LZ4@
-#cmakedefine HAVE_SNAPPY @HAVE_SNAPPY@
-#cmakedefine HAVE_ZLIB @HAVE_ZLIB@
-#cmakedefine HAVE_ZSTD @HAVE_ZSTD@
-#cmakedefine BLOSC_DLL_EXPORT @DLL_EXPORT@
-
-
-#endif
diff --git a/src/compression_tools/blosc/lib/blosc-1.21.6/fastcopy.c b/src/compression_tools/blosc/lib/blosc-1.21.6/fastcopy.c
index 2a1c0a0..62bc015 100644
--- a/src/compression_tools/blosc/lib/blosc-1.21.6/fastcopy.c
+++ b/src/compression_tools/blosc/lib/blosc-1.21.6/fastcopy.c
@@ -18,7 +18,13 @@
     * Support for SSE2/AVX2 copy instructions for these routines
 **********************************************************************/
 
-#include <assert.h>
+#if !defined(R_BLOSC)
+#  include <assert.h>
+#else
+#  ifndef assert
+#    define assert(condition) ((void)0)
+#  endif
+#endif
 #include "blosc-common.h"
 
 /*
diff --git a/src/compression_tools/blosc/lib/blosc-1.21.6/shuffle-avx2.c b/src/compression_tools/blosc/lib/blosc-1.21.6/shuffle-avx2.c
index 3f78690..0fa7a13 100644
--- a/src/compression_tools/blosc/lib/blosc-1.21.6/shuffle-avx2.c
+++ b/src/compression_tools/blosc/lib/blosc-1.21.6/shuffle-avx2.c
@@ -40,7 +40,7 @@ static void printymm(__m256i ymm0)
   uint8_t buf[32];
 
   ((__m256i *)buf)[0] = ymm0;
-  printf("%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x\n",
+  Rprintf("%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x\n",
           buf[0], buf[1], buf[2], buf[3],
           buf[4], buf[5], buf[6], buf[7],
           buf[8], buf[9], buf[10], buf[11],
diff --git a/src/compression_tools/blosc/lib/blosc-1.21.6/shuffle-sse2.c b/src/compression_tools/blosc/lib/blosc-1.21.6/shuffle-sse2.c
index 286f9d1..3672abf 100644
--- a/src/compression_tools/blosc/lib/blosc-1.21.6/shuffle-sse2.c
+++ b/src/compression_tools/blosc/lib/blosc-1.21.6/shuffle-sse2.c
@@ -39,7 +39,7 @@ static void printxmm(__m128i xmm0)
   uint8_t buf[16];
 
   ((__m128i *)buf)[0] = xmm0;
-  printf("%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x\n",
+  Rprintf("%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x\n",
           buf[0], buf[1], buf[2], buf[3],
           buf[4], buf[5], buf[6], buf[7],
           buf[8], buf[9], buf[10], buf[11],
diff --git a/src/compression_tools/blosc/lib/blosc-1.21.6/shuffle.c b/src/compression_tools/blosc/lib/blosc-1.21.6/shuffle.c
index e680a17..b3d2fb6 100644
--- a/src/compression_tools/blosc/lib/blosc-1.21.6/shuffle.c
+++ b/src/compression_tools/blosc/lib/blosc-1.21.6/shuffle.c
@@ -14,28 +14,13 @@
 #include "blosc-comp-features.h"
 #include <stdio.h>
 
-#if defined(_WIN32)
-#include "win32/pthread.h"
-#else
 #include <pthread.h>
-#endif
-
-/* Visual Studio < 2013 does not have stdbool.h so here it is a replacement: */
-#if defined __STDC__ && defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
-/* have a C99 compiler */
-typedef _Bool bool;
-#else
-/* do not have a C99 compiler */
-typedef unsigned char bool;
-#endif
-
 
 #if !defined(__clang__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && \
     __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
 #define HAVE_CPU_FEAT_INTRIN
 #endif
 
-
 /*  Include hardware-accelerated shuffle/unshuffle routines based on
     the target architecture. Note that a target architecture may support
     more than one type of acceleration!*/
@@ -267,19 +252,19 @@ static blosc_cpu_features blosc_get_cpu_features(void) {
 
   envvar = getenv("BLOSC_PRINT_SHUFFLE_ACCEL");
   if (envvar != NULL) {
-    printf("Shuffle CPU Information:\n");
-    printf("SSE2 available: %s\n", sse2_available ? "True" : "False");
-    printf("SSE3 available: %s\n", sse3_available ? "True" : "False");
-    printf("SSSE3 available: %s\n", ssse3_available ? "True" : "False");
-    printf("SSE4.1 available: %s\n", sse41_available ? "True" : "False");
-    printf("SSE4.2 available: %s\n", sse42_available ? "True" : "False");
-    printf("AVX2 available: %s\n", avx2_available ? "True" : "False");
-    printf("AVX512BW available: %s\n", avx512bw_available ? "True" : "False");
-    printf("XSAVE available: %s\n", xsave_available ? "True" : "False");
-    printf("XSAVE enabled: %s\n", xsave_enabled_by_os ? "True" : "False");
-    printf("XMM state enabled: %s\n", xmm_state_enabled ? "True" : "False");
-    printf("YMM state enabled: %s\n", ymm_state_enabled ? "True" : "False");
-    printf("ZMM state enabled: %s\n", zmm_state_enabled ? "True" : "False");
+    Rprintf("Shuffle CPU Information:\n");
+    Rprintf("SSE2 available: %s\n", sse2_available ? "True" : "False");
+    Rprintf("SSE3 available: %s\n", sse3_available ? "True" : "False");
+    Rprintf("SSSE3 available: %s\n", ssse3_available ? "True" : "False");
+    Rprintf("SSE4.1 available: %s\n", sse41_available ? "True" : "False");
+    Rprintf("SSE4.2 available: %s\n", sse42_available ? "True" : "False");
+    Rprintf("AVX2 available: %s\n", avx2_available ? "True" : "False");
+    Rprintf("AVX512BW available: %s\n", avx512bw_available ? "True" : "False");
+    Rprintf("XSAVE available: %s\n", xsave_available ? "True" : "False");
+    Rprintf("XSAVE enabled: %s\n", xsave_enabled_by_os ? "True" : "False");
+    Rprintf("XMM state enabled: %s\n", xmm_state_enabled ? "True" : "False");
+    Rprintf("YMM state enabled: %s\n", ymm_state_enabled ? "True" : "False");
+    Rprintf("ZMM state enabled: %s\n", zmm_state_enabled ? "True" : "False");
   }
 
   /* Using the gathered CPU information, determine which implementation to use. */
@@ -299,7 +284,7 @@ static blosc_cpu_features blosc_get_cpu_features(void) {
   #if defined(_MSC_VER)
   #pragma message("Hardware-acceleration detection not implemented for the target architecture. Only the generic shuffle/unshuffle routines will be available.")
   #else
-  #warning Hardware-acceleration detection not implemented for the target architecture. Only the generic shuffle/unshuffle routines will be available.
+//   #warning Hardware-acceleration detection not implemented for the target architecture. Only the generic shuffle/unshuffle routines will be available.
   #endif
 
 static blosc_cpu_features blosc_get_cpu_features(void) {
diff --git a/src/compression_tools/blosc/lib/blosc-1.21.6/win32/pthread.c b/src/compression_tools/blosc/lib/blosc-1.21.6/win32/pthread.c
deleted file mode 100644
index 23eb8f0..0000000
--- a/src/compression_tools/blosc/lib/blosc-1.21.6/win32/pthread.c
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Code for simulating pthreads API on Windows.  This is Git-specific,
- * but it is enough for Numexpr needs too.
- *
- * Copyright (C) 2009 Andrzej K. Haczewski <ahaczewski@gmail.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- * DISCLAIMER: The implementation is Git-specific, it is subset of original
- * Pthreads API, without lots of other features that Git doesn't use.
- * Git also makes sure that the passed arguments are valid, so there's
- * no need for double-checking.
- */
-
-#include "pthread.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <process.h>
-#include <errno.h>
-#include <limits.h>
-
-
-void die(const char *err, ...)
-{
-	printf("%s", err);
-	exit(-1);
-}
-
-static unsigned __stdcall win32_start_routine(void *arg)
-{
-	pthread_t *thread = (pthread_t*)arg;
-	thread->arg = thread->start_routine(thread->arg);
-	return 0;
-}
-
-int pthread_create(pthread_t *thread, const void *unused,
-		   void *(*start_routine)(void*), void *arg)
-{
-	thread->arg = arg;
-	thread->start_routine = start_routine;
-	thread->handle = (HANDLE)
-		_beginthreadex(NULL, 0, win32_start_routine, thread, 0, NULL);
-
-	if (!thread->handle)
-		return errno;
-	else
-		return 0;
-}
-
-int win32_pthread_join(pthread_t *thread, void **value_ptr)
-{
-	DWORD result = WaitForSingleObject(thread->handle, INFINITE);
-	switch (result) {
-		case WAIT_OBJECT_0:
-			if (value_ptr)
-				*value_ptr = thread->arg;
-			return 0;
-		case WAIT_ABANDONED:
-			return EINVAL;
-		default:
-			return GetLastError();
-	}
-}
-
-int pthread_cond_init(pthread_cond_t *cond, const void *unused)
-{
-	cond->waiters = 0;
-	cond->was_broadcast = 0;
-	InitializeCriticalSection(&cond->waiters_lock);
-
-	cond->sema = CreateSemaphore(NULL, 0, LONG_MAX, NULL);
-	if (!cond->sema)
-		die("CreateSemaphore() failed");
-
-	cond->continue_broadcast = CreateEvent(NULL,	/* security */
-				FALSE,			/* auto-reset */
-				FALSE,			/* not signaled */
-				NULL);			/* name */
-	if (!cond->continue_broadcast)
-		die("CreateEvent() failed");
-
-	return 0;
-}
-
-int pthread_cond_destroy(pthread_cond_t *cond)
-{
-	CloseHandle(cond->sema);
-	CloseHandle(cond->continue_broadcast);
-	DeleteCriticalSection(&cond->waiters_lock);
-	return 0;
-}
-
-int pthread_cond_wait(pthread_cond_t *cond, CRITICAL_SECTION *mutex)
-{
-	int last_waiter;
-
-	EnterCriticalSection(&cond->waiters_lock);
-	cond->waiters++;
-	LeaveCriticalSection(&cond->waiters_lock);
-
-	/*
-	 * Unlock external mutex and wait for signal.
-	 * NOTE: we've held mutex locked long enough to increment
-	 * waiters count above, so there's no problem with
-	 * leaving mutex unlocked before we wait on semaphore.
-	 */
-	LeaveCriticalSection(mutex);
-
-	/* let's wait - ignore return value */
-	WaitForSingleObject(cond->sema, INFINITE);
-
-	/*
-	 * Decrease waiters count. If we are the last waiter, then we must
-	 * notify the broadcasting thread that it can continue.
-	 * But if we continued due to cond_signal, we do not have to do that
-	 * because the signaling thread knows that only one waiter continued.
-	 */
-	EnterCriticalSection(&cond->waiters_lock);
-	cond->waiters--;
-	last_waiter = cond->was_broadcast && cond->waiters == 0;
-	LeaveCriticalSection(&cond->waiters_lock);
-
-	if (last_waiter) {
-		/*
-		 * cond_broadcast was issued while mutex was held. This means
-		 * that all other waiters have continued, but are contending
-		 * for the mutex at the end of this function because the
-		 * broadcasting thread did not leave cond_broadcast, yet.
-		 * (This is so that it can be sure that each waiter has
-		 * consumed exactly one slice of the semaphore.)
-		 * The last waiter must tell the broadcasting thread that it
-		 * can go on.
-		 */
-		SetEvent(cond->continue_broadcast);
-		/*
-		 * Now we go on to contend with all other waiters for
-		 * the mutex. Auf in den Kampf!
-		 */
-	}
-	/* lock external mutex again */
-	EnterCriticalSection(mutex);
-
-	return 0;
-}
-
-/*
- * IMPORTANT: This implementation requires that pthread_cond_signal
- * is called while the mutex is held that is used in the corresponding
- * pthread_cond_wait calls!
- */
-int pthread_cond_signal(pthread_cond_t *cond)
-{
-	int have_waiters;
-
-	EnterCriticalSection(&cond->waiters_lock);
-	have_waiters = cond->waiters > 0;
-	LeaveCriticalSection(&cond->waiters_lock);
-
-	/*
-	 * Signal only when there are waiters
-	 */
-	if (have_waiters)
-		return ReleaseSemaphore(cond->sema, 1, NULL) ?
-			0 : GetLastError();
-	else
-		return 0;
-}
-
-/*
- * DOUBLY IMPORTANT: This implementation requires that pthread_cond_broadcast
- * is called while the mutex is held that is used in the corresponding
- * pthread_cond_wait calls!
- */
-int pthread_cond_broadcast(pthread_cond_t *cond)
-{
-	EnterCriticalSection(&cond->waiters_lock);
-
-	if ((cond->was_broadcast = cond->waiters > 0)) {
-		/* wake up all waiters */
-		ReleaseSemaphore(cond->sema, cond->waiters, NULL);
-		LeaveCriticalSection(&cond->waiters_lock);
-		/*
-		 * At this point all waiters continue. Each one takes its
-		 * slice of the semaphore. Now it's our turn to wait: Since
-		 * the external mutex is held, no thread can leave cond_wait,
-		 * yet. For this reason, we can be sure that no thread gets
-		 * a chance to eat *more* than one slice. OTOH, it means
-		 * that the last waiter must send us a wake-up.
-		 */
-		WaitForSingleObject(cond->continue_broadcast, INFINITE);
-		/*
-		 * Since the external mutex is held, no thread can enter
-		 * cond_wait, and, hence, it is safe to reset this flag
-		 * without cond->waiters_lock held.
-		 */
-		cond->was_broadcast = 0;
-	} else {
-		LeaveCriticalSection(&cond->waiters_lock);
-	}
-	return 0;
-}
diff --git a/src/compression_tools/blosc/lib/blosc-1.21.6/win32/pthread.h b/src/compression_tools/blosc/lib/blosc-1.21.6/win32/pthread.h
deleted file mode 100644
index c119943..0000000
--- a/src/compression_tools/blosc/lib/blosc-1.21.6/win32/pthread.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Code for simulating pthreads API on Windows.  This is Git-specific,
- * but it is enough for Numexpr needs too.
- *
- * Copyright (C) 2009 Andrzej K. Haczewski <ahaczewski@gmail.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- * DISCLAIMER: The implementation is Git-specific, it is subset of original
- * Pthreads API, without lots of other features that Git doesn't use.
- * Git also makes sure that the passed arguments are valid, so there's
- * no need for double-checking.
- */
-
-#ifndef PTHREAD_H
-#define PTHREAD_H
-
-#ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN
-#endif
-
-#include <windows.h>
-
-/*
- * Defines that adapt Windows API threads to pthreads API
- */
-#define pthread_mutex_t CRITICAL_SECTION
-
-#define pthread_mutex_init(a,b) InitializeCriticalSection((a))
-#define pthread_mutex_destroy(a) DeleteCriticalSection((a))
-#define pthread_mutex_lock EnterCriticalSection
-#define pthread_mutex_unlock LeaveCriticalSection
-
-/*
- * Implement simple condition variable for Windows threads, based on ACE
- * implementation.
- *
- * See original implementation: http://bit.ly/1vkDjo
- * ACE homepage: http://www.cse.wustl.edu/~schmidt/ACE.html
- * See also: http://www.cse.wustl.edu/~schmidt/win32-cv-1.html
- */
-typedef struct {
-	LONG waiters;
-	int was_broadcast;
-	CRITICAL_SECTION waiters_lock;
-	HANDLE sema;
-	HANDLE continue_broadcast;
-} pthread_cond_t;
-
-extern int pthread_cond_init(pthread_cond_t *cond, const void *unused);
-extern int pthread_cond_destroy(pthread_cond_t *cond);
-extern int pthread_cond_wait(pthread_cond_t *cond, CRITICAL_SECTION *mutex);
-extern int pthread_cond_signal(pthread_cond_t *cond);
-extern int pthread_cond_broadcast(pthread_cond_t *cond);
-
-/*
- * Simple thread creation implementation using pthread API
- */
-typedef struct {
-	HANDLE handle;
-	void *(*start_routine)(void*);
-	void *arg;
-} pthread_t;
-
-extern int pthread_create(pthread_t *thread, const void *unused,
-			  void *(*start_routine)(void*), void *arg);
-
-/*
- * To avoid the need of copying a struct, we use small macro wrapper to pass
- * pointer to win32_pthread_join instead.
- */
-#define pthread_join(a, b) win32_pthread_join(&(a), (b))
-
-extern int win32_pthread_join(pthread_t *thread, void **value_ptr);
-
-/**
- * pthread_once implementation based on the MS Windows One-Time Initialization
- * (https://docs.microsoft.com/en-us/windows/desktop/Sync/one-time-initialization)
- * APIs.
- */
-typedef INIT_ONCE pthread_once_t;
-#define PTHREAD_ONCE_INIT INIT_ONCE_STATIC_INIT
-#define pthread_once blosc_internal_pthread_once /* Avoid symbol conflicts */
-static int blosc_internal_pthread_once(pthread_once_t* once_control,
-																			 void (*init_routine)(void)) {
-  BOOL pending;
-  InitOnceBeginInitialize(once_control, /*dwFlags=*/0, /*fPending=*/&pending,
-                          NULL);
-  if (pending == TRUE) {
-    init_routine();
-    InitOnceComplete(once_control, /*dwFlags=*/0, /*lpContext=*/NULL);
-  }
-  return 0;
-}
-
-#endif /* PTHREAD_H */
diff --git a/src/compression_tools/blosc/lib/blosc-1.21.6/win32/stdint-windows.h b/src/compression_tools/blosc/lib/blosc-1.21.6/win32/stdint-windows.h
deleted file mode 100644
index 4fe0ef9..0000000
--- a/src/compression_tools/blosc/lib/blosc-1.21.6/win32/stdint-windows.h
+++ /dev/null
@@ -1,259 +0,0 @@
-// ISO C9x  compliant stdint.h for Microsoft Visual Studio
-// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 
-// 
-//  Copyright (c) 2006-2013 Alexander Chemeris
-// 
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-// 
-//   1. Redistributions of source code must retain the above copyright notice,
-//      this list of conditions and the following disclaimer.
-// 
-//   2. Redistributions in binary form must reproduce the above copyright
-//      notice, this list of conditions and the following disclaimer in the
-//      documentation and/or other materials provided with the distribution.
-// 
-//   3. Neither the name of the product nor the names of its contributors may
-//      be used to endorse or promote products derived from this software
-//      without specific prior written permission.
-// 
-// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
-// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// 
-///////////////////////////////////////////////////////////////////////////////
-
-#ifndef _MSC_VER // [
-#error "Use this header only with Microsoft Visual C++ compilers!"
-#endif // _MSC_VER ]
-
-#ifndef _MSC_STDINT_H_ // [
-#define _MSC_STDINT_H_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif
-
-#if _MSC_VER >= 1600 // [
-#include <stdint.h>
-#else // ] _MSC_VER >= 1600 [
-
-#include <limits.h>
-
-// For Visual Studio 6 in C++ mode and for many Visual Studio versions when
-// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
-// or compiler give many errors like this:
-//   error C2733: second C linkage of overloaded function 'wmemchr' not allowed
-#ifdef __cplusplus
-extern "C" {
-#endif
-#  include <wchar.h>
-#ifdef __cplusplus
-}
-#endif
-
-// Define _W64 macros to mark types changing their size, like intptr_t.
-#ifndef _W64
-#  if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
-#     define _W64 __w64
-#  else
-#     define _W64
-#  endif
-#endif
-
-
-// 7.18.1 Integer types
-
-// 7.18.1.1 Exact-width integer types
-
-// Visual Studio 6 and Embedded Visual C++ 4 doesn't
-// realize that, e.g. char has the same size as __int8
-// so we give up on __intX for them.
-#if (_MSC_VER < 1300)
-   typedef signed char       int8_t;
-   typedef signed short      int16_t;
-   typedef signed int        int32_t;
-   typedef unsigned char     uint8_t;
-   typedef unsigned short    uint16_t;
-   typedef unsigned int      uint32_t;
-#else
-   typedef signed __int8     int8_t;
-   typedef signed __int16    int16_t;
-   typedef signed __int32    int32_t;
-   typedef unsigned __int8   uint8_t;
-   typedef unsigned __int16  uint16_t;
-   typedef unsigned __int32  uint32_t;
-#endif
-typedef signed __int64       int64_t;
-typedef unsigned __int64     uint64_t;
-
-
-// 7.18.1.2 Minimum-width integer types
-typedef int8_t    int_least8_t;
-typedef int16_t   int_least16_t;
-typedef int32_t   int_least32_t;
-typedef int64_t   int_least64_t;
-typedef uint8_t   uint_least8_t;
-typedef uint16_t  uint_least16_t;
-typedef uint32_t  uint_least32_t;
-typedef uint64_t  uint_least64_t;
-
-// 7.18.1.3 Fastest minimum-width integer types
-typedef int8_t    int_fast8_t;
-typedef int16_t   int_fast16_t;
-typedef int32_t   int_fast32_t;
-typedef int64_t   int_fast64_t;
-typedef uint8_t   uint_fast8_t;
-typedef uint16_t  uint_fast16_t;
-typedef uint32_t  uint_fast32_t;
-typedef uint64_t  uint_fast64_t;
-
-// 7.18.1.4 Integer types capable of holding object pointers
-#ifdef _WIN64 // [
-   typedef signed __int64    intptr_t;
-   typedef unsigned __int64  uintptr_t;
-#else // _WIN64 ][
-   typedef _W64 signed int   intptr_t;
-   typedef _W64 unsigned int uintptr_t;
-#endif // _WIN64 ]
-
-// 7.18.1.5 Greatest-width integer types
-typedef int64_t   intmax_t;
-typedef uint64_t  uintmax_t;
-
-
-// 7.18.2 Limits of specified-width integer types
-
-#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [   See footnote 220 at page 257 and footnote 221 at page 259
-
-// 7.18.2.1 Limits of exact-width integer types
-#define INT8_MIN     ((int8_t)_I8_MIN)
-#define INT8_MAX     _I8_MAX
-#define INT16_MIN    ((int16_t)_I16_MIN)
-#define INT16_MAX    _I16_MAX
-#define INT32_MIN    ((int32_t)_I32_MIN)
-#define INT32_MAX    _I32_MAX
-#define INT64_MIN    ((int64_t)_I64_MIN)
-#define INT64_MAX    _I64_MAX
-#define UINT8_MAX    _UI8_MAX
-#define UINT16_MAX   _UI16_MAX
-#define UINT32_MAX   _UI32_MAX
-#define UINT64_MAX   _UI64_MAX
-
-// 7.18.2.2 Limits of minimum-width integer types
-#define INT_LEAST8_MIN    INT8_MIN
-#define INT_LEAST8_MAX    INT8_MAX
-#define INT_LEAST16_MIN   INT16_MIN
-#define INT_LEAST16_MAX   INT16_MAX
-#define INT_LEAST32_MIN   INT32_MIN
-#define INT_LEAST32_MAX   INT32_MAX
-#define INT_LEAST64_MIN   INT64_MIN
-#define INT_LEAST64_MAX   INT64_MAX
-#define UINT_LEAST8_MAX   UINT8_MAX
-#define UINT_LEAST16_MAX  UINT16_MAX
-#define UINT_LEAST32_MAX  UINT32_MAX
-#define UINT_LEAST64_MAX  UINT64_MAX
-
-// 7.18.2.3 Limits of fastest minimum-width integer types
-#define INT_FAST8_MIN    INT8_MIN
-#define INT_FAST8_MAX    INT8_MAX
-#define INT_FAST16_MIN   INT16_MIN
-#define INT_FAST16_MAX   INT16_MAX
-#define INT_FAST32_MIN   INT32_MIN
-#define INT_FAST32_MAX   INT32_MAX
-#define INT_FAST64_MIN   INT64_MIN
-#define INT_FAST64_MAX   INT64_MAX
-#define UINT_FAST8_MAX   UINT8_MAX
-#define UINT_FAST16_MAX  UINT16_MAX
-#define UINT_FAST32_MAX  UINT32_MAX
-#define UINT_FAST64_MAX  UINT64_MAX
-
-// 7.18.2.4 Limits of integer types capable of holding object pointers
-#ifdef _WIN64 // [
-#  define INTPTR_MIN   INT64_MIN
-#  define INTPTR_MAX   INT64_MAX
-#  define UINTPTR_MAX  UINT64_MAX
-#else // _WIN64 ][
-#  define INTPTR_MIN   INT32_MIN
-#  define INTPTR_MAX   INT32_MAX
-#  define UINTPTR_MAX  UINT32_MAX
-#endif // _WIN64 ]
-
-// 7.18.2.5 Limits of greatest-width integer types
-#define INTMAX_MIN   INT64_MIN
-#define INTMAX_MAX   INT64_MAX
-#define UINTMAX_MAX  UINT64_MAX
-
-// 7.18.3 Limits of other integer types
-
-#ifdef _WIN64 // [
-#  define PTRDIFF_MIN  _I64_MIN
-#  define PTRDIFF_MAX  _I64_MAX
-#else  // _WIN64 ][
-#  define PTRDIFF_MIN  _I32_MIN
-#  define PTRDIFF_MAX  _I32_MAX
-#endif  // _WIN64 ]
-
-#define SIG_ATOMIC_MIN  INT_MIN
-#define SIG_ATOMIC_MAX  INT_MAX
-
-#ifndef SIZE_MAX // [
-#  ifdef _WIN64 // [
-#     define SIZE_MAX  _UI64_MAX
-#  else // _WIN64 ][
-#     define SIZE_MAX  _UI32_MAX
-#  endif // _WIN64 ]
-#endif // SIZE_MAX ]
-
-// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
-#ifndef WCHAR_MIN // [
-#  define WCHAR_MIN  0
-#endif  // WCHAR_MIN ]
-#ifndef WCHAR_MAX // [
-#  define WCHAR_MAX  _UI16_MAX
-#endif  // WCHAR_MAX ]
-
-#define WINT_MIN  0
-#define WINT_MAX  _UI16_MAX
-
-#endif // __STDC_LIMIT_MACROS ]
-
-
-// 7.18.4 Limits of other integer types
-
-#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [   See footnote 224 at page 260
-
-// 7.18.4.1 Macros for minimum-width integer constants
-
-#define INT8_C(val)  val##i8
-#define INT16_C(val) val##i16
-#define INT32_C(val) val##i32
-#define INT64_C(val) val##i64
-
-#define UINT8_C(val)  val##ui8
-#define UINT16_C(val) val##ui16
-#define UINT32_C(val) val##ui32
-#define UINT64_C(val) val##ui64
-
-// 7.18.4.2 Macros for greatest-width integer constants
-// These #ifndef's are needed to prevent collisions with <boost/cstdint.hpp>.
-// Check out Issue 9 for the details.
-#ifndef INTMAX_C //   [
-#  define INTMAX_C   INT64_C
-#endif // INTMAX_C    ]
-#ifndef UINTMAX_C //  [
-#  define UINTMAX_C  UINT64_C
-#endif // UINTMAX_C   ]
-
-#endif // __STDC_CONSTANT_MACROS ]
-
-#endif // _MSC_VER >= 1600 ]
-
-#endif // _MSC_STDINT_H_ ]
