-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall_oneapi_windows.bat
More file actions
executable file
·52 lines (44 loc) · 2.41 KB
/
install_oneapi_windows.bat
File metadata and controls
executable file
·52 lines (44 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
:: This script installs the Fortran compilers provided in Intel OneAPI.
:: See https://github.com/oneapi-src/oneapi-ci
:: https://github.com/oneapi-src/oneapi-ci/blob/master/scripts/install_windows.bat
::
:: Usage: cmd.exe "/K" '"install_oneapi_windows.bat"'
:: N.B.: This is a cmd script, which may not work in PowerShell.
::
:: Zaikun Zhang (www.zhangzk.net), January 9, 2023
:: URL for the offline installer of Intel OneAPI Fortran compiler. To get the latest URL, visit
:: https://www.intel.com/content/www/us/en/developer/tools/oneapi/fortran-compiler-download.html
:: and click on the "Continue as a Guest (download starts immediately)" button.
:: Default version: 2025.3.2 (updated on 20260125)
set URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/039121f2-d488-4bc1-a5bb-97528e3a4b86/intel-fortran-compiler-2025.3.2.26_offline.exe
if "%1"=="2024" (
set URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/f6a44238-5cb6-4787-be83-2ef48bc70cba/w_fortran-compiler_p_2024.1.0.466_offline.exe
)
if "%1"=="2023" (
set URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/1720594b-b12c-4aca-b7fb-a7d317bac5cb/w_fortran-compiler_p_2023.2.1.7_offline.exe
)
:: Component to install.
set COMPONENTS=intel.oneapi.win.ifort-compiler
:: Download the installer.
:: According to https://curl.se/windows/microsoft.html , curl is included by default in
:: Windows since Windows 10, build 17603.
::cd %Temp% :: CD does not work if %Temp% is on a different drive.
curl.exe --output webimage.exe --url %URL% --retry 5 --retry-delay 5
start /b /wait webimage.exe -s -x -f webimage_extracted --log extract.log
:: Install the compiler.
webimage_extracted\bootstrapper.exe -s --action install --components=%COMPONENTS% --eula=accept -p=NEED_VS2017_INTEGRATION=0 -p=NEED_VS2019_INTEGRATION=0 -p=NEED_VS2022_INTEGRATION=0 --log-dir=.
set installer_exit_code=%ERRORLEVEL%
:: Run the script that sets the necessary environment variables and then dump them to $GITHUB_ENV
:: so that they are available in subsequent steps.
:: N.B.: `grep 'intel\|oneapi'` does not work on Windows.
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
set | grep -i "intel" >> %GITHUB_ENV%
set | grep -i "oneapi" >> %GITHUB_ENV%
:: Show the result of the installation.
echo The path to ifx is:
where ifx.exe
:: Remove the installer.
del webimage.exe
rd /s/q "webimage_extracted"
:: Exit with the installer exit code.
exit /b %installer_exit_code%