0

我正在尝试从 ubuntu 18.04 交叉编译 Kenlm for Android。为此,我需要先编译它的所有依赖项。我成功地为 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。

谢谢你的时间。

4

1 回答 1

0

也许这个可以提供帮助(例如编译 bzip2)。

于 2020-06-16T01:07:33.443 回答