简体   繁体   English

RocksDB中的可移植二进制文件

[英]Portable binary in RocksDB

I compile my code using the following set of flags 我使用以下标志集来编译代码

    LIBS += $(EXT_DIR)/librocksdb.a -lrt -lsnappy -llz4 -lz

where librocksdb.a is generated by librocksdb.a的生成位置

    PORTABLE=1 make static_lib 

I need to ship the binary to several tens of machines (all are ec2 machines with the same set of packages installed, same code/directory organisation structure). 我需要将二进制文件运送到数十台计算机(所有都是安装了相同软件包集,相同代码/目录组织结构的ec2计算机)。

When I try to run the code however (on the remote machine, not on the local one, where it works fine), I get the following error 但是,当我尝试运行代码时(在远程计算机上,而不是在本地计算机上,它可以正常运行),出现以下错误

Error in RockDB: Compression type Snappy is not linked with the binary.

When I compile remotely and use the binary from there, it also works fine. 当我远程编译并从那里使用二进制文件时,它也可以正常工作。 Libsnappy is installed on both machines. Libsnappy已安装在两台计算机上。

Any thoughts on how I can fix this error and generate a binary that can be executed on multiple machines? 关于如何解决此错误并生成可以在多台计算机上执行的二进制文件的任何想法?

Use ldd ./yourapplication to check the library dependency on the remote machine. 使用ldd ./yourapplication检查远程计算机上的库依赖关系。

Or build & install static snappy library before build your application. 或在构建应用程序之前构建并安装静态快照库。

I did this on an old machine, it works. 我是在一台旧机器上完成此操作的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 签名的二进制表示形式可以在体系结构之间移植吗? - Are signed binary representations portable between architectures? 二进制文件如何在C编程中可移植? - How binary file can be portable in C programming? Linux C ++可移植二进制问题 - Linux c++ portable binary issue 这个便携吗? - Is this portable? 如何使用std :: fstream以可移植的方式处理二进制文件? - How to handle binary files in a portable way using std::fstream? 将浮点数转换为 bigint(即获取二进制指数和尾数的便携式方法) - Convert float to bigint (aka portable way to get binary exponent & mantissa) boost :: serialization - 有一种可移植的方式来二进制序列化std :: wstrings吗? - boost::serialization - is there a portable way to binary-serialize std::wstrings? C ++二进制代码可以通过本机C接口移植吗? 有什么限制? - Can C++ binary code become portable through a native C interface? What are the limitations? FlatBuffers/Protobuf 中是否有支持任意 24 位有符号整数定义的可移植二进制序列化模式? - Is there a portable Binary-serialisation schema in FlatBuffers/Protobuf that supports arbitrary 24bit signed integer definitions? 向rocksdb写入缓冲区(void *) - Writing a buffer (void*) to rocksdb
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM