@@ -536,7 +536,6 @@ In your shell, move to this directory: `cd exports`.
536
536
To build OpenBLAS for Android, you will need the following tools installed on your machine:
537
537
538
538
- [The Android NDK](https:// developer.android.com/ ndk/ )
539
- - Perl
540
539
- Clang compiler on the build machine
541
540
542
541
The next two sections below describe how to build with Clang for ARMV7 and
@@ -578,7 +577,9 @@ utility in the make command above, like so:
578
577
AR=${NDK_BUNDLE_DIR} / toolchains/ arm- linux- androideabi- 4 .9 / prebuilt/ darwin- x86 _64 / bin/ arm- linux- androideabi- gcc- ar
579
578
```
580
579
otherwise you may get a linker error complaining like `malformed archive header
581
- name at 8 ` when the native macOS `ar` command was invoked instead.
580
+ name at 8 ` when the native macOS `ar` command was invoked instead. Note that
581
+ with recent NDK versions, the AR tool may be named `llvm-ar` rather than what
582
+ is assumed above.
582
583
583
584
584
585
#### Building for ARMV8
@@ -608,12 +609,17 @@ Note: for NDK 23b, something as simple as:
608
609
export PATH=/opt/android-ndk-r23 b/toolchains/llvm/prebuilt/linux-x86 _64 /bin/:$PATH
609
610
make HOSTCC=gcc CC=/opt/android-ndk-r23 b/toolchains/llvm/prebuilt/linux-x86 _64 /bin/aarch64 -linux-android31 -clang ONLY_CBLAS=1 TARGET=ARMV8
610
611
```
611
- appears to be sufficient on Linux.
612
+ appears to be sufficient on Linux. On OSX, setting AR to the ar provided in the
613
+ "bin" path of the NDK (probably `llvm-ar`) is also necessary.
612
614
613
615
614
616
??? note "Alternative build script for 3 architectures"
615
617
616
- This script will build OpenBLAS for 3 architecture (`ARMV7 `, `ARMV8 `, `X86 `) and install them to `/opt/OpenBLAS/lib`.
618
+ This script will build OpenBLAS for 3 architecture (`ARMV7 `, `ARMV8 `,
619
+ `X86 `) and install them to `/opt/OpenBLAS/lib`. Of course you can also copy
620
+ only the section that is of interest to you - also notice that the `AR=`
621
+ line may need adapting to the name of the ar tool provided in your
622
+ `$TOOLCHAIN /bin` - for example `llvm-ar` in some recent NDK versions.
617
623
It was tested on macOS with NDK version 21 .3 .6528147 .
618
624
619
625
```bash
0 commit comments