public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Add option /m to enable multiple thread build
@ 2017-09-29 13:17 Yonghong Zhu
  2017-09-29 14:19 ` Wei, David
  0 siblings, 1 reply; 2+ messages in thread
From: Yonghong Zhu @ 2017-09-29 13:17 UTC (permalink / raw)
  To: edk2-devel; +Cc: zwei4

current in windows it takes ~10 minutes to build a image, so we add
/m option to use EDK II build tool's multiple thread build function,
it can save about half build time.

Cc: zwei4 <david.wei@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
---
 BuildBIOS.bat                             | 12 ++++++++++--
 Platform/BroxtonPlatformPkg/BuildBios.bat |  8 ++++++++
 Platform/BroxtonPlatformPkg/BuildIFWI.bat | 13 +++++++++++--
 3 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/BuildBIOS.bat b/BuildBIOS.bat
index 4bb4b03..baf7cdd 100644
--- a/BuildBIOS.bat
+++ b/BuildBIOS.bat
@@ -10,10 +10,11 @@ set PlatformName=
 set BuildTarget=Debug
 set Compiler=/vs13
 set Arch=/x64
 set FabId=/B
 set BoardId=/MN
+set buildthread=
 
 :: Optional arguments
 :OptLoop
 
 if /i "%~1"=="" goto Usage
@@ -84,22 +85,29 @@ if /i "%~1"=="/BG" (
     echo.
     shift
     goto OptLoop
 )
 
+if /i "%~1"=="/m" (
+    set buildthread=/m
+    echo.
+    shift
+    goto OptLoop
+)
+
 :: Required argument(s)
 :: Require 2 input parameters
 if "%~2"=="" goto Usage
 
 :: Assign required arguments
 set PlatformName=%~1
 set BuildTarget=%~2
 
 :OptLoopEnd
 echo ---- Call Build Script of Broxton ----
-echo calling : Platform\%PlatformName%PlatformPkg\BuildIFWI.bat  %Compiler% %Arch% %BoardId% %FabId% /fspw %BuildFlags% MINN %BuildTarget% 
-call Platform\%PlatformName%PlatformPkg\BuildIFWI.bat  %Compiler% %Arch% %BoardId% %FabId% /fspw %BuildFlags% MINN %BuildTarget% 
+echo calling : Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %buildthread% %Compiler% %Arch% %BoardId% %FabId% /fspw %BuildFlags% MINN %BuildTarget% 
+call Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %buildthread% %Compiler% %Arch% %BoardId% %FabId% /fspw %BuildFlags% MINN %BuildTarget% 
 
 goto Exit
 
 :Usage
 echo Usage: BuildBIOS.bat [options] ^<PlatformName^> ^<BuildTarget^>
diff --git a/Platform/BroxtonPlatformPkg/BuildBios.bat b/Platform/BroxtonPlatformPkg/BuildBios.bat
index 3ac411e..1e240e8 100644
--- a/Platform/BroxtonPlatformPkg/BuildBios.bat
+++ b/Platform/BroxtonPlatformPkg/BuildBios.bat
@@ -177,10 +177,18 @@ if /i "%~1"=="/BG" (
     echo.
     shift
     goto OptLoop
 )
 
+if /i "%~1"=="/m" (
+    if defined NUMBER_OF_PROCESSORS (
+        set /a build_threads=%NUMBER_OF_PROCESSORS%
+    )
+    shift
+    goto OptLoop
+)
+
 :: Required argument(s)
 if "%~2"=="" (
    echo. & echo -- ERROR: Not Enough Arguments Provided
    echo -- Please review the Help screen "/?" -- & echo.
    goto ExitFail
diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.bat b/Platform/BroxtonPlatformPkg/BuildIFWI.bat
index 1af0bf9..5042580 100644
--- a/Platform/BroxtonPlatformPkg/BuildIFWI.bat
+++ b/Platform/BroxtonPlatformPkg/BuildIFWI.bat
@@ -6,10 +6,11 @@ set exitCode=0
 set "Build_Flags= "
 set Arch=X64
 set SkipUsageFlag=FALSE
 set FabId=B
 set BoardId=MN
+set buildthread=
 set WORKSPACE=%CD%
 if %WORKSPACE:~-1%==\ (
   set WORKSPACE=%WORKSPACE:~0,-1%
 )
 set CORE_PATH=%WORKSPACE%\Core
@@ -102,10 +103,18 @@ if /i "%~1"=="/BG" (
     set Build_Flags=%Build_Flags% /BG
     shift
     goto OptLoop
 )
 
+if /i "%~1"=="/m" (
+    set buildthread=/m
+    echo.
+    shift
+    goto OptLoop
+)
+
+
 :: Require 2 input parameters
 if "%~2"=="" (
    echo. & echo -- ERROR: Not Enough Arguments Provided
    echo -- Please review the Help screen "/?" -- & echo.
    goto exit
@@ -118,12 +127,12 @@ set Build_Target=%~2
 :: Build BIOS
 echo ================================================================================
 echo Build_IFWI:  Calling BIOS build Script...
 echo.
 
-echo - call BuildBios.bat %Build_Flags% %Platform_Type% %Build_Target%
-call %WORKSPACE%\%PLATFORM_PATH%\BuildBios.bat %Build_Flags% %Platform_Type% %Build_Target%
+echo - call BuildBios.bat %buildthread% %Build_Flags% %Platform_Type% %Build_Target%
+call %WORKSPACE%\%PLATFORM_PATH%\BuildBios.bat %buildthread% %Build_Flags% %Platform_Type% %Build_Target%
 if ErrorLevel 1 (
     echo echo  -- Error Building BIOS  & echo.
     set exitCode=1
     goto exit
 )
-- 
2.6.1.windows.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Add option /m to enable multiple thread build
  2017-09-29 13:17 [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Add option /m to enable multiple thread build Yonghong Zhu
@ 2017-09-29 14:19 ` Wei, David
  0 siblings, 0 replies; 2+ messages in thread
