Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
a8dbd936
Commit
a8dbd936
authored
Jan 12, 2016
by
Zachary Ware
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #25348: Add --pgo and --pgo-job flags to PCbuild\build.bat
parent
b45bed13
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
49 deletions
+67
-49
Misc/NEWS
Misc/NEWS
+5
-0
PCbuild/build.bat
PCbuild/build.bat
+52
-3
PCbuild/build_pgo.bat
PCbuild/build_pgo.bat
+4
-46
PCbuild/env.bat
PCbuild/env.bat
+6
-0
No files found.
Misc/NEWS
View file @
a8dbd936
...
...
@@ -85,6 +85,11 @@ Tests
Build
-----
-
Issue
#
25348
:
Added
``--
pgo
``
and
``--
pgo
-
job
``
arguments
to
``
PCbuild
\
build
.
bat
``
for
building
with
Profile
-
Guided
Optimization
.
The
old
``
PCbuild
\
build_pgo
.
bat
``
script
is
now
deprecated
,
and
simply
calls
``
PCbuild
\
build
.
bat
--
pgo
%*``.
-
Issue
#
25827
:
Add
support
for
building
with
ICC
to
``
configure
``,
including
a
new
``--
with
-
icc
``
flag
.
...
...
PCbuild/build.bat
View file @
a8dbd936
...
...
@@ -24,6 +24,8 @@ echo. -M Disable parallel build (disabled by default)
echo
.
-v
Increased
output
messages
echo
.
-k
Attempt
to
kill
any
running
Pythons
before
building
(
usually
done
echo
.
automatically
by
the
pythoncore
project
)
echo
.
-
-pgo
Build
with
Profile
-Guided
Optimization
.
This
flag
echo
.
overrides
-c
and
-d
echo
.
echo
.Available
flags
to
avoid
building
certain
modules
.
echo
.These
flags
have
no
effect
if
'-e'
is
not
given
:
...
...
@@ -38,6 +40,8 @@ echo. -p x64 ^| Win32
echo
.
Set
the
platform
(
default
:
Win32
)
echo
.
-t
Build
^|
Rebuild
^|
Clean
^|
CleanAll
echo
.
Set
the
target
manually
echo
.
-
-pgo-job
The
job
to
use
for
PGO
training
;
implies
-
-pgo
echo
.
(
default
:
"-m test.regrtest --pgo"
)
exit
/b
127
:Run
...
...
@@ -50,6 +54,12 @@ set dir=%~dp0
set
parallel
=
set
verbose
=
/nologo /v
:m
set
kill
=
set
do_pgo
=
set
pgo_job
=
-m
test
.regrtest
-
-pgo
set
on_64_bit
=
true
rem This may not be 100% accurate, but close enough.
if
"
%ProgramFiles
(x86)
%
"
==
""
(
set
on_64_bit
=
false
)
:CheckOpts
if
"
%
~1"
==
"-h"
goto
Usage
...
...
@@ -62,6 +72,8 @@ if "%~1"=="-m" (set parallel=/m) & shift & goto CheckOpts
if
"
%
~1"
==
"-M"
(
set
parallel
=)
&
shift
&
goto
CheckOpts
if
"
%
~1"
==
"-v"
(
set
verbose
=
/v
:n
)
&
shift
&
goto
CheckOpts
if
"
%
~1"
==
"-k"
(
set
kill
=
true
)
&
shift
&
goto
CheckOpts
if
"
%
~1"
==
"--pgo"
(
set
do_pgo
=
true
)
&
shift
&
goto
CheckOpts
if
"
%
~1"
==
"--pgo-job"
(
set
do_pgo
=
true
)
&
(
set
pgo_job
=
%
~
2
)
&
shift
&
shift
&
goto
CheckOpts
rem These use the actual property names used by MSBuild. We could just let
rem them in through the environment, but we specify them on the command line
rem anyway for visibility so set defaults after this
...
...
@@ -77,15 +89,49 @@ if "%IncludeBsddb%"=="" set IncludeBsddb=true
if
"
%IncludeExternals%
"
==
"true"
call
"
%dir%
get_externals.bat"
if
"
%platf%
"
==
"x64"
(
set
vs_platf
=
x86_amd64
)
if
"
%platf%
"
==
"x64"
(
if
"
%on
_64_bit
%
"
==
"true"
(
rem This ought to always be correct these days...
set
vs_platf
=
amd64
)
else
(
if
"
%do_pgo%
"
==
"true"
(
echo
.ERROR:
Cannot
cross
-compile
with
PGO
echo
.
32
bit
operating
system
detected
,
if
this
is
incorrect
,
echo
.
make
sure
the
ProgramFiles
(
x86
^)
environment
variable
is
set
exit
/b
1
)
set
vs_platf
=
x86_amd64
)
)
rem Setup the environment
call
"
%dir%
env.bat"
%vs_platf%
>
nul
if
"
%kill%
"
==
"true"
(
msbuild
/v
:m
/nologo /target
:KillPython
"
%dir%
\pythoncore.vcxproj"
/p
:Configuration
=
%conf%
/p
:Platform
=
%platf%
/p
:KillPython
=
true
if
"
%kill%
"
==
"true"
call
:Kill
if
"
%do_pgo%
"
==
"true"
(
set
conf
=
PGInstrument
call
:Build
del
/s
"
%dir%
\*.pgc"
del
/s
"
%dir%
\..\Lib\*.pyc"
echo
on
call
"
%dir%
\..\python.bat"
%pgo_job%
@echo
off
call
:Kill
set
conf
=
PGUpdate
)
goto
Build
:Kill
echo
on
msbuild
"
%dir%
\pythoncore.vcxproj"
/t
:KillPython
%verbose%
^
/p
:Configuration
=
%conf%
/p
:Platform
=
%platf%
^
/p
:KillPython
=
true
@echo
off
goto
:eof
:Build
rem Call on MSBuild to do the work, echo the command.
rem Passing %1-9 is not the preferred option, but argument parsing in
rem batch is, shall we say, "lackluster"
...
...
@@ -96,3 +142,6 @@ msbuild "%dir%pcbuild.proj" /t:%target% %parallel% %verbose%^
/p
:IncludeSSL
=
%IncludeSSL%
/p
:IncludeTkinter
=
%IncludeTkinter%
^
/p
:IncludeBsddb
=
%IncludeBsddb%
^
%
1
%
2
%
3
%
4
%
5
%
6
%
7
%
8
%
9
@echo
off
goto
:eof
PCbuild/build_pgo.bat
View file @
a8dbd936
@echo
off
rem A batch program to build PGO (Profile guided optimization) by first
rem building instrumented binaries, then running the testsuite, and
rem finally building the optimized code.
rem Note, after the first instrumented run, one can just keep on
rem building the PGUpdate configuration while developing.
echo
.DeprecationWarning:
echo
.
This
script
is
deprecated
,
use
`build.bat --pgo`
instead
.
echo
.
setlocal
set
platf
=
Win32
set
parallel
=
/m
set
dir
=
%~dp0
rem use the performance testsuite. This is quick and simple
set
job1
=
"
%dir%
..\tools\pybench\pybench.py"
-n
1
-C
1
-
-with-gc
set
path1
=
"
%dir%
..\tools\pybench"
rem or the whole testsuite for more thorough testing
set
job2
=
"
%dir%
..\lib\test\regrtest.py"
set
path2
=
"
%dir%
..\lib"
set
job
=
%job1
%
set
clrpath
=
%path1
%
:CheckOpts
if
"
%
1"
==
"-p"
(
set
platf
=
%
2
)
&
shift
&
shift
&
goto
CheckOpts
if
"
%
1"
==
"-2"
(
set
job
=
%job2
%
)
&
(
set
clrpath
=
%path2
%
)
&
shift
&
goto
CheckOpts
if
"
%
1"
==
"-M"
(
set
parallel
=)
&
shift
&
goto
CheckOpts
rem We cannot cross compile PGO builds, as the optimization needs to be run natively
set
vs_platf
=
x86
set
PGO
=
%dir%
win32
-pgo
if
"
%platf%
"
==
"x64"
(
set
vs_platf
=
amd64
)
&
(
set
PGO
=
%dir%
amd64
-pgo
)
rem Setup the environment
call
"
%dir%
env.bat"
%vs_platf%
rem build the instrumented version
msbuild
"
%dir%
pcbuild.proj"
%parallel%
/t
:Build
/p
:Configuration
=
PGInstrument
/p
:Platform
=
%platf%
%
1
%
2
%
3
%
4
%
5
%
6
%
7
%
8
%
9
rem remove .pyc files, .pgc files and execute the job
"
%PGO%
\python.exe"
"
%dir%
rmpyc.py"
%clrpath%
del
"
%PGO%
\*.pgc"
"
%PGO%
\python.exe"
%job%
rem build optimized version
msbuild
"
%dir%
pcbuild.proj"
%parallel%
/t
:Build
/p
:Configuration
=
PGUpdate
/p
:Platform
=
%platf%
%
1
%
2
%
3
%
4
%
5
%
6
%
7
%
8
%
9
call
"
%~dp0
build.bat"
-
-pgo
%
*
PCbuild/env.bat
View file @
a8dbd936
...
...
@@ -10,6 +10,12 @@ rem other than 'v90' is supported!
echo
Build
environments
:
x86
,
amd64
,
x86_amd64
echo
.
rem Set up the v90 tools first. This is mostly needed to allow PGInstrument
rem builds to find the PGO DLL. Do it first so the newer MSBuild is found
rem before the one from v90 (vcvarsall.bat prepends to PATH).
call
"
%VS9
0COMNTOOLS
%
..\..\VC\vcvarsall.bat"
%
*
set
VSTOOLS
=
%VS1
40
COMNTOOLS
%
if
"
%VSTOOLS%
"
==
""
set
VSTOOLS
=
%VS1
20
COMNTOOLS
%
if
"
%VSTOOLS%
"
==
""
set
VSTOOLS
=
%VS1
10
COMNTOOLS
%
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment