build_environment: blosc build fixes.
authorRay Molenkamp <github@lazydodo.com>
Sun, 19 Aug 2018 17:24:08 +0000 (11:24 -0600)
committerRay Molenkamp <github@lazydodo.com>
Sun, 19 Aug 2018 17:44:46 +0000 (11:44 -0600)
blosc embedded a copy of zlib/pthreads causing duplicate symbol linker errors. pthreads was windows specific, but zlib may apply to other platforms as well.

build_files/build_environment/cmake/blosc.cmake

index 02f98dfe1f3dea6041cd151e8e9846dcf6f16080..e432096b93f77dbf0dd02b08d924613cc3a17164 100644 (file)
@@ -28,12 +28,20 @@ set(BLOSC_EXTRA_ARGS
        -DDEACTIVATE_SNAPPY=ON
 )
 
+if(WIN32)
+       #prevent blosc from including it's own local copy of zlib in the object file
+       #and cause linker errors with everybody else
+       set(BLOSC_EXTRA_ARGS ${BLOSC_EXTRA_ARGS}
+               -DPREFER_EXTERNAL_ZLIB=ON
+       )
+endif()
+
 ExternalProject_Add(external_blosc
        URL ${BLOSC_URI}
        DOWNLOAD_DIR ${DOWNLOAD_DIR}
        URL_HASH MD5=${BLOSC_HASH}
        PREFIX ${BUILD_DIR}/blosc
-       #PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/blosc/src/external_blosc < ${PATCH_DIR}/blosc.diff
+       PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/blosc/src/external_blosc < ${PATCH_DIR}/blosc.diff
        CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/blosc ${DEFAULT_CMAKE_FLAGS} ${BLOSC_EXTRA_ARGS}
        INSTALL_DIR ${LIBDIR}/blosc
 )