Skip to content

Commit 760a537

Browse files
authored
Update build instructions for WoA (use LLVM19 and its flang-new)
1 parent c520ed1 commit 760a537

File tree

1 file changed

+15
-30
lines changed

1 file changed

+15
-30
lines changed

docs/install.md

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -439,49 +439,34 @@ To then use the built OpenBLAS shared library in Visual Studio:
439439
440440
#### Windows on Arm
441441
442+
While OpenBLAS can be built with Microsoft VisualStudio (Community Edition or commercial), you would only be able to build for the GENERIC target
443+
that does not use optimized assembly kernels, also the stock VisualStudio lacks the Fortran compiler necessary for building the LAPACK component.
444+
It is therefore highly recommended to download the free LLVM compiler suite and use it to compile OpenBLAS outside of VisualStudio.
445+
442446
The following tools needs to be installed to build for Windows on Arm (WoA):
443447
444-
- Clang for Windows on Arm.
445-
Find the latest LLVM build for WoA from [LLVM release page](https://releases.llvm.org/).
446-
E.g: LLVM 12 build for WoA64 can be found [here](https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.0/LLVM-12.0.0-woa64.exe)
447-
Run the LLVM installer and ensure that LLVM is added to environment PATH.
448-
- Download and install classic Flang for Windows on Arm.
449-
Classic Flang is the only available Fortran compiler for Windows on Arm for now.
450-
A pre-release build can be found [here](https://github.com/kaadam/flang/releases/tag/v0.1)
451-
There is no installer for classic flang and the zip package can be
452-
extracted and the path needs to be added to environment `PATH`.
453-
E.g., in PowerShell:
454-
```
455-
$env:Path += ";C:\flang_woa\bin"
456-
```
448+
- LLVM for Windows on Arm.
449+
Find the latest LLVM build for WoA from [LLVM release page](https://releases.llvm.org/) - you want the package whose name ends in "woa64.exe".
450+
E.g: LLVM 19 build for WoA64 can be found [here](https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.4/LLVM-19.1.4-woa64.exe)
451+
Run the LLVM installer and ensure that LLVM is added to environment PATH. (If you do not want to add it to the PATH, you will need to specify
452+
both C and Fortran compiler to Make or CMake with their full path later on)
457453
458-
The following steps describe how to build the static library for OpenBLAS with and without LAPACK:
454+
The following steps describe how to build the static library for OpenBLAS with either Make or CMake:
459455
460-
1. Build OpenBLAS static library with BLAS and LAPACK routines with Make:
456+
1. Build OpenBLAS with Make:
461457
462458
```bash
463-
$ make CC="clang-cl" HOSTCC="clang-cl" AR="llvm-ar" BUILD_WITHOUT_LAPACK=0 NOFORTRAN=0 DYNAMIC_ARCH=0 TARGET=ARMV8 ARCH=arm64 BINARY=64 USE_OPENMP=0 PARALLEL=1 RANLIB="llvm-ranlib" MAKE=make F_COMPILER=FLANG FC=FLANG FFLAGS_NOOPT="-march=armv8-a -cpp" FFLAGS="-march=armv8-a -cpp" NEED_PIC=0 HOSTARCH=arm64 libs netlib
459+
$ make CC=clang-cl FC=flang-new AR="llvm-ar" TARGET=ARMV8 ARCH=arm64 RANLIB="llvm-ranlib" MAKE=make
464460
```
465461
466-
2. Build static library with BLAS routines using CMake:
467-
468-
Classic Flang has compatibility issues with CMake, hence only BLAS routines can be compiled with CMake:
469-
462+
2. Build OpenBLAS with CMake
470463
```bash
471464
$ mkdir build
472465
$ cd build
473-
$ cmake .. -G Ninja -DCMAKE_C_COMPILER=clang -DBUILD_WITHOUT_LAPACK=1 -DNOFORTRAN=1 -DDYNAMIC_ARCH=0 -DTARGET=ARMV8 -DARCH=arm64 -DBINARY=64 -DUSE_OPENMP=0 -DCMAKE_SYSTEM_PROCESSOR=ARM64 -DCMAKE_CROSSCOMPILING=1 -DCMAKE_SYSTEM_NAME=Windows
474-
$ cmake --build . --config Release
466+
$ cmake .. -G Ninja -DCMAKE_C_COMPILER=clang-cl -DCMAKE_Fortran_COMPILER=flang-new -DTARGET=ARMV8 -DCMAKE_BUILD_TYPE=Release
467+
$ cmake --build .
475468
```
476469
477-
!!! tip "`getarch.exe` execution error"
478-
479-
If you notice that platform-specific headers by `getarch.exe` are not
480-
generated correctly, this could be due to a known debug runtime DLL issue for
481-
arm64 platforms. Please check out [this page](https://linaro.atlassian.net/wiki/spaces/WOAR/pages/28677636097/Debug+run-time+DLL+issue#Workaround)
482-
for a workaround.
483-
484-
485470
#### Generating an import library
486471
487472
Microsoft Windows has this thing called "import libraries". You need it for

0 commit comments

Comments
 (0)