diff --git a/.travis.yml b/.travis.yml index 2b3f5ea..fa19d52 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ +dist: precise language: java branches: only: @@ -15,6 +16,10 @@ addons: - libsnappy-dev - realpath before_install: + - cat /etc/hosts # optionally check the content *before* + - sudo hostname "$(hostname | cut -c1-63)" + - sed -e "s/^\\(127\\.0\\.0\\.1.*\\)/\\1 $(hostname | cut -c1-63)/" /etc/hosts | sudo tee /etc/hosts + - cat /etc/hosts # optionally check the content *after* - export CC="gcc-4.8" - mkdir deps - git clone https://github.com/openvenues/libpostal diff --git a/README.md b/README.md index 1bbec33..7470544 100644 --- a/README.md +++ b/README.md @@ -60,16 +60,17 @@ sudo yum install curl autoconf automake libtool pkgconfig **On Mac OSX** ``` -sudo brew install curl autoconf automake libtool pkg-config +brew install curl autoconf automake libtool pkg-config ``` **Installing libpostal** -``` +```shell git clone https://github.com/openvenues/libpostal cd libpostal ./bootstrap.sh ./configure --datadir=[...some dir with a few GB of space...] + make sudo make install @@ -79,6 +80,29 @@ sudo ldconfig Note: libpostal >= v0.3.3 is required to use this binding. +Make sure pkg-config can find libpostal +--------------------------------------- + +Some users have reported issues with the jpostal build related to pkg-config. + +For jpostal to build, make sure this command runs without any errors: + +```shell +pkg-config --cflags --libs libpostal +``` + +If you get a message like `No package 'libpostal' found`, try the following: + +```shell +export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig +``` + +Try the `pkg-config --cflags --libs libpostal` command again. If it still can't find libpostal, return to the libpostal checkout directory and try: + +```shell +export PKG_CONFIG_PATH=$(pwd) +``` + Building jpostal ---------------- @@ -90,8 +114,6 @@ Only one command is needed: This will implicitly run [build.sh](./build.sh) which automatically runs the Autotools build for the JNI/C portion of the library and installs the resulting shared libraries in the expected location for java.library.path -On RHEL it might be necessary to set ```PKG_CONFIG_PATH=/usr/lib/pkgconfig``` before running the gradle build. - Usage in a Java project -----------------------