From: Wei, David @ 2017-09-29 14:19 UTC (permalink / raw)
  To: Zhu, Yonghong, edk2-devel@lists.01.org

Reviewed-by: zwei4 <david.wei@intel.com>

Thanks,
David  Wei

Intel SSG/STO/UEFI BIOS                                 

> -----Original Message-----
> From: Zhu, Yonghong
> Sent: Friday, September 29, 2017 9:18 PM
> To: edk2-devel@lists.01.org
> Cc: Wei, David <david.wei@intel.com>
> Subject: [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Add
> option /m to enable multiple thread build
> 
> current in windows it takes ~10 minutes to build a image, so we add
> /m option to use EDK II build tool's multiple thread build function,
> it can save about half build time.
> 
> Cc: zwei4 <david.wei@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
> ---
>  BuildBIOS.bat                             | 12 ++++++++++--
>  Platform/BroxtonPlatformPkg/BuildBios.bat |  8 ++++++++
>  Platform/BroxtonPlatformPkg/BuildIFWI.bat | 13 +++++++++++--
>  3 files changed, 29 insertions(+), 4 deletions(-)
> 
> diff --git a/BuildBIOS.bat b/BuildBIOS.bat
> index 4bb4b03..baf7cdd 100644
> --- a/BuildBIOS.bat
> +++ b/BuildBIOS.bat
> @@ -10,10 +10,11 @@ set PlatformName=
>  set BuildTarget=Debug
>  set Compiler=/vs13
>  set Arch=/x64
>  set FabId=/B
>  set BoardId=/MN
> +set buildthread=
> 
>  :: Optional arguments
>  :OptLoop
> 
>  if /i "%~1"=="" goto Usage
> @@ -84,22 +85,29 @@ if /i "%~1"=="/BG" (
>      echo.
>      shift
>      goto OptLoop
>  )
> 
> +if /i "%~1"=="/m" (
> +    set buildthread=/m
> +    echo.
> +    shift
> +    goto OptLoop
> +)
> +
>  :: Required argument(s)
>  :: Require 2 input parameters
>  if "%~2"=="" goto Usage
> 
>  :: Assign required arguments
>  set PlatformName=%~1
>  set BuildTarget=%~2
> 
>  :OptLoopEnd
>  echo ---- Call Build Script of Broxton ----
> -echo calling :
> Platform\%PlatformName%PlatformPkg\BuildIFWI.bat  %Compiler% %Arch%
>  %BoardId% %FabId% /fspw %BuildFlags% MINN %BuildTarget%
> -call
> Platform\%PlatformName%PlatformPkg\BuildIFWI.bat  %Compiler% %Arch%
>  %BoardId% %FabId% /fspw %BuildFlags% MINN %BuildTarget%
> +echo calling :
> Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %buildthread% %Co
> mpiler% %Arch% %BoardId% %FabId% /fspw %BuildFlags%
> MINN %BuildTarget%
> +call
> Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %buildthread% %Co
> mpiler% %Arch% %BoardId% %FabId% /fspw %BuildFlags%
> MINN %BuildTarget%
> 
>  goto Exit
> 
>  :Usage
>  echo Usage: BuildBIOS.bat [options] ^<PlatformName^> ^<BuildTarget^>
> diff --git a/Platform/BroxtonPlatformPkg/BuildBios.bat
> b/Platform/BroxtonPlatformPkg/BuildBios.bat
> index 3ac411e..1e240e8 100644
> --- a/Platform/BroxtonPlatformPkg/BuildBios.bat
> +++ b/Platform/BroxtonPlatformPkg/BuildBios.bat
> @@ -177,10 +177,18 @@ if /i "%~1"=="/BG" (
>      echo.
>      shift
>      goto OptLoop
>  )
> 
> +if /i "%~1"=="/m" (
> +    if defined NUMBER_OF_PROCESSORS (
> +        set /a build_threads=%NUMBER_OF_PROCESSORS%
> +    )
> +    shift
> +    goto OptLoop
> +)
> +
>  :: Required argument(s)
>  if "%~2"=="" (
>     echo. & echo -- ERROR: Not Enough Arguments Provided
>     echo -- Please review the Help screen "/?" -- & echo.
>     goto ExitFail
> diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.bat
> b/Platform/BroxtonPlatformPkg/BuildIFWI.bat
> index 1af0bf9..5042580 100644
> --- a/Platform/BroxtonPlatformPkg/BuildIFWI.bat
> +++ b/Platform/BroxtonPlatformPkg/BuildIFWI.bat
> @@ -6,10 +6,11 @@ set exitCode=0
>  set "Build_Flags= "
>  set Arch=X64
>  set SkipUsageFlag=FALSE
>  set FabId=B
>  set BoardId=MN
> +set buildthread=
>  set WORKSPACE=%CD%
>  if %WORKSPACE:~-1%==\ (
>    set WORKSPACE=%WORKSPACE:~0,-1%
>  )
>  set CORE_PATH=%WORKSPACE%\Core
> @@ -102,10 +103,18 @@ if /i "%~1"=="/BG" (
>      set Build_Flags=%Build_Flags% /BG
>      shift
>      goto OptLoop
>  )
> 
> +if /i "%~1"=="/m" (
> +    set buildthread=/m
> +    echo.
> +    shift
> +    goto OptLoop
> +)
> +
> +
>  :: Require 2 input parameters
>  if "%~2"=="" (
>     echo. & echo -- ERROR: Not Enough Arguments Provided
>     echo -- Please review the Help screen "/?" -- & echo.
>     goto exit
> @@ -118,12 +127,12 @@ set Build_Target=%~2
>  :: Build BIOS
>  echo
> ==========================================================
> ======================
>  echo Build_IFWI:  Calling BIOS build Script...
>  echo.
> 
> -echo - call BuildBios.bat %Build_Flags% %Platform_Type% %Build_Target%
> -
> call %WORKSPACE%\%PLATFORM_PATH%\BuildBios.bat %Build_Flags% %Pla
> tform_Type% %Build_Target%
> +echo - call
> BuildBios.bat %buildthread% %Build_Flags% %Platform_Type% %Build_Targe
> t%
> +call %WORKSPACE%\%PLATFORM_PATH%\BuildBios.bat %buildthread% %B
> uild_Flags% %Platform_Type% %Build_Target%
>  if ErrorLevel 1 (
>      echo echo  -- Error Building BIOS  & echo.
>      set exitCode=1
>      goto exit
>  )
> --
> 2.6.1.windows.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-29 14:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-29 13:17 [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Add option /m to enable multiple thread build Yonghong Zhu
2017-09-29 14:19 ` Wei, David

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox