-
Notifications
You must be signed in to change notification settings - Fork 226
Feature/win arm64 support #3718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
5f4c63a
d150119
e9a1e35
9593a3f
50ee538
2061824
38e060f
1a54da1
a70ebc9
4bb400a
92f97d7
82cf8c5
845499b
b886c5b
8512aed
a638f96
7810d64
52a3c84
6a5adfa
09dc5ed
a9bec18
ba2ca21
60f57c3
04c25a8
6809c99
c64f336
f30179c
feb6720
f5d5bb8
2b79b2d
49dc9ac
6f2a43c
55327ee
1f49486
5e8b2e5
b05f989
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| @echo off | ||
| rem ============================================================================ | ||
| rem Copyright 2020 Intel Corporation | ||
| rem | ||
| rem Licensed under the Apache License, Version 2.0 (the "License"); | ||
| rem you may not use this file except in compliance with the License. | ||
| rem You may obtain a copy of the License at | ||
| rem | ||
| rem http://www.apache.org/licenses/LICENSE-2.0 | ||
| rem | ||
| rem Unless required by applicable law or agreed to in writing, software | ||
| rem distributed under the License is distributed on an "AS IS" BASIS, | ||
| rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| rem See the License for the specific language governing permissions and | ||
| rem limitations under the License. | ||
| rem ============================================================================ | ||
|
|
||
| setlocal | ||
|
|
||
| rem req: PowerShell 3.0+ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aren't batch files meant to be runnable with the old Cmd.exe alone? Feels quite odd to launch powershell from a .bat file. |
||
| powershell.exe -command "if ($PSVersionTable.PSVersion.Major -lt 3) {Write-Host \"The script requires PowerShell 3.0 or above (current version: $($PSVersionTable.PSVersion.Major).$($PSVersionTable.PSVersion.Minor))\"; exit 1} else {exit 0}" | ||
| if errorlevel 1 goto Error_load | ||
|
|
||
| if /I not "%PROCESSOR_ARCHITECTURE%"=="ARM64" ( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this mean that cross-compilation is not supported? |
||
| echo Current only available for ARM64. | ||
| exit /B 1 | ||
| ) | ||
|
|
||
| if /i "%1"=="" ( | ||
| set DST=%~dp0..\..\__deps\open_blas | ||
| ) else ( | ||
| set DST=%1\..\..\__deps\open_blas | ||
| ) | ||
| set BLASSOURCEDIR=%~dp0..\..\__work\openblas | ||
| set BLASVERSION=0.3.33 | ||
| set BLASURLROOT=https://github.com/OpenMathLib/OpenBLAS/archive/refs/tags/v%BLASVERSION% | ||
| set BLASPACKAGE= | ||
| set BLASURL=%BLASURLROOT%%BLASPACKAGE%.zip | ||
| set "PATH=C:\Program Files\LLVM\bin;%PATH%" | ||
|
|
||
| IF "%VS_VER%"=="2026_build_tools" ( | ||
| @call "C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" %PROCESSOR_ARCHITECTURE% | ||
| ) ELSE IF "%VS_VER%"=="2019_build_tools" ( | ||
| @call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" %PROCESSOR_ARCHITECTURE% | ||
| ) ELSE IF "%VS_VER%"=="2017_build_tools" ( | ||
| @call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" %PROCESSOR_ARCHITECTURE% | ||
| ) | ||
|
|
||
| if not exist "%DST%" powershell.exe -command "New-Item -Path \"%DST%\" -ItemType Directory" >nul | ||
| if not exist "%BLASSOURCEDIR%" powershell.exe -command "New-Item -Path \"%BLASSOURCEDIR%\" -ItemType Directory" >nul | ||
|
|
||
| powershell.exe -command "(New-Object System.Net.WebClient).DownloadFile('%BLASURL%', '%BLASSOURCEDIR%\openblas.zip')" | ||
| if errorlevel 1 goto Error_load | ||
|
|
||
| powershell.exe -command "if (Get-Command Add-Type -errorAction SilentlyContinue) {Add-Type -Assembly \"System.IO.Compression.FileSystem\"; try { [IO.Compression.zipfile]::ExtractToDirectory(\"%BLASSOURCEDIR%\openblas.zip\", \"%BLASSOURCEDIR%\") } catch { $_.exception; exit 1 }} else {exit 1}" | ||
| if errorlevel 1 goto Error_unpack | ||
|
|
||
| pushd "%BLASSOURCEDIR%\OpenBLAS-%BLASVERSION%" | ||
| rmdir /s /q build-arm64 | ||
| cmake -B build-arm64 -S . -GNinja ^ | ||
| -DCMAKE_BUILD_TYPE=Release ^ | ||
| -DTARGET=ARMV8 ^ | ||
| -DBINARY=64 ^ | ||
| -DCMAKE_C_COMPILER=clang-cl ^ | ||
| -DCMAKE_CXX_COMPILER=clang-cl ^ | ||
| -DCMAKE_Fortran_COMPILER=flang-new ^ | ||
| -DBUILD_SHARED_LIBS=ON ^ | ||
| -DCMAKE_SYSTEM_PROCESSOR=arm64 ^ | ||
| -DCMAKE_SYSTEM_NAME=Windows ^ | ||
| -DCMAKE_INSTALL_PREFIX="%DST%" | ||
| cmake --build build-arm64 | ||
| cmake --install build-arm64 | ||
| popd | ||
|
|
||
| echo Downloaded and unpacked OpenBlas small libraries to %DST% | ||
| exit /B 0 | ||
|
|
||
| :Error_load | ||
| echo openblas.bat : Error: Failed to load %BLASURL% to %BLASSOURCEDIR%, try to load it manually | ||
| exit /B 1 | ||
|
|
||
| :Error_unpack | ||
| echo openblas.bat : Error: Failed to unpack %BLASSOURCEDIR%\openblas.zip to %BLASSOURCEDIR%, try unpack the archive manually | ||
| exit /B 1 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is not a copy-paste, please use the new copyright header:
https://github.com/uxlfoundation/oneDAL/blob/main/CONTRIBUTING.md#copyright-guidelines-for-contributions