How to build the rocksdbjni jar

24 views
Skip to first unread message

Nicolae Mihalache

unread,
Jun 13, 2024, 7:31:44 AMJun 13
to rocksdb
Hello,

I need a custom merge operator to use in java and I think my only option now is to produce my own rocksdbjni jar incorporating the operator as part of a modified rocksdb library.

I looked into the Makefile and although I can see some code that is supposed to build that jar comprising multiple so files (for diferent architectures), I don't understand how to build it. In particular there is nothing to build the win64 although it is referenced in the Makefile.

Can someone explain?

thanks
nicolae

Adam Retter

unread,
Jun 13, 2024, 9:34:00 AMJun 13
to rocksdb
The Makefile is used for non-Windows builds, e.g. `make rocksdbjavastatic`
If you want to build portable binaries for a bunch of platforms (except Windows) follow the instructions in java/RELEASE/.md, e.g.: rocksdbjavastaticreleasedocker

For Windows builds, CMake is used instead of Make, you can find the build instructions on the RocksDB Wiki - https://github.com/facebook/rocksdb/wiki/Building-on-Windows

Thanks, Adam.

Nicolae Mihalache

unread,
Jun 13, 2024, 10:41:27 AMJun 13
to Adam Retter, rocksdb
Thanks Adam.

Do you have some suggestions on the best way to have my custom merge operator built into that jar?

Should I build it in the rocksdbjni.so or should I make my own so separated from rocksdb?

--
You received this message because you are subscribed to the Google Groups "rocksdb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rocksdb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rocksdb/f51ca710-66bf-4c74-a0fc-176468b7de18n%40googlegroups.com.

Nicolae Mihalache

unread,
Jun 23, 2024, 12:26:20 AM (11 days ago) Jun 23
to Adam Retter, rocksdb
Hello, I have another question: I see the rocksdbjni so libraries published through maven are statically linked whereas if I run make rocksdbjavastatic I get a library dependent on libc and others:
ldd ./java/target/librocksdbjni-linux64.so
       linux-vdso.so.1 (0x00007fff527ab000)
       libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f855a600000)
       libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f855a919000)
       libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f855b70f000)
       libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f855a200000)
       /lib64/ld-linux-x86-64.so.2 (0x00007f855b757000)

How do I get a library similar with the one published on maven?

thanks for any hint

Adam Retter

unread,
Jun 27, 2024, 6:23:09 PM (6 days ago) Jun 27
to Nicolae Mihalache, rocksdb
I am pretty sure that the ones on Maven central are also dependent on
libc - if I recall, that is normal for our statically linked binaries.
It's the 3rd-party libraries that get statically linked in (zstd,
snappy, bzip2, lz, etc)
--
Adam Retter

skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk
Reply all
Reply to author
Forward
0 new messages