-
Notifications
You must be signed in to change notification settings - Fork 751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new preset for libpostal #499
Comments
Could you try to follow these instructions? |
Yes i did, but i am missing deeper knowlledge on what a autoreconfig does. I need help if the default build instructions from libpostal do not work within the preset setup. I see forgot to push my latest state to the branch yesterday. |
|
If i use these methods in the JavaCPP generated class from my branch for libpostal the software locks up or a access violation gets thrown:
Trying to convert these methods from byte[] to String type with the following Info:
resulted in: C:\msys64\home\betzm\javacpp-presets-libpostal\libpostal\target\classes\org\bytedeco\javacpp\jnilibpostal.cpp(2606): error C2440: '=': cannot convert from 'char **' to 'const char *' Is it possible to do this? |
Thanks for reporting! I've fixed this issue in the commit above, so make sure to use JavaCPP 1.3.4-SNAPSHOT. You also had an issue running Autoconf through JavaCPP on Windows, right? Could you give me something to reproduce that here? Thanks! |
Doing the libpostal Windows mingw64 shell c build as explaind here via the console, all goes well. As soon as i do the Maven preset build with the same build.sh instructions it blows up on executing the bootstrap.sh containing aclocal-1.15: error: aclocal: file '/msys64/usr/share/aclocal/xsize.m4' does not exist The file xsize.m4 is located at where the above path is pointing. |
And would you have a cppbuild.sh script that fails in that way somewhere?
|
This put me on the right track resulting in: if [[ -z "$PLATFORM" ]]; then
pushd ..
bash cppbuild.sh "$@" libpostal
popd
exit
fi
echo "downloading libpostal"
LIBPOSTAL_VERSION=master
download https://github.com/openvenues/libpostal/archive/$LIBPOSTAL_VERSION.tar.gz libpostal-$LIBPOSTAL_VERSION.tar.gz
echo "unpacking libpostal"
mkdir -p $PLATFORM
cd $PLATFORM
tar -xzvf ../libpostal-$LIBPOSTAL_VERSION.tar.gz
cd libpostal-$LIBPOSTAL_VERSION
case $PLATFORM in
windows-x86_64)
echo "Starting windows-x86_64 build"
cp -rf windows/* ./
cwd=$(pwd)
bash -lc "cd $cwd && autoreconf -fi --warning=no-portability"
#./configure --datadir=/c
./configure --disable-data-download
make -j4
make install
;;
*)
echo "Error: Platform \"$PLATFORM\" is not supported"
;;
esac
cd ../.. |
Thanks! Yeah, it's happening here as well. Not sure why, seems to be a bug in MSYS2. Running it with |
I got MacOS 10 running on my vmware machine today, maybee i can provide and test libpostal mac builds as well. |
BTW, when you're ready to send a pull request, please rebase your fork on the master branch (currently 1.3.4-SNAPSHOT), thanks! |
Of course, did that yesterday already, now i am having issues with the Centos 7 libpostal build. How do i deal with pkg-config and JavaCPP? |
It should be installed by default. What is the problem?
|
Package libpostal was not found in the pkg-config search path. |
Well, we're supposed to be building it from source in |
That is what i am trying to do: case $PLATFORM in gives me: [INFO] g++ -I/home/mbetzel/IdeaProjects/javacpp-presets/libpostal/cppbuild/linux-x86_64/include/ -I/usr/java/jdk1.8.0_121/include -I/usr/java/jdk1.8.0_121/include/linux /home/mbetzel/IdeaProjects/javacpp-presets/libpostal/target/classes/org/bytedeco/javacpp/jnilibpostal.cpp /home/mbetzel/IdeaProjects/javacpp-presets/libpostal/target/classes/org/bytedeco/javacpp/jnijavacpp.cpp -march=x86-64 -m64 -O3 -s -Wl,-rpath,$ORIGIN/ -Wl,-z,noexecstack -Wl,-Bsymbolic -Wall -fPIC -shared -o libjnilibpostal.so -llibpostal |
The default build from the console gives me working libpostal software. What does JavaCPP need to wrap this? |
You'll need to install the C++ compiler of GCC as well: |
Oh boy, i did follow all of the instructions, but g++ was still missing somehow. A clear case of RTFE (read the f***** exception), trying to run too fast. Next issue: [INFO] g++ -I/home/mbetzel/IdeaProjects/javacpp-presets/libpostal/cppbuild/linux-x86_64/include/ -I/usr/java/jdk1.8.0_121/include -I/usr/java/jdk1.8.0_121/include/linux /home/mbetzel/IdeaProjects/javacpp-presets/libpostal/target/classes/org/bytedeco/javacpp/jnilibpostal.cpp /home/mbetzel/IdeaProjects/javacpp-presets/libpostal/target/classes/org/bytedeco/javacpp/jnijavacpp.cpp -march=x86-64 -m64 -O3 -s -Wl,-rpath,$ORIGIN/ -Wl,-z,noexecstack -Wl,-Bsymbolic -Wall -fPIC -shared -o libjnilibpostal.so -llibpostal |
Switched off ldconfig, results in [INFO] Building for platform "linux-x86_64" I am way out of my comfort zone here... |
Switched back on include mkdir and libpostal.h copy to it, resulted in: [INFO] --- javacpp:1.3.4-SNAPSHOT:build (javacpp.parser) @ libpostal --- |
Am i missing the file for linking? And where do i get it from? |
i copy the libpostal.a in the lib folder but with the same result. What am i missing? |
Trying to link against the so file from the .libs folder.... |
I copied the whole generated .libs folder into the linux-x86_64/lib folder, with the same result: /IdeaProjects/javacpp-presets |
If i manually compile like this i get my libjnilibpostal.so: g++ -I/home/mbetzel/IdeaProjects/javacpp-presets/libpostal/cppbuild/linux-x86_64/include/ -I/usr/java/jdk1.8.0_121/include -I/usr/java/jdk1.8.0_121/include/linux /home/mbetzel/IdeaProjects/javacpp-presets/libpostal/target/classes/org/bytedeco/javacpp/jnilibpostal.cpp /home/mbetzel/IdeaProjects/javacpp-presets/libpostal/target/classes/org/bytedeco/javacpp/jnijavacpp.cpp -march=x86-64 -m64 -O3 -s -Wl,-rpath,$ORIGIN/ -Wl,-z,noexecstack -Wl,-Bsymbolic -Wall -fPIC -shared -o libjnilibpostal.so -L/home/mbetzel/IdeaProjects/javacpp-presets/libpostal/cppbuild/linux-x86_64/lib/ -Wl,-rpath,/home/mbetzel/IdeaProjects/javacpp-presets/libpostal/cppbuild/linux-x86_64/lib/ -lpostal |
lovin this one: |
Usually "make install" will do what we need. I designed it like that. Check the other presets, for example: |
I have studied the default setup, but it was not working. A working and tested build is now up. Hoping the mac build will be nearly the same :) |
I have added and tested the MacOS build and i am ready for a pull request. Could you take a look at the setup and report anything missing? |
Released! |
I have started working on a libpostal preset. libpostal is a C library for parsing/normalizing street addresses around the world using statistical NLP and open data. I have created a branch but i got stuck pretty fast on the compile part, see mailinglist. Libpostal also carries huge blobs of trainingdata that is in need of a javacpp strategy. The lib is functional on my msys win10 x64 default console setup. I am hoping for somebody to provide a similar example i can study, or even some support.
The text was updated successfully, but these errors were encountered: