From c8ecafed59782a5b70f6928b35a6e159ae778ac8 Mon Sep 17 00:00:00 2001 From: tickduan <417921451@qq.com> Date: Tue, 20 Jul 2021 15:47:34 +0800 Subject: [PATCH] Set global var VAR_TSZ fixed build error --- cmake/input.inc | 11 +++++++---- deps/CMakeLists.txt | 8 +++----- deps/TSZ | 2 +- src/client/CMakeLists.txt | 2 +- src/kit/taospack/CMakeLists.txt | 2 +- src/util/CMakeLists.txt | 3 ++- src/util/src/tcompression.c | 7 +++++-- 7 files changed, 20 insertions(+), 15 deletions(-) diff --git a/cmake/input.inc b/cmake/input.inc index 3f90bca6cd..985cf1e4c1 100755 --- a/cmake/input.inc +++ b/cmake/input.inc @@ -92,8 +92,11 @@ IF (${MEMORY_SANITIZER} MATCHES "true") SET(TD_MEMORY_SANITIZER TRUE) ENDIF () -IF (${TSZ_DISABLED} MATCHES "true") - MESSAGE(STATUS "build with TSZ disabled") -ELSE() +IF (${TSZ_ENABLED} MATCHES "true") + # define add + MESSAGE(STATUS "build with TSZ enabled") ADD_DEFINITIONS(-DTD_TSZ) -ENDIF () + set(VAR_TSZ "TSZ" CACHE INTERNAL "global variant tsz" ) +ELSE() + set(VAR_TSZ "errTSZ" CACHE INTERNAL "global variant empty" ) +ENDIF() diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 7c90088dce..516c752bd1 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -38,8 +38,6 @@ IF (TD_LINUX_64 AND JEMALLOC_ENABLED) ) ENDIF () -IF(TD_TSZ) - MESSAGE("TSZ module set disabled.") -ELSE() - ADD_SUBDIRECTORY(TSZ) -ENDIF() +IF (${TSZ_ENABLED} MATCHES "true") + ADD_SUBDIRECTORY(TSZ) +ENDIF() \ No newline at end of file diff --git a/deps/TSZ b/deps/TSZ index 18bc74ce5b..0ca5b15a8e 160000 --- a/deps/TSZ +++ b/deps/TSZ @@ -1 +1 @@ -Subproject commit 18bc74ce5bf206dfe8aba451dde615012bbec649 +Subproject commit 0ca5b15a8eac40327dd737be52c926fa5675712c diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index eb12039ade..2f83557d63 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -11,7 +11,7 @@ IF (TD_LINUX) # set the static lib name ADD_LIBRARY(taos_static STATIC ${SRC}) - TARGET_LINK_LIBRARIES(taos_static common query trpc tutil pthread m rt SZ) + TARGET_LINK_LIBRARIES(taos_static common query trpc tutil pthread m rt ${VAR_TSZ}) SET_TARGET_PROPERTIES(taos_static PROPERTIES OUTPUT_NAME "taos_static") SET_TARGET_PROPERTIES(taos_static PROPERTIES CLEAN_DIRECT_OUTPUT 1) diff --git a/src/kit/taospack/CMakeLists.txt b/src/kit/taospack/CMakeLists.txt index dc3d436a71..58c3688732 100644 --- a/src/kit/taospack/CMakeLists.txt +++ b/src/kit/taospack/CMakeLists.txt @@ -8,7 +8,7 @@ INCLUDE_DIRECTORIES(inc) IF (TD_LINUX) AUX_SOURCE_DIRECTORY(. SRC) ADD_EXECUTABLE(taospack ${SRC}) - TARGET_LINK_LIBRARIES(taospack os tutil tsdb SZ) + TARGET_LINK_LIBRARIES(taospack os tutil tsdb ${VAR_TSZ}) ELSEIF (TD_WINDOWS) AUX_SOURCE_DIRECTORY(. SRC) ADD_EXECUTABLE(taospack ${SRC}) diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index 32daf57173..240559c3ce 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -7,7 +7,8 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/rmonotonic/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/SZ/sz/include) AUX_SOURCE_DIRECTORY(src SRC) ADD_LIBRARY(tutil ${SRC}) -TARGET_LINK_LIBRARIES(tutil pthread os lz4 z rmonotonic SZ ) + +TARGET_LINK_LIBRARIES(tutil pthread os lz4 z rmonotonic ${VAR_TSZ} ) diff --git a/src/util/src/tcompression.c b/src/util/src/tcompression.c index fd2a049eed..83b0a114c7 100644 --- a/src/util/src/tcompression.c +++ b/src/util/src/tcompression.c @@ -50,7 +50,7 @@ #include "os.h" #include "lz4.h" #ifdef TD_TSZ - #include "td_sz.h" + #include "../../../deps/TSZ/sz/include/td_sz.h" #endif #include "taosdef.h" #include "tscompression.h" @@ -86,7 +86,10 @@ int tsCompressInit(){ return 0; tdszInit(fPrecision, dPrecision, maxIntervals, intervals, Compressor); - uInfo("lossy compression is opened. columns = %s \n", lossyColumns); + if(lossyFloat) + uInfo("lossy compression float is opened. \n"); + if(lossyDouble) + uInfo("lossy compression double is opened. \n"); return 1; } // exit call -- GitLab