setup.sh 3.39 KB
Newer Older
1
#!/bin/bash
Georg Auzinger's avatar
Georg Auzinger committed
2

Mauro Dinardo's avatar
Minor    
Mauro Dinardo committed
3
4
5
##########
# CACTUS #
##########
Alexander Josef Pauls's avatar
Alexander Josef Pauls committed
6
7
8
export CACTUSBIN=/opt/cactus/bin
export CACTUSLIB=/opt/cactus/lib
export CACTUSINCLUDE=/opt/cactus/include
Alexander Josef Pauls's avatar
Alexander Josef Pauls committed
9
export CACTUSROOT=/opt/cactus/
Alexander Josef Pauls's avatar
Alexander Josef Pauls committed
10
#export CACTUSROOT=/opt/cactus_from_source/uhal/
11

Alexander Josef Pauls's avatar
Alexander Josef Pauls committed
12
13
#export CACTUSINCLUDE=$CACTUSROOT/uhal/include/
#export CACTUSLIB=$CACTUSROOT/uhal/lib
14

Alexander Josef Pauls's avatar
Alexander Josef Pauls committed
15
16
#export CACTUSLOGINCLUDE=$CACTUSROOT/log/include/
#export CACTUSLOGLIB=$CACTUSROOT/log/lib/
17

Alexander Josef Pauls's avatar
Alexander Josef Pauls committed
18
19
#export CACTUSGRAMMARINCLUDE=$CACTUSROOT/grammars/include/
#export CACTUSGRAMMARLIB=$CACTUSROOT/grammars/lib/
20

Mauro Dinardo's avatar
Minor    
Mauro Dinardo committed
21
22
23
#########
# BOOST #
#########
Mini-Me's avatar
Mini-Me committed
24
export KERNELRELEASE=$(uname -r)
Mini-Me's avatar
Mini-Me committed
25
26
27
if [[ $KERNELRELEASE == *"el6"* ]]; then
    export BOOST_LIB=/opt/cactus/lib
    export BOOST_INCLUDE=/opt/cactus/include
Stefano Mersi's avatar
Stefano Mersi committed
28
29
30
elif [[ $KERNELRELEASE == *"el8"* ]]; then
    export BOOST_LIB=/opt/cactus/lib
    export BOOST_INCLUDE=/opt/cactus/include
31
32
33
elif [[ $KERNELRELEASE == "5."*"-generic" ]]; then
    export BOOST_INCLUDE=/usr/include
    export BOOST_LIB=/usr/lib/x86_64-linux-gnu
Mini-Me's avatar
Mini-Me committed
34
35
36
37
else
    export BOOST_INCLUDE=/usr/include
    export BOOST_LIB=/usr/lib64
fi
38

39
40
41
########
# ROOT #
########
42
43
44
45
46
THISROOTSH=${ROOTSYS}/bin/thisroot.sh
[ ! -f ${THISROOTSH} ] || source ${THISROOTSH}
unset THISROOTSH

if ! command -v root &> /dev/null; then
Mauro Dinardo's avatar
Mauro Dinardo committed
47
  printf "%s\n" ">> ERROR -- CERN ROOT is not available; please install it before using Ph2_ACF (see README)"
48
49
  return 1
fi
50

Mauro Dinardo's avatar
Minor    
Mauro Dinardo committed
51
52
53
#######
# ZMQ #
#######
Georg Auzinger's avatar
Georg Auzinger committed
54
export ZMQ_HEADER_PATH=/usr/include/zmq.hpp
55

Mauro Dinardo's avatar
Minor    
Mauro Dinardo committed
56
57
58
###########
# Ph2_ACF #
###########
59
export PH2ACF_BASE_DIR=$(pwd)
60

Mauro Dinardo's avatar
Minor    
Mauro Dinardo committed
61
62
63
####################
# External Plugins #
####################
64
export AMC13DIR=$CACTUSINCLUDE/amc13
65
66
67
export ANTENNADIR=$PH2ACF_BASE_DIR/../CMSPh2_AntennaDriver
export USBINSTDIR=$PH2ACF_BASE_DIR/../Ph2_USBInstDriver
export EUDAQDIR=$PH2ACF_BASE_DIR/../eudaq
Georg Auzinger's avatar
Georg Auzinger committed
68

