简体   繁体   English

如何从Redis源代码创建共享库或静态库?

[英]How to create a shared or static library from redis source code?

I am trying to invoke redis functions from Java using JNI. 我正在尝试使用JNI从Java调用redis函数。 Due to some performance reasons, I can't use redis java client. 由于性能原因,我不能使用redis java客户端。 I have to interact directly with redis server side source code. 我必须直接与Redis服务器端源代码进行交互。 But even the first step seems difficult for me. 但是,即使第一步对我来说似乎也很困难。 In JNI, it must load a native library while redis doesn't have such library like "libredis.so" or "libredis.a". 在JNI中,它必须加载本机库,而redis没有像“ libredis.so”或“ libredis.a”这样的库。

I tried to create a static library using ar command. 我尝试使用ar命令创建静态库。 But it can't work properly, because it has some other dependency directories. 但是它不能正常工作,因为它还有一些其他依赖项目录。

Any suggestions? 有什么建议么?

Thanks 谢谢

You can get hiredis from here , if that's what you mean. 如果您的意思是这样,您可以从这里获得hiredis Build it as a shared object, pay attention to the required memory architecture. 将其构建为共享对象,请注意所需的内存体系结构。

"interact directly with redis server side source code" “直接与Redis服务器端源代码进行交互”

This line confuses me a bit, but I think I'm steering you in the right direction. 这条线让我有些困惑,但是我认为我正在朝正确的方向指路。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM