comparison installer-files/octave.bat @ 6184:d02b5d26ac28 release

Set OPENBLAS_NUM_THREADS also in launcher scripts. * installer-files/octave-firsttime.vbs, installer-files/octave.vbs, installer-files/octave.bat: Set OPENBLAS_NUM_THREADS to number of physical cores if it is not set in the environment yet.
author Markus Mützel <markus.muetzel@gmx.de>
date Fri, 22 Apr 2022 19:19:31 +0200
parents 4ba9eb3f70c9
children 6adeb47401d6
comparison
equal deleted inserted replaced
6177:4ba9eb3f70c9 6184:d02b5d26ac28
39 set QT_PLUGIN_PATH=%OCT_HOME%\qt5\plugins 39 set QT_PLUGIN_PATH=%OCT_HOME%\qt5\plugins
40 ) ELSE ( 40 ) ELSE (
41 set QT_PLUGIN_PATH=%OCT_HOME%\plugins 41 set QT_PLUGIN_PATH=%OCT_HOME%\plugins
42 ) 42 )
43 43
44 Rem pkgconfig .pc path 44 Rem pkgconfig .pc files path
45 set PKG_CONFIG_PATH=%OCT_HOME%\lib\pkgconfig 45 set PKG_CONFIG_PATH=%OCT_HOME%\lib\pkgconfig
46
47 IF NOT x%OPENBLAS_NUM_THREADS%==x GOTO openblas_num_threads_set
48
49 Rem Set OPENBLAS_NUM_THREADS to number of physical processor cores.
50 SETLOCAL ENABLEDELAYEDEXPANSION
51 SET count=1
52 FOR /F "tokens=* USEBACKQ" %%F IN (`wmic CPU Get NumberOfCores`) DO (
53 SET line!count!=%%F
54 SET /a count=!count!+1
55 )
56 Rem Check that first line contains "NumberOfCores".
57 IF x%line1%==xNumberOfCores (
58 Rem The next line should contain the number of cores.
59 SET OPENBLAS_NUM_THREADS=%line2%
60 )
61 ENDLOCAL & SET OPENBLAS_NUM_THREADS=%OPENBLAS_NUM_THREADS%
62
63 :openblas_num_threads_set
46 64
47 Rem set home if not already set 65 Rem set home if not already set
48 if "%HOME%"=="" set HOME=%USERPROFILE% 66 if "%HOME%"=="" set HOME=%USERPROFILE%
49 if "%HOME%"=="" set HOME=%HOMEDRIVE%%HOMEPATH% 67 if "%HOME%"=="" set HOME=%HOMEDRIVE%%HOMEPATH%
50 Rem set HOME to 8.3 format 68 Rem set HOME to 8.3 format