Build Scripts and Makefiles

From GlueXWiki
Revision as of 13:47, 7 April 2010 by Marki (Talk | contribs) (Build script examples moved to Build Scripts and Makefiles: make this a reference page)

Jump to: navigation, search

I've written a set of scripts that will retrieve and build various components of the Hall-D/GlueX software infrastructure. The scripts can serve as examples of the steps involved.

Get the scripts

They are stored in the Hall D Subversion repository. To check them out:

svn checkout https://halldsvn.jlab.org/repos/trunk/scripts/build_scripts

This will create the directory build_scripts in your current working directory. Alternately to can get a tarball at:

http://www.jlab.org/~marki/halld/build_scripts_2008-12-01.tar

Contents of the directory

  • build.csh Example C-shell script to build everything from scratch.
  • delpath.pl Perl script to remove specified directories from the PATH environment variable (works for C shell only). Used by gluex_env_clean.csh.
  • geant4.8.1.p01.tcl Expect script used by geant4_install.sh. Expect is used to answer questions asked by the GEANT4 installation script.
  • geant4_install.sh Bourne shell script to build GEANT4 from source. Uses geant4.8.1.p01.tcl to handle the interactive dialog in the installation script.
  • gluex_env_clean.csh Un-does the actions of gluex_env.csh.
  • gluex_env.csh Sets up the environment in the C shell for building JANA and Hall-D packages.
  • gluex_env_jlab_f8.csh Environment set-up to use a specific build on the JLab CUE, using Fedora 8 Linux.
  • hdds_install.sh Bourne shell script to install a stand-alone version of the HDDS package. Not necessary for Hall D users.
  • Makefile_all Makefile that builds everything. Invokes all of the other makefiles in this directory in a sensible order.
  • Makefile_cernlib Makefile that builds CERNLIB from source. This may be necessary if a compatible binary version does not exist at CERN and/or if the RedHat rpm is missing certain key packages due to license issues.
  • Makefile_clhep Makefile to build clhep. CLHEP is used as a sort of C++ CERNLIB-replacement by GEANT4.
  • Makefile_halld Makefile to build the Hall-D/GlueX software packages. Relies on JANA having been built.
  • Makefile_jana Makefile for building the JANA package.
  • Makefile_root Makefile for building ROOT from source.
  • Makefile_xerces Makefile that builds the XERCES-C++ package from Apache from source.
  • patches Directory containing various patches needed to build some of the packages.

Note: GEANT4 is not currently used by GlueX/Hall-D software.

Using the scripts

Generally one should follow the relevant instructions on the Hall D wiki pages. These scripts give concrete examples of how one might structure a build session. In most cases the retrieval of the source code from web or subversion servers is scripted.

Do-It-All Example

Follow example in build.csh:

setenv GLUEX_TOP /scratch/gluex
mkdir -p $GLUEX_TOP
cd $GLUEX_TOP
svn co https://halldsvn.jlab.org/repos/trunk/scripts/build_scripts
source build_scripts/gluex_env.csh
make -f $BUILD_SCRIPTS/Makefile_all

Partial Builds

If you are interested in only one package, say the HallD stuff you can replace the "make" step with

 make -f $BUILD_SCRIPTS/Makefile_all halld_build

The choices are listed in the "all" target of Makefile_all:

 all: env xerces_build cernlib_build root_build clhep_build jana_build halld_build

--Marki 5 December 2008