openvenues / jpostal

Java/JNI bindings to libpostal for for fast international street address parsing/normalization
MIT License
105 stars 42 forks source link

Tests failing to link #20

Closed mkaranta closed 7 years ago

mkaranta commented 7 years ago

When I run the tests using ./gradle check or as a unit test in IntelliJ I get: java.lang.UnsatisfiedLinkError: /home/<>/jpostal/src/main/jniLibs/libjpostal_expander.so.0.0.0: libpostal.so.1: cannot open shared object file: No such file or directory

The files are there and libpostal works.

So far I've tried cleaning out and reinstalling the libpostal libraries, explicitly pointing to /usr/local/lib, and a few other things but no hints as to why it's not being found.

Building on Linux btw.

albarrentine commented 7 years ago

You need to set java.library.path to include src/main/jniLibs for running the tests, see the Travis build

Also, is "/home/<>" a real directory on your machine? That's a valid directory name I suppose, but it seems like it might need to be escaped.

mkaranta commented 7 years ago

I have been using -Djava.library.path="/home/myname/jpostal/src/main/jniLibs" since the pre-1.0 days and the tests were working then (both in gradle and IDE).

Woops, <> was a placeholder. I meant to put myname there. It's been a few years since I used C and someone else always took care of writing the make files. It would seem I squandered my education on silly things like algorithm optimization and mathematical proofs.

mkaranta commented 7 years ago

It was the old "Have you tried turning it off and on again?" I think one of my environment variables must have been misconfigured at some point.