【发布时间】:2020-09-14 17:24:11
【问题描述】:
我正在尝试从 ubuntu 18.04 交叉编译适用于 Android 的 Kenlm。为此,我需要先编译它的所有依赖项。我成功地为 android 编译了 boost,但我不知道如何使用 bzip2。
当我使用 cmake 交叉编译 kenlm 时,使用这个 toolchain.cmake
set(CMAKE_SYSTEM_NAME Android)
set(CMAKE_SYSTEM_VERSION 26)
set(CMAKE_ANDROID_ARCH_ABI arm64-v8a)
set(CMAKE_ANDROID_NDK "/home/marie/Android/Sdk/ndk/16.1.4479499")
set(ZLIB_LIBRARIES "/home/marie/Android/Sdk/ndk/16.1.4479499/platforms/android-26/arch-arm64/usr/lib")
set(BOOST_LIBRARYDIR "/home/marie/Documents/Boost-for-Android/boost_1_73_0/stage/lib")
set(BOOST_INCLUDEDIR "/home/marie/Documents/Boost-for-Android/boost_1_73_0")
set(LIBLZMA_LIBRARY "/home/marie/Downloads/liblzma.a")
set(LIBLZMA_HAS_AUTO_DECODER TRUE)
set(LIBLZMA_HAS_EASY_ENCODER TRUE)
set(LIBLZMA_HAS_LZMA_PRESET TRUE)
我可以看到这个:
Found BZip2: /usr/local/lib/libbz2.a (found version "1.0.6")
Looking for BZ2_bzCompressInit
Looking for BZ2_bzCompressInit - not found
我尝试从 github 编译:https://github.com/enthought/bzip2-1.0.6,但我不知道如何为另一个目标编译 Makefile。 这个 repo 的自述文件说
HOW TO BUILD -- Windows 95, NT, DOS, Mac, etc.
It's difficult for me to support compilation on all these platforms.
My approach is to collect binaries for these platforms, and put them
on the master web site (http://www.bzip.org).
Bzip.org 链接到 sourceforge,但只有一个文件可供下载,即 tar.gz。
感谢您的宝贵时间。
【问题讨论】:
标签: android c++ cross-compiling bzip2 kenlm