You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 21 Next »

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

Committed and tagged

SConsFiles

Mod to addLinkDeps to make type 2 updates neater

done; testing in progress

AcdRecon

type 1, type 4

committed

AcdUtil

type 1, type 2, type 4

committed

AdfEvent

type 2

committed

AnalysisNtuple

type 1, type 3, type 4

committed

AncillaryDataEvent

type 2

committed

AncillaryDataUtil

type 2

committed

astro

type 1

committed, tagged

CalDigi

type 4

committed

CalibData

type 1

committed, tagged

calibRootData

type 1

committed

CalibSvc

type 1, type 4

committed

calibUtil

type 1

committed

CalRecon

type 1

committed

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

committed

detCheck

type 2

committed

DetDisplay

type 4

committed

detModel

type 2

committed, tagged

digiRootData

type 1, type 3

committed, tagged

EbfWriter

type 1

committed

embed_python

type 2

committed

Event

type 1, type 3

committed, tagged

evtUtils

type 1

committed

facilities

type 1

committed, tagged

fitsGen

type 2

committed

flux

type 2

committed, tagged

FluxSvc

type 1

committed, tagged

G4Generator

type 1

committed

GCRCalib

type 4

committed

gcrSelectRootData

type 1

committed, tagged

geometry

type 2

committed, tagged

geomrep

type 2

committed

GlastClassify

types 1, 2

committed

GlastSvc

type 1

committed, tagged

gui

type 2

committed

GuiSvc

type 1

committed

HepRepSvc

type 1, type 4

committed

idents

type 2

committed, tagged

Interleave

type 4

committed

LdfConverter

type 4

committed

LdfEvent

type 1, type 3, type 4

committed, tagged

ldfReader

type 1, type 3

committed

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

committed

OnboardFilter

type 1, type 4

committed

OnboardFilterTds

type 1, type 3

committed , tagged

Overlay

type 1, type 3, type 4

committed

OverlayEvent

type 1, type 3, type 4

committed

overlayRootData

type 1, type 3

committed

rdbModel

type 1

committed, tagged

reconRootData

type 1, type 3

committed, tagged

RootConvert

type 1

committed, tagged

RootDisplay

type 1, type 4

committed

RootIo

type 1

committed

rootUtil

type 1

committed

tip

type 2

committed, tagged

TkrRecon

type 1, type 4

committed

TkrUtil

type 1, type 4

committed

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.  

  • No labels