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

Compare with Current View Page History

« Previous Version 12 Next »

Prerequisites

Python

If you don't already have it (python external libraries under GLAST_EXT don't count) install python from the official site .  Version should be at least 2.5; 2.6 or 2.7 preferred.  Do not attempt to use a version in the 3.x series.

SCons

You'll need 1.3.0 or newer; 2.1.0 is preferred.  You can get it from the official SCons site .

GlastRelease

Installers

The simplest way to get the source for a particular tag and the externals it uses is with one or the other of the installers.  Because of a recently-fixed bug, older tags are not available this way, but tags made on or after May 29th should be.  Here are links for the gui and command-line installers. 

Note: the "source" zip file for Windows tags is actually source plus all built and installed products. This is not the intent and may be fixed at a later date.  The only downside is that the zip file is much larger than it needs to be. If you download and unzip such a file, in the "Building Preliminary Targets" step below you'll only need to build StudioFiles; setup and to_install will already be built.

If you need access to other tags or if you want to check out code which has not yet been tagged you will need to resort to the techniques described below.

GR source

First determine what specific tag you want.  (As of June 4th - LATEST 5682 is preferred.  Or get 5676 and do cvs update -A SConsFiles)  It can be checked out of CVS

cvs co -d GR-5682 -r GlastRelease-LATEST-1-5682 GlastRelease-scons

(note the -d option above is not necessary. Including -d GR-5682 will cause the top-level directory of the check-out code to be called GR-5682.  By default it would be named after the module being checked out; i.e., GlastRelease-scons)

or you can copy a zip file of source from SLAC nfs.  In this case, the path is

/nfs/farm/g/glast/u52/ReleaseManagerBuild/Windows-i386-32bit-vc90/Debug/GlastRelease/GlastRelease-LATEST-1-5682-source.zip

Replace "source" above with "devel" to get a zip file which includes final build products along with source.

Externals

You will also need a compatible set of externals.  For tags not available from the installer, the easiest way to get any that you don't already have is probably to copy them from the V disk.

Here are the ones used in the SCons build for LATEST 5670:

CLHEP 2.1.2.2-dbg $GLAST_EXT\CLHEP\2.1.2.2-dbg\vc90\lib

cfitsio v3060A $GLAST_EXT\cfitsio\v3060A\vc90\lib

swig 1.3.31 $GLAST_EXT\swig\1.3.31\vc90

xerces 2.8.0-gl1-dbg $GLAST_EXT\xerces\2.8.0-gl1-dbg\vc90\bin

cppunit 1.10.2 $GLAST_EXT\cppunit\1.10.2\vc90\lib

python 2.6.5 $GLAST_EXT\python\2.6.5\vc90

ROOT v5.26.00a-gl3-dbg $GLAST_EXT\ROOT\v5.26.00a-gl3-dbg\vc90\lib

TMineExt 3.2.5 $GLAST_EXT\TMineExt\3.2.5\lib

gaudi v21r7-gl1-dbg $GLAST_EXT\gaudi\v21r7-gl1-dbg\vc90\lib

geant4 9.4.p03-gl1-dbg $GLAST_EXT\geant4\9.4.p03-gl1-dbg\vc90\lib

ldf v07-01-01-gl1 $GLAST_EXT\ldf\v07-01-01-gl1\vc90\lib

mysql 5.1.39 $GLAST_EXT\mysql\5.1.39\vc90\lib\opt

zlib 1.1.4 $GLAST_EXT\zlib\1.1.4\vc90

extFiles v0r9 $GLAST_EXT\extFiles\v0r9

obf B3-0-0 $GLAST_EXT\obf\B3-0-0\lib

OmniOrb 4.1.4 $GLAST_EXT\OmniOrb\4.1.4\vc90\lib

fox 1.4.34-gl2-dbg $GLAST_EXT\fox\1.4.34-gl2-dbg\vc90\lib

For any RM tag you can find out what externals were used by examining the compile output for that build. This output can be found for each build in the  RM II web pages or by running the stand-alone program RMViewer , available via ftp .  The list of externals used is near the top, following a string of lines starting "Checking for C++ ..."  

Building Preliminary Targets

There is a certain amount of bootstrapping which has to take place before you can use Visual Studio.  Assuming scons is in your path and GLAST_EXT is properly defined, from a VS 2008 console window you can cd to the root directory of your GlastRelease source and issue the following commands:

scons --with-GLAST-EXT=%GLAST_EXT% --compile-debug --vc9 setup

scons --with-GLAST-EXT=%GLAST_EXT% --compile-debug --vc9 StudioFiles

scons --with-GLAST-EXT=%GLAST_EXT% --compile-debug --vc9 to_install

or use GoGui , available via ftp, to do the same thing.

The first creates a file, _setup.bat, which defines environment variables needed before starting up Visual Studio or for running executables belonging to GR once they are built.

The StudioFiles target includes project files for all library and executable targets.  It also writes a solution file for each package and two special files all.sln (references all project files) and allGleam.sln (references all library projects plus Gleam and test_Gleam projects).  

to_install installs all headers, xml files, job options files, etc.  (Recall that, unlike CMT, SCons as we have customized it installs all source files needed at build or run-time as well as libraries and executables.)   As of GlastRelease LATEST 5677 (in particular, SConsFiles-00-23-05), the Visual Studio project files generated will take care of installing all headers and other source files, but not quite always in the right order.  To be certain to avoid compile failures due to missing headers, it's recommended you start out by installing all source files from SCons.  Re-installs after updates can be done from within VS.

Starting up VS

Bring up a VS 2008 console window.  Run the setup file created above.  Relative to the root directory of your source installation, it will have a path more or less like
bin\Windows-i386-32bit-vc90-Debug\ _setup.bat

Next cd into the directory containing the project and solution files.  Relative to the root directory this will be something like studio\Windows-i386-32bit-vc90-Debug

Then start up VS on one of the solution files, e.g.

devenv allGleam.sln

Alternatively you can start up a solution file from within GoGui. Select the root directory. Then, in the bottom navigator pane, navigate to the subdirectory with a name  like studio\Window-i386-32bit-vc90-Debug.  You can start up VS by right-clicking on any solution file and selecting the Studio menu item.

Known issues

Installing headers

VS project files do not have the same level of granularity that SCons does in handling the installation of header files.  SCons parses C++ source to compute dependencies on headers and will automatically install any header needed to compile an object it is trying to build.  As far as I can tell, VS project files do not natively support the idea of installing files.  The approach I took was to generate a .bat file for each package which installs files (headers, job options, xml, etc.) belonging to that package, then invoke it in a project file belonging to that package.   Usually it's the same project file that builds the package's library.  If the package doesn't build a library, there is an extra VS project file which does nothing but invoke the .bat file.  However, there is no easy way to determine dependencies and build order among these project files.

I think that most scenarios of modifying headers from within Studio will be handled correctly, but this needs to be tested. The intent is that developers modify the original (within the package) copy of the header,job options file or what have you, and the build process should install it.

  • No labels