Skip to content
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

Introduce linux-arm64 to presets for libpostal #1199

Merged
merged 3 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/libpostal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ env:
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
STAGING_REPOSITORY: ${{ secrets.STAGING_REPOSITORY }}
jobs:
linux-arm64:
runs-on: ubuntu-18.04
container: ubuntu:bionic
steps:
- uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
linux-x86_64:
runs-on: ubuntu-18.04
container: centos:7
Expand All @@ -29,7 +34,7 @@ jobs:
steps:
- uses: bytedeco/javacpp-presets/.github/actions/deploy-windows@actions
redeploy:
needs: [linux-x86_64, macosx-x86_64, windows-x86_64]
needs: [linux-arm64, linux-x86_64, macosx-x86_64, windows-x86_64]
runs-on: ubuntu-18.04
steps:
- uses: bytedeco/javacpp-presets/.github/actions/redeploy@actions
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ jobs:
env: PROJ=fftw,gsl OS=android-arm64
install: true
script: ./ci/install-travis.sh
- os: linux
env: PROJ=libpostal OS=linux-arm64
install: true
script: ./ci/install-arm.sh
- os: linux
env: PROJ=leptonica,tesseract OS=android-arm64
install: true
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

* Introduce `linux-arm64` to presets for libpostal ([pull #1199](https://github.com/bytedeco/javacpp-presets/pull/1199))
* Map missing factory functions in `torch::` namespace using `torch_` as prefix in presets for PyTorch ([issue #1197](https://github.com/bytedeco/javacpp-presets/issues/1197))
* Add presets for the nvJPEG module of CUDA ([issue #1193](https://github.com/bytedeco/javacpp-presets/issues/1193))
* Introduce Android builds for TensorFlow Lite ([discussion #1180](https://github.com/bytedeco/javacpp-presets/discussions/1180))
Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,25 @@ With the above in working order, the scripts get launched automatically as part
```bash
$ ANDROID_NDK=/path/to/android-ndk/ bash cppbuild.sh [-platform <name>] [-extension <name>] <install | clean> [projects]
```
where possible platform names are: `android-arm`, `android-x86`, `linux-x86`, `linux-x86_64`, `linux-armhf`, `linux-ppc64le`, `linux-mips64el`, `macosx-x86_64`, `windows-x86`, `windows-x86_64`, etc. The `-gpu` extension as supported by some builds also require CUDA to be installed. (The `ANDROID_NDK` variable is required only for Android builds.) Please note that the scripts download source archives from appropriate sites as necessary.
where possible platform names are:

* `android-arm`
* `android-arm64`
* `android-x86`
* `android-x86_64`
* `ios-arm64`
* `ios-x86_64`
* `linux-armhf`
* `linux-arm64`
* `linux-ppc64le`
* `linux-x86`
* `linux-x86_64`
* `macosx-arm64`
* `macosx-x86_64`
* `windows-x86`
* `windows-x86_64`

The `-gpu` extension as supported by some builds also require CUDA to be installed. (The `ANDROID_NDK` variable is required only for Android builds.) Please note that the scripts download source archives from appropriate sites as necessary.

To compile binaries for an Android device with no FPU, first make sure this is what you want. Without FPU, the performance of either OpenCV or FFmpeg is bound to be unacceptable. If you still wish to continue down that road, then replace "armeabi-v7a" by "armeabi" and "-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16" with "-march=armv5te -mtune=xscale -msoft-float", inside various files.

Expand Down
9 changes: 8 additions & 1 deletion libpostal/cppbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if [[ -z "$PLATFORM" ]]; then
fi

LIBPOSTAL_VERSION=1.1
download https://github.com/openvenues/libpostal/archive/v$LIBPOSTAL_VERSION.tar.gz libpostal-$LIBPOSTAL_VERSION.tar.gz
download https://github.com/openvenues/libpostal/archive/refs/tags/v$LIBPOSTAL_VERSION.tar.gz libpostal-$LIBPOSTAL_VERSION.tar.gz

mkdir -p $PLATFORM
cd $PLATFORM
Expand All @@ -26,6 +26,13 @@ sedinplace 's/-Werror=format-security/-Wno-implicit-function-declaration/g' src/
sedinplace '/_rand48_/d' src/klib/drand48.h

case $PLATFORM in
linux-arm64)
./bootstrap.sh
./configure --prefix=$INSTALL_PATH --disable-data-download --disable-sse2 --host=aarch64-linux-gnu
#./configure --prefix=$INSTALL_PATH --datadir=[...some dir with a few GB of space...]
make -j $MAKEJ V=0
make install
;;
linux-x86_64)
./bootstrap.sh
./configure --prefix=$INSTALL_PATH --disable-data-download
Expand Down
9 changes: 8 additions & 1 deletion libpostal/platform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
<artifactId>${javacpp.moduleId}</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>${javacpp.moduleId}</artifactId>
<version>${project.version}</version>
<classifier>${javacpp.platform.linux-arm64}</classifier>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>${javacpp.moduleId}</artifactId>
Expand Down Expand Up @@ -60,7 +66,7 @@
<configuration>
<archive>
<manifestEntries>
<Class-Path>${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-macosx-x86_64.jar ${javacpp.moduleId}-windows-x86_64.jar</Class-Path>
<Class-Path>${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-arm64.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-macosx-x86_64.jar ${javacpp.moduleId}-windows-x86_64.jar</Class-Path>
</manifestEntries>
</archive>
</configuration>
Expand Down Expand Up @@ -105,6 +111,7 @@
<file>${project.build.directory}/${project.artifactId}.jar</file>
<moduleInfoSource>
module org.bytedeco.${javacpp.moduleId}.platform {
requires static org.bytedeco.${javacpp.moduleId}.linux.arm64;
requires static org.bytedeco.${javacpp.moduleId}.linux.x86_64;
requires static org.bytedeco.${javacpp.moduleId}.macosx.x86_64;
requires static org.bytedeco.${javacpp.moduleId}.windows.x86_64;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
inherit = javacpp.class,
value = {
@Platform(
value = {"linux-x86_64", "macosx-x86_64", "windows-x86_64"},
value = {"linux-arm64", "linux-x86_64", "macosx-x86_64", "windows-x86_64"},
cinclude = "libpostal/libpostal.h",
link = "postal@.1",
preload = "libpostal-1"
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1190,6 +1190,7 @@
<module>llvm</module>
<module>libffi</module>
<module>leptonica</module>
<module>libpostal</module>
<module>tesseract</module>
<module>cuda</module>
<module>nvcodec</module>
Expand Down