Difference between revisions of "Build Scripts and Makefiles"

From GlueXWiki
Jump to: navigation, search
m (Example build script moved to Build script examples: make it plural)
(first draft)
Line 1: Line 1:
The following steps will build JANA and the Hall D software tree in the directores "jana" and "gluex" respectively, creating them in the current working directory. It is assumed that the support packages (xerces, cernlib, root, etc.) have all been installed previoiusly. All necessary environment variables are set explicitly here; they will likely not be appropriate for your machine and must be modified to fit your particular environment. This worked for me from a Fedora 7 box.
+
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.
  
<pre>
+
=Get the scripts=
mkdir jana
+
 
cd jana
+
They are stored in the Hall D Subversion repository. To check them out:
set jana_release=jana_0.2.0
+
 
wget http://www.jlab.org/JANA/releases/$jana_release.tgz
+
svn checkout https://halldsvn.jlab.org/repos/trunk/scripts/build_scripts
tar zxvf $jana_release.tgz
+
 
cd $jana_release
+
This will create the directory build_scripts in your current working directory. Alternately to can get a tarball at:
setenv JANA_HOME $cwd
+
 
rm -rf bin lib include
+
http://www.jlab.org/~marki/halld/build_scripts_2008-06-18.tar
cd src/JANA
+
 
setenv OS `/bin/uname -s`
+
=Contents of the directory=
setenv ARCH `/bin/uname -p`
+
 
setenv OSNAME ${OS}-${ARCH}
+
* '''cernlib_build.sh''' Bourne shell script 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.
make clean
+
* '''clhep_install.sh''' Bourne shell script to build the CLHEP package from source. CLHEP is used as a sort of C++ CERNLIB-replacement by GEANT4.
make
+
* '''geant4.8.1.p01.tcl''' Expect script used by '''geant4_install.sh'''. Expect is used to answer questions asked by the GEANT4 installation script.
make install
+
* '''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.
cd ../../../..
+
* '''gluex_env.csh''' Sets up the environment in the C shell for building JANA and Hall-D packages.
mkdir halld
+
* '''halld_build.csh''' C shell script to build the Hall-D software packages. Relies on JANA having been built.
cd halld
+
* '''hdds_install.sh''' Bourne shell script to install a stand-alone version of the HDDS package. Not necessary for Hall D users.
set release=release-2008-04-02
+
* '''jana_build.csh''' Bourne shell script for building the JANA package.
svn checkout https://halldsvn.jlab.org/repos/tags/release-2008-04-02
+
* '''Makefile_root''' GNU makefile for building ROOT from source.
setenv HALLD_HOME $cwd
+
* '''patches''' Directory containing various patches needed to build some of the packages.
mv $release src
+
* '''xerces-c_install.sh''' Bourne shell script build the XERCES-C++ package from Apache from source.
cd src
+
 
setenv ROOTSYS /usr/local/root/prod
+
Note: GEANT4 is not currently used by GlueX/Hall-D software.
setenv XERCESCROOT /usr/local/xerces-c/prod
+
 
setenv XERCES_INCLUDE $XERCESCROOT/include
+
=Using the scripts=
setenv LD_LIBRARY_PATH  $ROOTSYS/lib:$XERCESCROOT/lib
+
 
setenv CERN /usr/local/cernlib
+
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.
setenv CERN_LEVEL 2006
+
 
eval `addpath.pl $ROOTSYS/bin $CERN/$CERN_LEVEL/bin`
+
N. B. (June 2008): Until recently these were all private scripts that used on Linux boxes under my direct control. There are still a few "Mark's-isms" in the scripts. If there is demand, they can be polished for general use. In the mean time if you have questions or need interpretations, do not hesitate to contact [[User:Marki|me]].
make FC=gfortran DFC=gfortran
+
 
cd ../..
+
--[[User:Marki|Marki]] 15:24, 18 June 2008 (EDT)
</pre>
+

Revision as of 15:24, 18 June 2008

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-06-18.tar

Contents of the directory

  • cernlib_build.sh Bourne shell script 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.
  • clhep_install.sh Bourne shell script to build the CLHEP package from source. CLHEP is used as a sort of C++ CERNLIB-replacement by GEANT4.
  • 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.csh Sets up the environment in the C shell for building JANA and Hall-D packages.
  • halld_build.csh C shell script to build the Hall-D software packages. Relies on JANA having been built.
  • hdds_install.sh Bourne shell script to install a stand-alone version of the HDDS package. Not necessary for Hall D users.
  • jana_build.csh Bourne shell script for building the JANA package.
  • Makefile_root GNU makefile for building ROOT from source.
  • patches Directory containing various patches needed to build some of the packages.
  • xerces-c_install.sh Bourne shell script build the XERCES-C++ package from Apache from source.

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.

N. B. (June 2008): Until recently these were all private scripts that used on Linux boxes under my direct control. There are still a few "Mark's-isms" in the scripts. If there is demand, they can be polished for general use. In the mean time if you have questions or need interpretations, do not hesitate to contact me.

--Marki 15:24, 18 June 2008 (EDT)