Skip to content

Commit afd5725

Browse files
authored
Add build instructions for Huawei's HarmonyOS from #5043
1 parent a71041e commit afd5725

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/install.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,29 @@ make TARGET=ARMV8 DYNAMIC_ARCH=1 NUM_THREADS=32 HOSTCC=clang NOFORTRAN=1
690690
Adjust `MIN_IOS_VERSION` as necessary for your installation. E.g., change the version number
691691
to the minimum iOS version you want to target and execute this file to build the library.
692692
693+
### HarmonyOS
694+
695+
For this target you will need the cross-compiler toolchain package by Huawei, which contains solutions for both Windows and Linux. Only the Linux-based
696+
toolchain has been tested so far, but the following instructions may apply similarly to Windows:
697+
698+
Download https://repo.huaweicloud.com/harmonyos/os/4.1.1-Release/ohos-sdk-windows_linux-public.tar.gz (or whatever newer version may be available in the future). Use tar xvf ohos-sdk-windows_linux_public.tar.gz to unpack it somewhere on your system. This will create a folder named "ohos-sdk" with subfolders "linux" and "windows". In the linux one you will find a ZIP archive named "native-linux-x64-4.1.7.8-Release.zip" - you need to unzip this where you want to
699+
install the cross-compiler, for example in /opt/ohos-sdk.
700+
701+
In the directory where you unpacked OpenBLAS, create a build directory for cmake, and change into it :
702+
```
703+
mkdir build
704+
cd build
705+
```
706+
Use the version of `cmake` that came with the SDK, and specify the location of its toolchain file as a cmake option. Also set the build target for OpenBLAS to ARMV8 and specify NOFORTRAN=1 (at least as of version 4.1.1, the SDK contains no Fortran compiler):
707+
```
708+
/opt/ohos-sdk/linux/native/build-tools/cmake/bin/cmake -DCMAKE_TOOLCHAIN_FILE=/opt/ohos-sdk/linux/native/build/cmake/ohos.toolchain.cmake \
709+
-DOHOS_ARCH="arm64-v8a" -DTARGET=ARMV8 -DNOFORTRAN=1 ..
710+
```
711+
Additional other OpenBLAS build options like USE_OPENMP=1 or DYNAMIC_ARCH=1 will probably work too.
712+
Finally do the build:
713+
```
714+
/opt/ohos-sdk/linux/native/build-tools/cmake/bin/cmake --build .
715+
```
693716
694717
### MIPS
695718

0 commit comments

Comments
 (0)