-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathfairship.sh
165 lines (159 loc) · 7.28 KB
/
fairship.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
package: FairShip
version: master
source: https://github.com/ShipSoft/FairShip
tag: master
requires:
- generators
- simulation
- FairRoot
- FairLogger
- GENIE
- GenFit
- GEANT4
- PHOTOSPP
- EvtGen
- ROOT
- VMC
incremental_recipe: |
rsync -ar $SOURCEDIR/ $INSTALLROOT/
cmake --build . ${JOBS+-j$JOBS} --target install
#Get the current git hash
cd $SOURCEDIR
FAIRSHIP_HASH=$(git rev-parse HEAD)
cd $BUILDDIR
# Modulefile
MODULEDIR="$INSTALLROOT/etc/modulefiles"
MODULEFILE="$MODULEDIR/$PKGNAME"
mkdir -p "$MODULEDIR"
cat > "$MODULEFILE" <<EoF
#%Module1.0
proc ModulesHelp { } {
global version
puts stderr "ALICE Modulefile for $PKGNAME $PKGVERSION-@@PKGREVISION@$PKGHASH@@"
}
set version $PKGVERSION-@@PKGREVISION@$PKGHASH@@
module-whatis "ALICE Modulefile for $PKGNAME $PKGVERSION-@@PKGREVISION@$PKGHASH@@"
# Dependencies
module load BASE/1.0 \\
${GEANT4_VERSION:+GEANT4/$GEANT4_VERSION-$GEANT4_REVISION} \\
${GENIE_VERSION:+GENIE/$GENIE_VERSION-$GENIE_REVISION} \\
${PHOTOSPP_VERSION:+PHOTOSPP/$PHOTOSPP_VERSION-$PHOTOSPP_REVISION} \\
${EVTGEN_VERSION:+EvtGen/$EVTGEN_VERSION-$EVTGEN_REVISION} \\
${FAIRROOT_VERSION:+FairRoot/$FAIRROOT_VERSION-$FAIRROOT_REVISION} \\
${GENFIT_VERSION:+GenFit/$GENFIT_VERSION-$GENFIT_REVISION}
# Our environment
setenv EOSSHIP root://eospublic.cern.ch/
setenv FAIRSHIP_ROOT \$::env(BASEDIR)/$PKGNAME/\$version
setenv FAIRSHIP \$::env(FAIRSHIP_ROOT)
setenv FAIRSHIP_HASH $FAIRSHIP_HASH
setenv VMCWORKDIR \$::env(FAIRSHIP)
setenv GEOMPATH \$::env(FAIRSHIP)/geometry
setenv CONFIG_DIR \$::env(FAIRSHIP)/gconfig
setenv GALGCONF \$::env(FAIRSHIP_ROOT)/shipgen/genie_config
prepend-path PATH \$::env(FAIRSHIP_ROOT)/bin
prepend-path LD_LIBRARY_PATH \$::env(FAIRSHIP_ROOT)/lib
setenv FAIRLIBDIR \$::env(FAIRSHIP_ROOT)/lib
prepend-path ROOT_INCLUDE_PATH \$::env(FAIRSHIP_ROOT)/include
append-path ROOT_INCLUDE_PATH \$::env(GEANT4_ROOT)/include
append-path ROOT_INCLUDE_PATH \$::env(GEANT4_ROOT)/include/Geant4
append-path ROOT_INCLUDE_PATH \$::env(PYTHIA_ROOT)/include
append-path ROOT_INCLUDE_PATH \$::env(PYTHIA_ROOT)/include/Pythia8
append-path ROOT_INCLUDE_PATH \$::env(GEANT4_VMC_ROOT)/include
append-path ROOT_INCLUDE_PATH \$::env(GEANT4_VMC_ROOT)/include/geant4vmc
prepend-path PYTHONPATH \$::env(FAIRSHIP_ROOT)/python
append-path PYTHONPATH \$::env(FAIRSHIP_ROOT)/Developments/track_pattern_recognition
$([[ ${ARCHITECTURE:0:3} == osx ]] && echo "prepend-path DYLD_LIBRARY_PATH \$::env(FAIRSHIP_ROOT)/lib")
EoF
---
#!/bin/sh
# Making sure people do not have SIMPATH set when they build fairroot.
# Unfortunately SIMPATH seems to be hardcoded in a bunch of places in
# fairroot, so this really should be cleaned up in FairRoot itself for
# maximum safety.
unset SIMPATH
case $ARCHITECTURE in
osx*)
# If we preferred system tools, we need to make sure we can pick them up.
[[ ! $BOOST_ROOT ]] && BOOST_ROOT=`brew --prefix boost`
[[ ! $ZEROMQ_ROOT ]] && ZEROMQ_ROOT=`brew --prefix zeromq`
[[ ! $PROTOBUF_ROOT ]] && PROTOBUF_ROOT=`brew --prefix protobuf`
[[ ! $NANOMSG_ROOT ]] && NANOMSG_ROOT=`brew --prefix nanomsg`
[[ ! $GSL_ROOT ]] && GSL_ROOT=`brew --prefix gsl`
SONAME=dylib
;;
*) SONAME=so ;;
esac
rsync -a $SOURCEDIR/ $INSTALLROOT/
cmake $SOURCEDIR \
-DFAIRBASE="$FAIRROOT_ROOT/share/fairbase" \
-DFAIRROOTPATH="$FAIRROOTPATH" \
-DFAIRROOT_INCLUDE_DIR="$FAIRROOT_ROOT/include" \
-DFAIRROOT_LIBRARY_DIR="$FAIRROOT_ROOT/lib" \
-DFAIRLOGGER_INCLUDE_DIR="$FAIRLOGGER_ROOT/include" \
-DFMT_INCLUDE_DIR="$FMT_ROOT/include" \
-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
-DROOT_DIR=$ROOT_ROOT \
-DHEPMC_DIR=$HEPMC_ROOT \
-DHEPMC_INCLUDE_DIR=$HEPMC_ROOT/include/HepMC \
-DEVTGEN_INCLUDE_DIR=$EVTGEN_ROOT/include \
-DEVTGEN_LIBRARY_DIR=$EVTGEN_ROOT/lib \
${PYTHON_ROOT:+-DPYTHON_LIBRARY=$PYTHON_ROOT/lib} \
${PYTHON_ROOT:+-DPYTHON_INCLUDE_DIR=$PYTHON_ROOT/include/python3.6m/} \
-DPYTHIA8_DIR=$PYTHIA_ROOT \
-DPYTHIA8_INCLUDE_DIR=$PYTHIA_ROOT/include \
-DGEANT4_ROOT=$GEANT4_ROOT \
-DGEANT4_INCLUDE_DIR=$GEANT4_ROOT/include/Geant4 \
-DGEANT4_VMC_INCLUDE_DIR=$GEANT4_VMC_ROOT/include/geant4vmc \
${CMAKE_VERBOSE_MAKEFILE:+-DCMAKE_VERBOSE_MAKEFILE=ON} \
${BOOST_ROOT:+-DBOOST_ROOT=$BOOST_ROOT} \
${GENFIT:+-Dgenfit2_ROOT=$GENFIT} \
-DCMAKE_INSTALL_PREFIX=$INSTALLROOT
cmake --build . ${JOBS+-j$JOBS} --target install
#Get the current git hash
cd $SOURCEDIR
FAIRSHIP_HASH=$(git rev-parse HEAD)
cd $BUILDDIR
# Modulefile
MODULEDIR="$INSTALLROOT/etc/modulefiles"
MODULEFILE="$MODULEDIR/$PKGNAME"
mkdir -p "$MODULEDIR"
cat > "$MODULEFILE" <<EoF
#%Module1.0
proc ModulesHelp { } {
global version
puts stderr "ALICE Modulefile for $PKGNAME $PKGVERSION-@@PKGREVISION@$PKGHASH@@"
}
set version $PKGVERSION-@@PKGREVISION@$PKGHASH@@
module-whatis "ALICE Modulefile for $PKGNAME $PKGVERSION-@@PKGREVISION@$PKGHASH@@"
# Dependencies
module load BASE/1.0 \\
${GEANT4_VERSION:+GEANT4/$GEANT4_VERSION-$GEANT4_REVISION} \\
${GENIE_VERSION:+GENIE/$GENIE_VERSION-$GENIE_REVISION} \\
${PHOTOSPP_VERSION:+PHOTOSPP/$PHOTOSPP_VERSION-$PHOTOSPP_REVISION} \\
${EVTGEN_VERSION:+EvtGen/$EVTGEN_VERSION-$EVTGEN_REVISION} \\
${FAIRROOT_VERSION:+FairRoot/$FAIRROOT_VERSION-$FAIRROOT_REVISION} \\
${GENFIT_VERSION:+GenFit/$GENFIT_VERSION-$GENFIT_REVISION}
# Our environment
setenv EOSSHIP root://eospublic.cern.ch/
setenv FAIRSHIP_ROOT \$::env(BASEDIR)/$PKGNAME/\$version
setenv FAIRSHIP \$::env(FAIRSHIP_ROOT)
setenv FAIRSHIP_HASH $FAIRSHIP_HASH
setenv VMCWORKDIR \$::env(FAIRSHIP)
setenv GEOMPATH \$::env(FAIRSHIP)/geometry
setenv CONFIG_DIR \$::env(FAIRSHIP)/gconfig
setenv GALGCONF \$::env(FAIRSHIP_ROOT)/shipgen/genie_config
prepend-path PATH \$::env(FAIRSHIP_ROOT)/bin
prepend-path LD_LIBRARY_PATH \$::env(FAIRSHIP_ROOT)/lib
setenv FAIRLIBDIR \$::env(FAIRSHIP_ROOT)/lib
prepend-path ROOT_INCLUDE_PATH \$::env(FAIRSHIP_ROOT)/include
append-path ROOT_INCLUDE_PATH \$::env(GEANT4_ROOT)/include
append-path ROOT_INCLUDE_PATH \$::env(GEANT4_ROOT)/include/Geant4
append-path ROOT_INCLUDE_PATH \$::env(PYTHIA_ROOT)/include
append-path ROOT_INCLUDE_PATH \$::env(PYTHIA_ROOT)/include/Pythia8
append-path ROOT_INCLUDE_PATH \$::env(GEANT4_VMC_ROOT)/include
append-path ROOT_INCLUDE_PATH \$::env(GEANT4_VMC_ROOT)/include/geant4vmc
prepend-path PYTHONPATH \$::env(FAIRSHIP_ROOT)/python
append-path PYTHONPATH \$::env(FAIRSHIP_ROOT)/Developments/track_pattern_recognition
$([[ ${ARCHITECTURE:0:3} == osx ]] && echo "prepend-path DYLD_LIBRARY_PATH \$::env(FAIRSHIP_ROOT)/lib")
EoF