Mauro Dinardo's avatar
Minor    
Mauro Dinardo committed
69
70
71
###########
# ANTENNA #
###########
72
export ANTENNALIB=$ANTENNADIR/lib
73

Mauro Dinardo's avatar
Minor    
Mauro Dinardo committed
74
75
76
77
###########
# HMP4040 #
###########
export USBINSTLIB=$USBINSTDIR/lib
Georg Auzinger's avatar
Georg Auzinger committed
78

Mini-Me's avatar
Mini-Me committed
79
##########
80
# EUDAQ #
Mini-Me's avatar
Mini-Me committed
81
##########
Mini-Me's avatar
Mini-Me committed
82
export EUDAQLIB=$EUDAQDIR/lib
83

Mauro Dinardo's avatar
Minor    
Mauro Dinardo committed
84
85
86
##########
# System #
##########
87
88
export PATH=$PH2ACF_BASE_DIR/bin:$PATH
export LD_LIBRARY_PATH=$USBINSTLIB:$ANTENNALIB:$PH2ACF_BASE_DIR/RootWeb/lib:$CACTUSLIB:$PH2ACF_BASE_DIR/lib:$EUDAQLIB:/opt/rh/llvm-toolset-7.0/root/usr/lib64:$LD_LIBRARY_PATH
Sarah Seif El Nasr's avatar
Sarah Seif El Nasr committed
89

Mauro Dinardo's avatar
Minor    
Mauro Dinardo committed
90
91
92
#########
# Flags #
#########
93
94
95
96
export HttpFlag='-D__HTTP__'
export ZmqFlag='-D__ZMQ__'
export USBINSTFlag='-D__USBINST__'
export Amc13Flag='-D__AMC13__'
97
export TCUSBFlag='-D__TCUSB__'
98
99
export TCUSBforROHFlag='-D__ROH_USB__'
export TCUSBforSEHFlag='-D__SEH_USB__'
100
export AntennaFlag='-D__ANTENNA__'
101
export UseRootFlag='-D__USE_ROOT__'
102
export MultiplexingFlag='-D__MULTIPLEXING__'
Sarah Seif El Nasr's avatar
Sarah Seif El Nasr committed
103
export EuDaqFlag='-D__EUDAQ__'
Mauro Dinardo's avatar
Minor    
Mauro Dinardo committed
104

105
106
107
108
109
################
# Compilations #
################

# Stand-alone application, without data streaming
Kevin Connor Nash's avatar
Minor    
Kevin Connor Nash committed
110
111
export CompileForHerd=false
export CompileForShep=false
112
113

# Stand-alone application, with data streaming
Kevin Connor Nash's avatar
Minor    
Kevin Connor Nash committed
114
115
# export CompileForHerd=true
# export CompileForShep=true
116
117

# Herd application
Fabio Ravera's avatar
Minor    
Fabio Ravera committed
118
119
# export CompileForHerd=true
# export CompileForShep=false
120
121
122
123
124

# Shep application
# export CompileForHerd=false
# export CompileForShep=true

Mini-Me's avatar
Mini-Me committed
125
# Compile with EUDAQ libraries
Mini-Me's avatar
Minor    
Mini-Me committed
126
export CompileWithEUDAQ=false
Mini-Me's avatar
Mini-Me committed
127

128
# Compile with TC_USB library
Alexander Josef Pauls's avatar
Alexander Josef Pauls committed
129
export CompileWithTCUSB=false
130
export UseTCUSBforROH=false
131

minime's avatar
minime committed
132
# Clang-format command
Stefano Mersi's avatar
Stefano Mersi committed
133
134
135
136
137
138
139
if command -v clang-format &> /dev/null; then
  clang_command="clang-format" 
else
  clang_command="/opt/rh/llvm-toolset-7.0/root/usr/bin/clang-format"
fi

alias formatAll="find ${PH2ACF_BASE_DIR} -iname *.h -o -iname *.cc | xargs ${clang_command} -i"
Fabio Ravera's avatar
Fabio Ravera committed
140

Mini-Me's avatar
Minor    
Mini-Me committed
141
echo "=== DONE ==="