Skip to content

Commit 08df0f0

Browse files
authored
Merge pull request #5382 from martin-frbg/issue5379
Update cross-compilation instructions for the Android NDK
2 parents 666e108 + 7d7757a commit 08df0f0

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

docs/install.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,14 +623,22 @@ Note: using `TARGET=CORTEXA57` in place of `ARMV8` will pick up better
623623
optimized routines. Implementations for the `CORTEXA57` target are compatible
624624
with all other `ARMV8` targets.
625625
626-
Note: for NDK 23b, something as simple as:
626+
Note: for NDK 23b and later, something as simple as:
627627
```bash
628628
export PATH=/opt/android-ndk-r23b/toolchains/llvm/prebuilt/linux-x86_64/bin/:$PATH
629-
make HOSTCC=gcc CC=/opt/android-ndk-r23b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android31-clang ONLY_CBLAS=1 TARGET=ARMV8
629+
make HOSTCC=gcc CC=/opt/android-ndk-r23b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android31-clang ONLY_CBLAS=1 TARGET=ARMV8 RANLIB=echo
630630
```
631631
appears to be sufficient on Linux. On OSX, setting AR to the ar provided in the
632632
"bin" path of the NDK (probably `llvm-ar`) is also necessary.
633633
634+
If you prefer building with CMake, running
635+
```bash
636+
cmake -DANDROID_ABI=arm64-v8a -DTARGET=ARMV8 -DCMAKE_TOOLCHAIN_FILE=/opt/android-ndk-r27/build/cmake/android.toolchain.cmake -DNOFORTRAN=1 -DANDROID_PLATFORM=android-23 ..
637+
cmake --build .
638+
```
639+
in your build directory should work (be sure to adjust the toolchain_file argument according to where you installed the NDK, and the ANDROID_PLATFORM
640+
according to the minimum version of Android you want to support. (If you leave out the ANDROID_PLATFORM parameter, the build will fail with an error
641+
message about a missing declaration or missing header file complex.h)
634642
635643
??? note "Alternative build script for 3 architectures"
636644

0 commit comments

Comments
 (0)