-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial changes to support PGO builds
- Loading branch information
Showing
14 changed files
with
89 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
##################### | ||
#PGO flags | ||
######################################################## | ||
#This file should not be included directly by spec files. | ||
# It is automatically added for selected packages via pgo/cmsdist_packages.py | ||
######################################################## | ||
# Following are set by pgo/cmsdist_packages.py | ||
# pgo_path_prefix: path prefix where package was build. | ||
# pgo_package_name: Original name of the package e.g. geant4, vecgeom , cmssw etc. | ||
# pgo_generate: Set if package is build in pgo generate mode | ||
# pgo_use: Set if package is build in pgo use mode | ||
|
||
%define cmsdist_package_initenv export CMSSW_PGO_DIRECTORY=%{cmsroot}/%{tempprefix} | ||
%define pgo_common -fprofile-prefix-path=%{pgo_path_prefix} -fprofile-update=prefer-atomic -fprofile-correction | ||
%if "%{?pgo_generate:set}" == "set" | ||
%define pgo_build_flags %{pgo_common} -fprofile-generate -fprofile-dir=%%q{CMSSW_PGO_DIRECTORY}/pgo/%%p/%{pgo_package_name} | ||
%endif | ||
%if "%{?pgo_use:set}" == "set" | ||
%define pgo_build_flags %{pgo_common} -fprofile-use -fprofile-partial-training -fprofile-dir=%%q{CMSSW_PGO_DIRECTORY}/pgo/%{pgo_package_name} | ||
%endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from os.path import dirname, join | ||
pgo_packages = ["geant4", "vecgeom", "g4hepem", "dd4hep", "cmssw", "cmssw-patch", "cmssw-tool-conf"] | ||
|
||
def packages(virtual_packages, *args): | ||
opts = args[0].options | ||
if (not opts.PGOGenerate) and (not opts.PGOUse): return | ||
for pkg in pgo_packages: | ||
spec = " echo '%%define pgo_path_prefix %s'" % ('@LOCALTOP@' if pkg in ["cmssw-tool-conf"] else '%{_builddir}') | ||
spec += "; echo '%%define pgo_package_name %s'" % ('cmssw' if pkg in ["cmssw-tool-conf"] else pkg) | ||
spec += "; echo '%%define %s 1'" % ('pgo_generate' if opts.PGOGenerate else 'pgo_use') | ||
spec += "; echo '## INCLUDE compilation_flags_pgo'" | ||
spec += "; cat %s/%s.spec" % (opts.cmsdist, pkg) | ||
virtual_packages[pkg] = spec | ||
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters