error while loading shared libraries: libsnappy.so.1

GitHub - google/snappy: A fast compressor/decompressor

下载源代码:

git clone --recursive https://github.com/google/snappy.git
cd snappy
git submodule update --init

修改CMakeLists.txt下面的行,如果cpu不是太老的话,特别是 AVX2的支持:

option(BUILD_SHARED_LIBS "Build shared libraries(DLLs)." ON)

option(SNAPPY_BUILD_TESTS "Build Snappy's own tests." ON)

option(SNAPPY_BUILD_BENCHMARKS "Build Snappy's benchmarks" ON)

option(SNAPPY_FUZZING_BUILD "Build Snappy for fuzzing." OFF)

option(SNAPPY_REQUIRE_AVX "Target processors with AVX support." ON)

option(SNAPPY_REQUIRE_AVX2 "Target processors with AVX2 support." ON)

option(SNAPPY_INSTALL "Install Snappy's header and library" ON)

编译:

mkdir build
cd build && cmake  -DCMAKE_INSTALL_PREFIX="/usr"  ../ && make

安装:

sudo make install

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