Installed headers are a mixed blessing on Linux (developers have to keep track of which copy to modify) but overall probably a benefit. On Windows it seems the balance tips the other way; hence this project. End result will be to not install headers on Windows in the context of GlastRelease.
What needs to be done
Several files in the SConsFiles package need relatively small changes. Most are backwards-compatible and can be tagged early on. The final one, disabling the install of headers, should be in a new tag, made at the end of all other changes. Most other packages will also need changes to insure that, in all cases, headers belonging to one package will be accessible to other packages which need them. About 80 or the roughly 100 GR packages need changes of one sort or another. Packages which don't have any public headers can be left alone. There are 3 kinds of changes that need to be made, depending on characteristics of the package.
Type 1 Package xxx builds a shared library and has public headers. Need to add a couple lines to xxxLib.py (the file which gets invoked for the environment building xxx's library and also by other environements, building targets depending on that library) so that packages depending on xxx will get proper thing added to their include path:
if env['PLATFORM'] == 'win32' and env.get('CONTAINERNAME','') == 'GlastRelease': env.Tool('findPkgPath', package = 'Event')
Type 2 Package xxx builds a static library. Here, since the library does not depend on other package libraries, components have to be added "by hand" to the include path. These changes, varying somewhat on a per-package basis, also go in xxxLib.py.
libEnv.Tool('addLinkDeps', pacakge='idents', toBuild='static')
def generate(env, **kw): if not kw.get('depsOnly', 0): env.Tool('addLibrary', library = ['idents']) # NEW SECTION - needed for libraries or programs linking to idents library if env['PLATFORM'] == 'win32' and env.get('CONTAINERNAME','') == 'GlastRelease': env.Tool('findPkgPath', package = 'idents') env.Tool('findPkgPath', package = 'facilities') # NEW SECTION - needed to compile source files in idents if kw.get('incsOnly', 0) == 1: env.Tool('findPkgPath', package = 'facilities') return env.Tool('addLibrary', library = ['facilities'])
Type 3 Anything needing access to headers from the enums package (and not dependent on something else needing access to enums). enums doesn't have a library. When headers are installed, there is no need for explicit action to get access to enums' headers. If they're not, packages needing those headers must add an entry to their include path. If a package X references something from enums in a public header, the inclusion of the enums include path entry has to propagate to packages which might reference X's headers. This will happen naturally in nearly all cases if the new code goes in Xlib.py.
Type 4 Similar to 3, but involving a package other than enums. Any time package A needs access to a header in package B but does not need link-time access to a library in B, we need to explicitly add B's include folder to A's include path. For example, TkrUtil uses services from GlastSvc. It doesn't need to link to the GlastSvc library, but it does need IGlastDetSvc.h at compile time.
LdfEvent references a header file from Event and one from lsfData even though it doesn't link to the libraries from those packages (in fact it doesn't link to any other libraries). The Event header file in turn includes a header from enums. Here is the generate function from LdfEventLib.py:
def generate(env, **kw): if not kw.get('depsOnly', 0): env.Tool('addLibrary', library = ['LdfEvent']) if env['PLATFORM']=='win32' and env.get('CONTAINERNAME','')=='GlastRelease': env.Tool('findPkgPath', package = 'LdfEvent') if env['PLATFORM']=='win32' and env.get('CONTAINERNAME','')=='GlastRelease': env.Tool('findPkgPath', package = 'lsfData') env.Tool('findPkgPath', package='enums') env.Tool('findPkgPath', package='Event')
The work is summarized below. "Done" just means "edited", but entirely untested.
Package |
Work |
Status |
---|---|---|
SConsFiles |
Add tool findPkgPath; modify msvs.py, addLinkDeps.py, SConstruct |
Committed and tagged |
SConsFiles |
Mod to addLinkDeps to make type 2 updates neater |
done; testing in progress |
AcdRecon |
type 1, type 4 |
done |
AcdUtil |
type 1, type 2, type 4 |
done |
AdfEvent |
type 2 |
done |
AnalysisNtuple |
type 1, type 3, type 4 |
done |
AncillaryDataEvent |
type 2 |
done |
AncillaryDataUtil |
type 2 |
done |
astro |
type 1 |
committed, tagged |
CalDigi |
type 4 |
done |
CalibData |
type 1 |
committed, tagged |
calibRootData |
type 1 |
done |
CalibSvc |
type 1, type 4 |
done |
calibTkrUtil |
type 1 |
done |
calibUtil |
type 1 |
done |
CalRecon |
type 1 |
done |
CalUtil |
type 1, type 4 |
committed |
CalXtalResponse |
type 1, type 4 |
committed, tagged |
celestialSources |
type 2 |
committed, tagged |
c/EarthPhenom |
type 2 |
committed, tagged |
c/eblAtten |
type 2 |
committed, tagged |
c/genericSources |
type 2 |
committed, tagged |
c/GRB |
type 2 |
committed, tagged |
c/GRBobs |
type 2 |
committed, tagged |
c/GRBtemplate |
type 2 |
committed, tagged |
c/microQuasar |
type 2 |
committed, tagged |
c/Pulsar |
type 2 |
committed, tagged |
c/SpectObj |
type 2 |
committed, tagged |
CHS/eventFile |
type 1 |
committed, tagged |
classifier |
type 2 |
committed, tagged |
commonRootData |
type 1 |
committed, tagged |
configData |
type 1, type 3 |
committed, tagged |
ConfigSvc |
type 1, type 3 |
committed, tagged |
CRflux |
type 4 |
done |
detCheck |
type 2 |
done |
DetDisplay |
type 4 |
done |
detModel |
type 2 |
committed, tagged |
digiRootData |
type 1, type 3 |
committed, tagged |
EbfWriter |
type 1 |
done |
embed_python |
type 2 |
done |
Event |
type 1, type 3 |
committed, tagged |
evtUtils |
type 1 |
done |
facilities |
type 1 |
committed, tagged |
fitsGen |
type 2 |
done |
flux |
type 2 |
committed, tagged |
FluxSvc |
type 1 |
committed, tagged |
G4Generator |
type 1 |
done |
GCRCalib |
type 4 |
done |
gcrSelectRootData |
type 1 |
committed, tagged |
geometry |
type 2 |
committed, tagged |
geomrep |
type 2 |
done |
GlastClassify |
types 1, 2 |
done |
GlastSvc |
type 1 |
committed, tagged |
gui |
type 2 |
done |
GuiSvc |
type 1 |
done |
HepRepSvc |
type 1, type 4 |
done |
idents |
type 2 |
committed, tagged |
Interleave |
type 4 |
done |
LdfConverter |
type 4 |
done |
LdfEvent |
type 1, type 3, type 4 |
committed, tagged |
ldfReader |
type 1, type 3 |
done |
lsfData |
type 1, type 3 |
committed, tagged |
mcRootData |
type 1 |
committed, tagged |
mootCore |
type 1 |
committed, tagged |
MootSvc |
type 1 |
committed, tagged |
ntupleWriterSvc |
type 1 |
done |
OnboardFilter |
type 1, type 4 |
done |
OnboardFilterTds |
type 1, type 3 |
committed , tagged |
Overlay |
type 1, type 3, type 4 |
done |
OverlayEvent |
type 1, type 3, type 4 |
done |
overlayRootData |
type 1, type 3 |
done |
rdbModel |
type 1 |
committed, tagged |
reconRootData |
type 1, type 3 |
committed, tagged |
RootConvert |
type 1 |
committed, tagged |
RootDisplay |
type 1, type 4 |
done |
RootIo |
type 1 |
done |
rootUtil |
type 1 |
done |
tip |
type 2 |
committed |
TkrRecon |
type 1, type 4 |
done |
TkrUtil |
type 1, type 4 |
done |
Trigger |
type 1, type 3 |
committed, tagged |
xmlBase |
type 1 |
committed, tagged |
xmlUtil |
type 1 |
committed, tagged |
SConsFiles |
mod to registerTargets to not install headers |
done, tested. |