diff --git a/cmake_modules/BaseFunctions.cmake b/cmake_modules/BaseFunctions.cmake index 1882353c83..27994adf50 100644 --- a/cmake_modules/BaseFunctions.cmake +++ b/cmake_modules/BaseFunctions.cmake @@ -332,7 +332,7 @@ function(dsn_setup_thirdparty_libs) message(WARNING "Cannot find RocksDB depends cmake modules path, might not find snappy, zstd, lz4") endif() list(APPEND CMAKE_MODULE_PATH "${ROCKSDB_DEPENDS_MODULE_PATH}") - find_package(snappy) + find_package(Snappy REQUIRED) find_package(zstd) find_package(lz4) if(USE_JEMALLOC) diff --git a/cmake_modules/FindSnappy.cmake b/cmake_modules/FindSnappy.cmake new file mode 100644 index 0000000000..166e563908 --- /dev/null +++ b/cmake_modules/FindSnappy.cmake @@ -0,0 +1,35 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# - Find SNAPPY (snappy.h, libsnappy.a, libsnappy.so, and libsnappy.so.1) +# This module defines +# SNAPPY_INCLUDE_DIR, directory containing headers +# SNAPPY_SHARED_LIB, path to snappy's shared library +# SNAPPY_STATIC_LIB, path to snappy's static library +# SNAPPY_FOUND, whether snappy has been found + +find_path(SNAPPY_INCLUDE_DIR snappy.h + # make sure we don't accidentally pick up a different version + NO_CMAKE_SYSTEM_PATH + NO_SYSTEM_ENVIRONMENT_PATH) +find_library(SNAPPY_STATIC_LIB libsnappy.a + NO_CMAKE_SYSTEM_PATH + NO_SYSTEM_ENVIRONMENT_PATH) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Snappy REQUIRED_VARS + SNAPPY_STATIC_LIB SNAPPY_INCLUDE_DIR) diff --git a/src/aio/CMakeLists.txt b/src/aio/CMakeLists.txt index 3754361d06..aead830d3f 100644 --- a/src/aio/CMakeLists.txt +++ b/src/aio/CMakeLists.txt @@ -33,7 +33,12 @@ set(MY_PROJ_SRC "") #"GLOB" for non - recursive search set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_PROJ_LIBS dsn_runtime rocksdb) +set(MY_PROJ_LIBS + dsn_runtime + lz4 + zstd + rocksdb + snappy) #Extra files that will be installed set(MY_BINPLACES "") diff --git a/src/aio/test/CMakeLists.txt b/src/aio/test/CMakeLists.txt index b8d4ad675b..2caa885255 100644 --- a/src/aio/test/CMakeLists.txt +++ b/src/aio/test/CMakeLists.txt @@ -33,7 +33,15 @@ set(MY_PROJ_SRC "") # "GLOB" for non-recursive search set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_PROJ_LIBS gtest dsn_runtime dsn_aio test_utils rocksdb) +set(MY_PROJ_LIBS + gtest + dsn_runtime + dsn_aio + test_utils + lz4 + zstd + rocksdb + snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/block_service/hdfs/CMakeLists.txt b/src/block_service/hdfs/CMakeLists.txt index 2bba8b96bb..d453a0568c 100644 --- a/src/block_service/hdfs/CMakeLists.txt +++ b/src/block_service/hdfs/CMakeLists.txt @@ -26,7 +26,12 @@ set(MY_PROJ_SRC "") #"GLOB" for non - recursive search set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_PROJ_LIBS hdfs rocksdb) +set(MY_PROJ_LIBS + hdfs + lz4 + zstd + rocksdb + snappy) #Extra files that will be installed set(MY_BINPLACES "") diff --git a/src/block_service/local/CMakeLists.txt b/src/block_service/local/CMakeLists.txt index 9d830f7825..0bc44af012 100644 --- a/src/block_service/local/CMakeLists.txt +++ b/src/block_service/local/CMakeLists.txt @@ -26,7 +26,11 @@ set(MY_PROJ_SRC "") #"GLOB" for non - recursive search set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_PROJ_LIBS rocksdb) +set(MY_PROJ_LIBS + lz4 + zstd + rocksdb + snappy) #Extra files that will be installed set(MY_BINPLACES "") diff --git a/src/block_service/test/CMakeLists.txt b/src/block_service/test/CMakeLists.txt index 6fbfa9ca11..dab33febd5 100644 --- a/src/block_service/test/CMakeLists.txt +++ b/src/block_service/test/CMakeLists.txt @@ -22,17 +22,20 @@ set(MY_PROJ_NAME dsn_block_service_test) set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS - dsn_replication_common - dsn.block_service - dsn.block_service.local - dsn.block_service.hdfs - dsn_runtime - dsn_utils - gtest - gtest_main - hdfs - test_utils - rocksdb) + dsn_replication_common + dsn.block_service + dsn.block_service.local + dsn.block_service.hdfs + dsn_runtime + dsn_utils + gtest + gtest_main + hdfs + test_utils + lz4 + zstd + rocksdb + snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/client/test/CMakeLists.txt b/src/client/test/CMakeLists.txt index cfe591ce0f..c4c4e8045e 100644 --- a/src/client/test/CMakeLists.txt +++ b/src/client/test/CMakeLists.txt @@ -22,12 +22,15 @@ set(MY_PROJ_SRC "") set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS - dsn_client - dsn_replication_common - dsn_runtime - dsn_utils - gtest - rocksdb) + dsn_client + dsn_replication_common + dsn_runtime + dsn_utils + gtest + lz4 + zstd + rocksdb + snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/common/test/CMakeLists.txt b/src/common/test/CMakeLists.txt index 9be225417c..6cff0b6268 100644 --- a/src/common/test/CMakeLists.txt +++ b/src/common/test/CMakeLists.txt @@ -30,7 +30,10 @@ set(MY_PROJ_LIBS dsn_replication_common dsn_runtime gtest - rocksdb) + lz4 + zstd + rocksdb + snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/failure_detector/test/CMakeLists.txt b/src/failure_detector/test/CMakeLists.txt index 6bd1e05553..4613eed556 100644 --- a/src/failure_detector/test/CMakeLists.txt +++ b/src/failure_detector/test/CMakeLists.txt @@ -34,14 +34,17 @@ set(MY_PROJ_SRC "") set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS - dsn_runtime - dsn_meta_server - dsn_replica_server - dsn_replication_common - dsn.failure_detector - gtest - hashtable - rocksdb) + dsn_runtime + dsn_meta_server + dsn_replica_server + dsn_replication_common + dsn.failure_detector + gtest + hashtable + lz4 + zstd + rocksdb + snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/geo/bench/CMakeLists.txt b/src/geo/bench/CMakeLists.txt index 6df54a6bcb..e69ef92d65 100644 --- a/src/geo/bench/CMakeLists.txt +++ b/src/geo/bench/CMakeLists.txt @@ -34,9 +34,11 @@ set(MY_PROJ_LIBS s2testing s2 pegasus_client_static - RocksDB::rocksdb - dsn_utils - ) + lz4 + zstd + rocksdb + snappy + dsn_utils) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/http/test/CMakeLists.txt b/src/http/test/CMakeLists.txt index 5ebc142a55..4cf5b44595 100644 --- a/src/http/test/CMakeLists.txt +++ b/src/http/test/CMakeLists.txt @@ -22,12 +22,14 @@ set(MY_PROJ_SRC "") set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS - dsn_http - dsn_runtime - curl - gtest - rocksdb - ) + dsn_http + dsn_runtime + curl + gtest + lz4 + zstd + rocksdb + snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/meta/CMakeLists.txt b/src/meta/CMakeLists.txt index 477671acb3..3898163545 100644 --- a/src/meta/CMakeLists.txt +++ b/src/meta/CMakeLists.txt @@ -34,20 +34,23 @@ set(DUPLICATION_SRC set(MY_PROJ_SRC "${DUPLICATION_SRC}") set(MY_PROJ_LIBS - dsn_replication_common - dsn.block_service - dsn.block_service.local - dsn.block_service.hdfs - dsn.failure_detector - dsn.replication.zookeeper_provider - dsn_dist_cmd - dsn_http - dsn_runtime - dsn_aio - zookeeper - hashtable - hdfs - rocksdb) + dsn_replication_common + dsn.block_service + dsn.block_service.local + dsn.block_service.hdfs + dsn.failure_detector + dsn.replication.zookeeper_provider + dsn_dist_cmd + dsn_http + dsn_runtime + dsn_aio + zookeeper + hashtable + hdfs + lz4 + zstd + rocksdb + snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/nfs/test/CMakeLists.txt b/src/nfs/test/CMakeLists.txt index 0160389925..f9f111d690 100644 --- a/src/nfs/test/CMakeLists.txt +++ b/src/nfs/test/CMakeLists.txt @@ -33,7 +33,16 @@ set(MY_PROJ_SRC "") # "GLOB" for non-recursive search set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_PROJ_LIBS dsn_nfs dsn_runtime gtest dsn_aio rocksdb test_utils) +set(MY_PROJ_LIBS + dsn_nfs + dsn_runtime + gtest + dsn_aio + lz4 + zstd + rocksdb + snappy + test_utils) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/perf_counter/test/CMakeLists.txt b/src/perf_counter/test/CMakeLists.txt index 2e02cf868f..2005cf5c99 100644 --- a/src/perf_counter/test/CMakeLists.txt +++ b/src/perf_counter/test/CMakeLists.txt @@ -33,7 +33,13 @@ set(MY_PROJ_SRC "") # "GLOB" for non-recursive search set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_PROJ_LIBS gtest dsn_runtime rocksdb) +set(MY_PROJ_LIBS + gtest + dsn_runtime + lz4 + zstd + rocksdb + snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/replica/CMakeLists.txt b/src/replica/CMakeLists.txt index fcf7891017..d558e86f13 100644 --- a/src/replica/CMakeLists.txt +++ b/src/replica/CMakeLists.txt @@ -57,19 +57,22 @@ set(MY_PROJ_SRC # "GLOB" for non-recursive search set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_PROJ_LIBS - dsn_replication_common - dsn.failure_detector - dsn.block_service - dsn.block_service.local - dsn.block_service.hdfs - dsn_nfs - dsn_dist_cmd - dsn_http - dsn_runtime - dsn_aio - dsn_meta_server - rocksdb) +set(MY_PROJ_LIBS + dsn_replication_common + dsn.failure_detector + dsn.block_service + dsn.block_service.local + dsn.block_service.hdfs + dsn_nfs + dsn_dist_cmd + dsn_http + dsn_runtime + dsn_aio + dsn_meta_server + lz4 + zstd + rocksdb + snappy) set(MY_BOOST_LIBS Boost::filesystem) diff --git a/src/replica/backup/test/CMakeLists.txt b/src/replica/backup/test/CMakeLists.txt index 47158ca93c..664507c7e3 100644 --- a/src/replica/backup/test/CMakeLists.txt +++ b/src/replica/backup/test/CMakeLists.txt @@ -29,7 +29,10 @@ set(MY_PROJ_LIBS dsn_meta_server dsn_utils hashtable gtest - rocksdb) + lz4 + zstd + rocksdb + snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/replica/bulk_load/test/CMakeLists.txt b/src/replica/bulk_load/test/CMakeLists.txt index 0b0d083851..620c5e0c9c 100644 --- a/src/replica/bulk_load/test/CMakeLists.txt +++ b/src/replica/bulk_load/test/CMakeLists.txt @@ -28,9 +28,12 @@ set(MY_PROJ_LIBS dsn_meta_server hashtable gtest test_utils - rocksdb) + lz4 + zstd + rocksdb + snappy) -set(MY_BOOST_LIBS Boost::system Boost::filesystem rocksdb test_utils) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES config-test.ini diff --git a/src/replica/duplication/test/CMakeLists.txt b/src/replica/duplication/test/CMakeLists.txt index 5cc139f916..9e3723e2dd 100644 --- a/src/replica/duplication/test/CMakeLists.txt +++ b/src/replica/duplication/test/CMakeLists.txt @@ -31,7 +31,10 @@ set(MY_PROJ_LIBS dsn_meta_server hashtable gtest test_utils - rocksdb) + lz4 + zstd + rocksdb + snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/replica/storage/simple_kv/CMakeLists.txt b/src/replica/storage/simple_kv/CMakeLists.txt index 8584848f11..c61dcadf15 100644 --- a/src/replica/storage/simple_kv/CMakeLists.txt +++ b/src/replica/storage/simple_kv/CMakeLists.txt @@ -37,7 +37,16 @@ set(MY_PROJ_SRC ${SIMPLE_KV_THRIFT_SRCS}) # "GLOB" for non-recursive search set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_PROJ_LIBS dsn_replica_server dsn_meta_server dsn_client dsn_runtime hashtable rocksdb) +set(MY_PROJ_LIBS + dsn_replica_server + dsn_meta_server + dsn_client + dsn_runtime + hashtable + lz4 + zstd + rocksdb + snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/replica/storage/simple_kv/test/CMakeLists.txt b/src/replica/storage/simple_kv/test/CMakeLists.txt index a1e0a69b21..f0be3f693e 100644 --- a/src/replica/storage/simple_kv/test/CMakeLists.txt +++ b/src/replica/storage/simple_kv/test/CMakeLists.txt @@ -29,18 +29,22 @@ set(MY_PROJ_NAME dsn.rep_tests.simple_kv) # "GLOB" for non-recursive search set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_PROJ_LIBS dsn_replica_server - dsn_meta_server - dsn_replication_common - dsn_client - dsn.failure_detector - dsn.replication.zookeeper_provider - dsn_runtime - zookeeper - hashtable - gtest - dsn_utils - rocksdb) +set(MY_PROJ_LIBS + dsn_replica_server + dsn_meta_server + dsn_replication_common + dsn_client + dsn.failure_detector + dsn.replication.zookeeper_provider + dsn_runtime + zookeeper + hashtable + gtest + dsn_utils + lz4 + zstd + rocksdb + snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/replica/test/CMakeLists.txt b/src/replica/test/CMakeLists.txt index 83af542d10..590ad5139f 100644 --- a/src/replica/test/CMakeLists.txt +++ b/src/replica/test/CMakeLists.txt @@ -33,21 +33,25 @@ set(MY_PROJ_SRC "") #"GLOB" for non - recursive search set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_PROJ_LIBS dsn_meta_server - dsn_replica_server - dsn.replication.zookeeper_provider - dsn_replication_common - dsn.block_service - dsn.block_service.local - dsn.block_service.hdfs - dsn.failure_detector - dsn_http - dsn_runtime - zookeeper - hashtable - gtest - test_utils - rocksdb) +set(MY_PROJ_LIBS + dsn_meta_server + dsn_replica_server + dsn.replication.zookeeper_provider + dsn_replication_common + dsn.block_service + dsn.block_service.local + dsn.block_service.hdfs + dsn.failure_detector + dsn_http + dsn_runtime + zookeeper + hashtable + gtest + test_utils + lz4 + zstd + rocksdb + snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/runtime/test/CMakeLists.txt b/src/runtime/test/CMakeLists.txt index cd5e0daac8..689610f6f3 100644 --- a/src/runtime/test/CMakeLists.txt +++ b/src/runtime/test/CMakeLists.txt @@ -29,12 +29,15 @@ set(MY_PROJ_NAME dsn_runtime_tests) # "GLOB" for non-recursive search set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_PROJ_LIBS gtest - dsn_runtime - dsn_aio - dsn_meta_server - rocksdb - ) +set(MY_PROJ_LIBS + gtest + dsn_runtime + dsn_aio + dsn_meta_server + lz4 + zstd + rocksdb + snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt index ff48c181e3..56adc8d2a2 100644 --- a/src/server/CMakeLists.txt +++ b/src/server/CMakeLists.txt @@ -27,22 +27,24 @@ set(MY_PROJ_SRC "") set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS - dsn_replica_server - dsn_meta_server - dsn_replication_common - dsn_client - dsn.block_service.local - dsn.block_service - dsn.failure_detector - dsn.replication.zookeeper_provider - dsn_utils - RocksDB::rocksdb - pegasus_reporter - pegasus_base - pegasus_client_static - event - hashtable - ) + dsn_replica_server + dsn_meta_server + dsn_replication_common + dsn_client + dsn.block_service.local + dsn.block_service + dsn.failure_detector + dsn.replication.zookeeper_provider + dsn_utils + lz4 + zstd + rocksdb + snappy + pegasus_reporter + pegasus_base + pegasus_client_static + event + hashtable) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/server/test/CMakeLists.txt b/src/server/test/CMakeLists.txt index e9b9200f3e..0af2682480 100644 --- a/src/server/test/CMakeLists.txt +++ b/src/server/test/CMakeLists.txt @@ -46,7 +46,10 @@ set(MY_PROJ_LIBS dsn.replication.zookeeper_provider dsn_utils pegasus_reporter - RocksDB::rocksdb + lz4 + zstd + rocksdb + snappy pegasus_client_static event pegasus_base diff --git a/src/shell/CMakeLists.txt b/src/shell/CMakeLists.txt index 909fda9ab6..00fb6d6834 100644 --- a/src/shell/CMakeLists.txt +++ b/src/shell/CMakeLists.txt @@ -28,25 +28,27 @@ set(MY_PROJ_SRC "linenoise/linenoise.c" "sds/sds.c") set(MY_SRC_SEARCH_MODE "GLOB_RECURSE") set(MY_PROJ_LIBS - pegasus_base - dsn.replication.tool - dsn_replica_server - dsn_meta_server - dsn_replication_common - dsn_client - dsn_utils - dsn.block_service.local - dsn.block_service.hdfs - dsn.block_service - dsn.failure_detector - pegasus_client_static - pegasus_geo_lib - RocksDB::rocksdb - absl::flat_hash_set - absl::strings - s2 - hdfs - ) + pegasus_base + dsn.replication.tool + dsn_replica_server + dsn_meta_server + dsn_replication_common + dsn_client + dsn_utils + dsn.block_service.local + dsn.block_service.hdfs + dsn.block_service + dsn.failure_detector + pegasus_client_static + pegasus_geo_lib + lz4 + zstd + rocksdb + snappy + absl::flat_hash_set + absl::strings + s2 + hdfs) set(MY_BINPLACES "${CMAKE_CURRENT_SOURCE_DIR}/config.ini") diff --git a/src/test/bench_test/CMakeLists.txt b/src/test/bench_test/CMakeLists.txt index 307d543d09..5fe5b58e33 100644 --- a/src/test/bench_test/CMakeLists.txt +++ b/src/test/bench_test/CMakeLists.txt @@ -30,11 +30,13 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS pegasus_client_static dsn_utils - RocksDB::rocksdb + lz4 + zstd + rocksdb + snappy sasl2 gssapi_krb5 - krb5 - ) + krb5) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/test/function_test/bulk_load/CMakeLists.txt b/src/test/function_test/bulk_load/CMakeLists.txt index f9f1976491..f94a04ebcd 100644 --- a/src/test/function_test/bulk_load/CMakeLists.txt +++ b/src/test/function_test/bulk_load/CMakeLists.txt @@ -28,17 +28,20 @@ set(MY_PROJ_SRC "") set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS - dsn_client - dsn_replication_common - dsn_utils - pegasus_client_static - gtest - sasl2 - gssapi_krb5 - krb5 - function_test_utils - test_utils - rocksdb) + dsn_client + dsn_replication_common + dsn_utils + pegasus_client_static + gtest + sasl2 + gssapi_krb5 + krb5 + function_test_utils + test_utils + lz4 + zstd + rocksdb + snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/test_util/CMakeLists.txt b/src/test_util/CMakeLists.txt index b1e7ac2dff..da831a6d10 100644 --- a/src/test_util/CMakeLists.txt +++ b/src/test_util/CMakeLists.txt @@ -22,6 +22,11 @@ set(MY_PROJ_NAME test_utils) # "GLOB" for non-recursive search set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_PROJ_LIBS gtest rocksdb) +set(MY_PROJ_LIBS + gtest + lz4 + zstd + rocksdb + snappy) dsn_add_static_library() diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt index e9129fa51f..acc9f7b91d 100644 --- a/src/utils/CMakeLists.txt +++ b/src/utils/CMakeLists.txt @@ -31,7 +31,12 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_BOOST_LIBS Boost::system Boost::filesystem) -set(MY_PROJ_LIBS dsn_http rocksdb) +set(MY_PROJ_LIBS + dsn_http + lz4 + zstd + rocksdb + snappy) # Extra files that will be installed set(MY_BINPLACES "") diff --git a/src/utils/long_adder_bench/CMakeLists.txt b/src/utils/long_adder_bench/CMakeLists.txt index d5ace78cac..a775eba4a3 100644 --- a/src/utils/long_adder_bench/CMakeLists.txt +++ b/src/utils/long_adder_bench/CMakeLists.txt @@ -27,7 +27,13 @@ set(MY_PROJ_SRC "") # "GLOB" for non-recursive search set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_PROJ_LIBS dsn_runtime dsn_utils rocksdb) +set(MY_PROJ_LIBS + dsn_runtime + dsn_utils + lz4 + zstd + rocksdb + snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/utils/test/CMakeLists.txt b/src/utils/test/CMakeLists.txt index 684a5faaf0..d2c33a10c3 100644 --- a/src/utils/test/CMakeLists.txt +++ b/src/utils/test/CMakeLists.txt @@ -29,12 +29,16 @@ set(MY_PROJ_NAME dsn_utils_tests) # "GLOB" for non-recursive search set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_PROJ_LIBS dsn_http - dsn_runtime - dsn_utils - gtest - test_utils - rocksdb) +set(MY_PROJ_LIBS + dsn_http + dsn_runtime + dsn_utils + gtest + test_utils + lz4 + zstd + rocksdb + snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/utils/test/nth_element_bench/CMakeLists.txt b/src/utils/test/nth_element_bench/CMakeLists.txt index 7bf0af804b..e0876cee51 100644 --- a/src/utils/test/nth_element_bench/CMakeLists.txt +++ b/src/utils/test/nth_element_bench/CMakeLists.txt @@ -27,7 +27,13 @@ set(MY_PROJ_SRC "") # "GLOB" for non-recursive search set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_PROJ_LIBS dsn_runtime dsn_utils rocksdb) +set(MY_PROJ_LIBS + dsn_runtime + dsn_utils + lz4 + zstd + rocksdb + snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/zookeeper/test/CMakeLists.txt b/src/zookeeper/test/CMakeLists.txt index cdb6d4cec2..426244151d 100644 --- a/src/zookeeper/test/CMakeLists.txt +++ b/src/zookeeper/test/CMakeLists.txt @@ -33,13 +33,16 @@ set(MY_PROJ_SRC "") # "GLOB" for non-recursive search set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_PROJ_LIBS - dsn.replication.zookeeper_provider - dsn_runtime - zookeeper - hashtable - gtest - rocksdb) +set(MY_PROJ_LIBS + dsn.replication.zookeeper_provider + dsn_runtime + zookeeper + hashtable + gtest + lz4 + zstd + rocksdb + snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index e95e24f83e..7f0cad4ff0 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -361,6 +361,34 @@ ExternalProject_Add(jemalloc DOWNLOAD_NO_PROGRESS true ) +set(SNAPPY_OPTIONS + -DCMAKE_INSTALL_PREFIX=${TP_OUTPUT} + -DCMAKE_POSITION_INDEPENDENT_CODE=ON + -DBUILD_SHARED_LIBS=OFF + -DSNAPPY_BUILD_TESTS=OFF + -DSNAPPY_BUILD_BENCHMARKS=OFF + -DSNAPPY_FUZZING_BUILD=OFF + -DSNAPPY_INSTALL=ON) +execute_process(COMMAND arch OUTPUT_VARIABLE ARCH_NAME OUTPUT_STRIP_TRAILING_WHITESPACE) +message(STATUS "ARCH_NAME = ${ARCH_NAME}") +if (ARCH_NAME EQUAL "x86_64") + set(SNAPPY_OPTIONS + ${SNAPPY_OPTIONS} + -DSNAPPY_REQUIRE_AVX=ON + -DSNAPPY_REQUIRE_AVX2=ON) +endif () +ExternalProject_Add(snappy + URL ${OSS_URL_PREFIX}/snappy-1.1.10.tar.gz + https://github.com/google/snappy/archive/refs/tags/1.1.10.tar.gz + URL_MD5 70153395ebe6d72febe2cf2e40026a44 + PATCH_COMMAND "" + CMAKE_ARGS ${SNAPPY_OPTIONS} + BUILD_COMMAND make -j${PARALLEL} + INSTALL_COMMAND make install + DOWNLOAD_EXTRACT_TIMESTAMP true + DOWNLOAD_NO_PROGRESS true +) + option(ROCKSDB_PORTABLE "Minimum CPU arch to support, or 0 = current CPU, 1 = baseline CPU" 0) set(ROCKSDB_OPTIONS -DFAIL_ON_WARNINGS=OFF @@ -373,6 +401,8 @@ set(ROCKSDB_OPTIONS -DWITH_TESTS=OFF -DWITH_GFLAGS=OFF -DUSE_RTTI=ON + -DROCKSDB_BUILD_SHARED=OFF + -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release -DWITH_JEMALLOC=${USE_JEMALLOC} -DJEMALLOC_ROOT_DIR=${TP_OUTPUT}