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:

Code in EventLib.py for pkg Event
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.

Code in SConscript for pkg idents
 libEnv.Tool('addLinkDeps', pacakge='idents', toBuild='static')
Code in identsLib.py
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:

Handling Type 3 and Type 4
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

SConsFiles-00-28-01

SConsFiles

Mod to addLinkDeps to make type 2 updates neater

committed

AcdRecon

type 1, type 4

AcdRecon-05-04-00

AcdUtil

type 1, type 2, type 4

AcdUtil-03-03-00

AdfEvent

type 2

AdfEvent-00-06-00

AnalysisNtuple

type 1, type 3, type 4

AnalysisNtuple-02-64-00

AncillaryDataEvent

type 2

AncillaryDataEvent-01-05-00

AncillaryDataUtil

type 2

AncillaryDataUtil-01-01-00

astro

type 1

astro-03-14-00

CalDigi

type 4

CalDigi-03-09-00

CalibData

type 1

CalibData-00-28-00

calibRootData

type 1

calibRootData-01-08-00

CalibSvc

type 1, type 4

CalibSvc-00-42-00

calibUtil

type 1

calibUtil-01-14-00

CalRecon

type 1

CalRecon-06-19-00

CalUtil

type 1, type 4

CalUtil-03-15-00

CalXtalResponse

type 1, type 4

CalXtalResponse-00-27-00

celestialSources

type 2

celestialSources-01-06-00

c/EarthPhenom

type 2

EarthPhenom-00-02-00

c/eblAtten

type 2

eblAtten-00-09-00

c/genericSources

type 2

genericSources-01-17-00

c/GRB

type 2

GRB-04-05-00

c/GRBobs

type 2

GRBobs-03-04-00

c/GRBtemplate

type 2

GRBtemplate-01-04-00

c/microQuasar

type 2

microQuasar-01-05-00

c/Pulsar

type 2

Pulsar-03-02-00

c/SpectObj

type 2

SpectObj-01-04-00

CHS/eventFile

type 1

eventFile-09-01-00

classifier

type 2

classifier-01-07-00

commonRootData

type 1

commonRootData-02-17-00

configData

type 1, type 3

configData-01-12-00

ConfigSvc

type 1, type 3

ConfigSvc-00-04-00

CRflux

type 4

CRflux-01-20-00

detCheck

type 2

detCheck-01-08-00

DetDisplay

type 4

DetDisplay-03-06-00

detModel

type 2

detModel-02-22-00

digiRootData

type 1, type 3

digiRootData-11-15-00

EbfWriter

type 1

EbfWriter-01-11-00

embed_python

type 2

embed_python-01-06-00

Event

type 1, type 3

Event-14-14-00

evtUtils

type 1

evtUtils-00-02-00

facilities

type 1

facilities-02-21-00

fitsGen

type 2

fitsGen-06-05-00

flux

type 2

flux-08-43-00

FluxSvc

type 1

FluxSvc-06-59-00

G4Generator

type 1

G4Generator-06-06-00

GCRCalib

type 4

GCRCalib-01-11-00

gcrSelectRootData

type 1

gcrSelectRootData-02-03-00

geometry

type 2

geometry-03-03-00

geomrep

type 2

geomrep-04-04-00

GlastClassify

types 1, 2

GlastClassify-07-10-00

GlastSvc

type 1

GlastSvc-11-01-00

gui

type 2

gui-03-08-00

GuiSvc

type 1

GuiSvc-03-11-00

HepRepSvc

type 1, type 4

HepRepSvc-00-42-00

idents

type 2

idents-02-21-00

Interleave

type 4

Interleave-01-08-00

LdfConverter

type 4

LdfConverter-04-07-00

LdfEvent

type 1, type 3, type 4

LdfEvent-04-13-00

ldfReader

type 1, type 3

ldfReader-07-05-00

lsfData

type 1, type 3

lsfData-04-04-00

mcRootData

type 1

mcRootData-02-23-00

mootCore

type 1

mootCore-01-25-00

MootSvc

type 1

MootSvc-01-03-00

ntupleWriterSvc

type 1

ntupleWriterSvc-06-02-00

OnboardFilter

type 1, type 4

OnboardFilter-04-17-00

OnboardFilterTds

type 1, type 3

OnboardFilterTds-00-12-00

Overlay

type 1, type 3, type 4

Overlay-02-03-00

OverlayEvent

type 1, type 3, type 4

OverlayEvent-01-01-00

overlayRootData

type 1, type 3

overlayRootData-00-04-00

rdbModel

type 1

rdbModel-02-15-00

reconRootData

type 1, type 3

reconRootData-09-30-00

RootConvert

type 1

RootConvert-01-52-00

RootDisplay

type 1, type 4

RootDisplay-00-06-00

RootIo

type 1

RootIo-25-05-00

rootUtil

type 1

rootUtil-01-05-00

tip

type 2

tip-02-18-00

TkrRecon

type 1, type 4

TkrRecon-10-34-00

TkrUtil

type 1, type 4

TkrUtil-03-27-00

Trigger

type 1, type 3

Trigger-07-05-00

xmlBase

type 1

xmlBase-05-06-00

xmlUtil

type 1

xmlUtil-03-05-00

SConsFiles

mod to registerTargets.py to not install headers;
mod to processExternals.py for rootcint
mod to msvs.py for rootcint
mod to SConstruct so as to not break creating installer zip files

done, tested.  

  • No labels