[英]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.