build.sh
Go to the documentation of this file.
1 #!/bin/bash
2 
3 TOPDIR=${PWD}
4 
5 FORCE=no
6 if [[ $# == 1 && x$1 == x-f ]]; then FORCE=yes; fi
7 
8 # set up software
9 source /cvmfs/dune.opensciencegrid.org/products/dune/setup_dune.sh
10 setup cmake v3_9_0
11 setup gcc v6_4_0
12 setup pycurl
13 setup ifdhc
14 setup dk2nugenie v01_06_01f -q debug:e15
15 setup genie_xsec v2_12_10 -q DefaultPlusValenciaMEC
16 setup genie_phyopt v2_12_10 -q dkcharmtau
17 setup geant4 v4_10_3_p01b -q e15:prof
18 setup jobsub_client
19 setup eigen v3_3_5
20 
21 # edep-sim needs to know where a certain GEANT .cmake file is...
22 G4_cmake_file=`find ${GEANT4_FQ_DIR}/lib64 -name 'Geant4Config.cmake'`
23 export Geant4_DIR=`dirname $G4_cmake_file`
24 
25 # Get edep-sim and build it
26 if [ $FORCE == yes ]; then rm -rf edep-sim; fi
27 git clone https://github.com/ClarkMcGrew/edep-sim.git
28 cd edep-sim
29 sed -i 's/add_definitions(-DEDEPSIM_FORCE_PRIVATE_FIELDS)//g' */CMakeLists.txt
30 source setup.sh
31 source build/edep-build.sh
32 
33 cd ${TOPDIR}
34 
35 # Get nusystematics and built it "artless"
36 # The ART-dependent version can be ups setup but for ND we need this special build
37 #
38 # v00_04_01 is the last version to depend on genie v2 (specifically v2_12_10d)
39 if [ $FORCE == yes ]; then rm -rf nusystematics; fi
40 git clone ssh://p-nusystematics@cdcvs.fnal.gov/cvs/projects/nusystematics -b v00_04_01
41 mkdir nusystematics/build
42 cd nusystematics/build
43 cmake ../ -DUSEART=0 -DLIBXML2_LIB=/cvmfs/larsoft.opensciencegrid.org/products/libxml2/v2_9_5/Linux64bit+2.6-2.12-prof/lib/ -DLIBXML2_INC=/cvmfs/larsoft.opensciencegrid.org/products/libxml2/v2_9_5/Linux64bit+2.6-2.12-prof/include/libxml2 -DPYTHIA6=/cvmfs/larsoft.opensciencegrid.org/products/pythia/v6_4_28i/Linux64bit+2.6-2.12-gcc640-prof/lib
44 make -j systematicstools # force this to build first
45 make -j
46 make -j install
47 
48 cd ${TOPDIR}
49 
50 # Get Geometric efficiency library and build
51 if [ $FORCE == yes ]; then rm -rf DUNE_ND_GeoEff; fi
52 git clone --recurse-submodules https://github.com/cvilelasbu/DUNE_ND_GeoEff.git
53 cd DUNE_ND_GeoEff
54 cmake -DPYTHON_EXECUTABLE:FILEPATH=`which python` .
55 make -j pyGeoEff
56 
57 cd ${TOPDIR}
58 
59 # Add nusystematics to the paths
60 export LD_LIBRARY_PATH=${TOPDIR}/nusystematics/build/Linux/lib:$LD_LIBRARY_PATH
61 export LD_LIBRARY_PATH=${TOPDIR}/nusystematics/build/nusystematics/artless:$LD_LIBRARY_PATH
62 export FHICL_FILE_PATH=${TOPDIR}/nusystematics/nusystematics/fcl:$FHICL_FILE_PATH
63 
64 # Add pyGeoEff to pythonpath
65 export PYTHONPATH=${PYTHONPATH}:${TOPDIR}/DUNE_ND_GeoEff/lib/
66 
67 # make tarballs of edep-sim and nusystematics for grid jobs
68 tar -zcf edep-sim.tar.gz edep-sim
69 tar -zcf nusystematics.tar.gz nusystematics
70 tar -zcf DUNE_ND_GeoEff.tar.gz DUNE_ND_GeoEff