Permalink
Browse files

Start g4lbne install.

  • Loading branch information...
1 parent fe4a60a commit 2f95047b263ffce250d0d2f7299c768c414828f9 @brettviren committed May 4, 2012
Showing with 114 additions and 1 deletion.
  1. +31 −0 g4lbne.grinst
  2. +56 −0 grinst_install_g4lbne.sh
  3. +1 −1 grinst_install_geant4.sh
  4. +13 −0 grinst_setup_g4lbne.sh
  5. +13 −0 grinst_util.sh
View
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+# example configuration for grinst
+
+# REQUIRED
+
+# Where things are or to be installed
+grinst_target=/lbne/u/bvlbne/g4lbne
+
+# list of packages
+grinst_packages="cmake python ipython geant4 gccxml root g4lbne"
+
+# each package needs a _version variable
+cmake_version=2.8.7
+python_version=2.7.2
+ipython_version=0.12
+geant4_version=4.9.5.p01
+gccxml_version=0.9.0_20120309
+root_version=5.32.02
+g4lbne_version=HEAD # CVS
+
+## REQUIRED KLUDGE
+
+# Geant4 puts data in directories only partially named after version strings
+geant4_datadir=share/Geant4-9.5.1
+
+
+## OPTIONAL
+
+# parallel make
+grinst_parallel=-j8
View
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+# make a CMakeLists.txt to build g4lbne
+g4lbne_spit_cmakelists () {
+ srcdir=$1 ; shift
+
+cat <<EOF > $srcdir/CMakeLists.txt
+cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
+
+project(g4lbne)
+
+# Hook into Geant4
+find_package(Geant4 REQUIRED)
+include(${Geant4_USE_FILE})
+
+# Hook into ROOT
+find_package(ROOT REQUIRED)
+include(${ROOT_USE_FILE})
+
+include_directories(${PROJECT_SOURCE_DIR}/include)
+file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc)
+file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)
+
+ROOT_GENERATE_DICTIONARY(g4lbnedict ${headers} LINKDEF Linkdef.h OPTIONS -p)
+
+add_executable(g4lbne g4lbne.cc ${sources} ${headers})
+target_link_libraries(g4lbne ${Geant4_LIBRARIES} ${ROOT_LIBRARIES} Tree)
+
+EOF
+
+grinst_install_g4lbne () {
+ local version=$1; shift
+ local prefix=$1 ; shift
+
+ eval $(grinst_setup cmake)
+ eval $(grinst_setup geant4)
+ eval $(grinst_setup root)
+
+ local srcdir=lbne-beamsim/g4lbne
+ local blddir=${srcdir}-cmake-build
+
+ # this is read-only
+ cvsco :pserver:anonymous@cdcvs.fnal.gov:/cvs/projects/lbne-beamsim $srcdir
+
+ srcdir=$(readlink -f $srcdir)
+
+ assuredir $blddir
+ pushd $blddir
+ g4lbne_spit_cmakelists $srcdir
+
+ cmake -DCMAKE_INSTALL_PREFIX=$prefix $srcdir
+ make
+ make install
+ popd
+}
+
View
@@ -6,7 +6,7 @@ grinst_install_geant4 () {
eval $(grinst_setup cmake)
- local unpacked="geant4.${version}"
+ local unpacked="geant${version}"
local tarball="${unpacked}.tar.gz"
local url="http://geant4.cern.ch/support/source/$tarball"
View
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+grinst_setup_g4lbne () {
+ local prefix=$1; shift
+
+ export PATH=$(pathadd $prefix/bin $PATH)
+ export LD_LIBRARY_PATH=$(pathadd $prefix/bin $LD_LIBRARY_PATH)
+ cat <<EOF
+export PATH=$PATH
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
+EOF
+
+}
View
@@ -92,6 +92,19 @@ untar () {
}
+cvsco () {
+ url=$1 ; shift
+ module=$1 ; shift
+
+ if [ -d "$module" ] ; then
+ echo "CVS module \"$module\" already checked out"
+ return
+ fi
+
+ cvs -d $url checkout $module
+}
+
+
svnco () {
url=$1 ; shift
tgt=$1 ; shift

0 comments on commit 2f95047

Please sign in to comment.