Skip to content

Commit 8481301

Browse files
authored
Merge pull request #4987 from martin-frbg/issue3973
Update build instructions for WoA (use LLVM19 and its flang-new)
2 parents c520ed1 + 009c1e0 commit 8481301

File tree

1 file changed

+16
-30
lines changed

1 file changed

+16
-30
lines changed

docs/install.md

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -439,49 +439,35 @@ 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+
(This may not always be present in the very latest point release, as building and uploading the binaries takes time.)
451+
E.g: a LLVM 19 build for WoA64 can be found [here](https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.2/LLVM-19.1.2-woa64.exe).
452+
Run the LLVM installer and ensure that LLVM is added to the environment variable PATH. (If you do not want to add it to the PATH, you will need to specify
453+
both C and Fortran compiler to Make or CMake with their full path later on)
457454
458-
The following steps describe how to build the static library for OpenBLAS with and without LAPACK:
455+
The following steps describe how to build the static library for OpenBLAS with either Make or CMake:
459456
460-
1. Build OpenBLAS static library with BLAS and LAPACK routines with Make:
457+
1. Build OpenBLAS with Make:
461458
462459
```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
460+
$ make CC=clang-cl FC=flang-new AR="llvm-ar" TARGET=ARMV8 ARCH=arm64 RANLIB="llvm-ranlib" MAKE=make
464461
```
465462
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-
463+
2. Build OpenBLAS with CMake
470464
```bash
471465
$ mkdir build
472466
$ 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
467+
$ cmake .. -G Ninja -DCMAKE_C_COMPILER=clang-cl -DCMAKE_Fortran_COMPILER=flang-new -DTARGET=ARMV8 -DCMAKE_BUILD_TYPE=Release
468+
$ cmake --build .
475469
```
476470
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-
485471
#### Generating an import library
486472
487473
Microsoft Windows has this thing called "import libraries". You need it for

0 commit comments

Comments
 (0)