No description
Find a file
2023-01-15 15:36:54 +01:00
minmax-java port to java 2023-01-15 15:36:54 +01:00
minmax-rs works 2023-01-14 20:05:30 +01:00
rs-wrapper works 2023-01-14 16:03:33 +01:00
.gitignore works 2023-01-09 11:01:35 +01:00
build_and_run.sh INSTRUCTIONS 2023-01-14 16:13:58 +01:00
Cargo.lock works 2023-01-14 16:03:33 +01:00
Cargo.toml jni 2023-01-09 10:01:17 +01:00
README.md INSTRUCTIONS 2023-01-14 16:13:58 +01:00

Minmax in Rust with JNI

How to build and run

On Linux

Run ./build_and_run.sh to build the Rust library and run the Java tests with it.

If you want to use it in another project (for example, because you copied RustPlayer to your project to test it) then you need a little bit of extra setup. You need to make sure that you set the LD_LIBRARY_PATH environment variable to the what is printed at the end of the script. Then everything will be fine.

If you don't like setting LD_LIBRARY_PATH then you can also run sudo cp target/release/libminmax_wrapper.so /usr/lib/x86_64-linux-gnu/jni/ (if you're not on GNU/Linux because you use Alpine on your desktop, Iglunix or whatever crazy things people are doing these days) replace the x86_64-linux-gnu with your target triplet, but you are probably on GNU/Linux and don't need to worry about this and if you aren't you know all of this stuff anyways). After running the command you can just run RustPlayer without any setup. And your global Java native libs will be polluted forever. Or until you run sudo rm /usr/lib/x86_64-linux-gnu/jni/libminmax_wrapper.so.

On MacOS

It should probably the same as linux? except for the cp part apples native library layout is different. but actually the error message will tell you where it looks so you can just copy it there i think? havent tested it

On Windows

you're on your own but you can do this, it's similar to linux except you have to run cargo build --release yourself and have to target/release/minmax_wrapper.dll to the directories where the other library are (the link error message will tell you where that is)