forked from nsmith-/CMSDAS_EGamma
-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.sh
executable file
·19 lines (17 loc) · 867 Bytes
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env bash
NAME=egammaenv
LCG=/cvmfs/sft.cern.ch/lcg/views/LCG_105/x86_64-centos7-gcc11-opt
if [[ -f $NAME/bin/activate ]]; then
echo "egammaenv already installed. Run \`source $NAME/bin/activate\` to activate"
fi
source $LCG/setup.sh
python -m venv --copies $NAME
source $NAME/bin/activate
LOCALPATH=$(python -c 'import sys; print(f"{sys.prefix}/lib/python{sys.version_info.major}.{sys.version_info.minor}/site-packages")')
export PYTHONPATH=${LOCALPATH}:$PYTHONPATH
#python -m pip install git+https://github.com/cms-nanoAOD/correctionlib.git
sed -i "2a source ${LCG}/setup.sh" $NAME/bin/activate
sed -i "3a export PYTHONPATH=${LOCALPATH}:\$PYTHONPATH" $NAME/bin/activate
sed -i "4a source ${LCG}/setup.csh" $NAME/bin/activate.csh
sed -i "5a setenv PYTHONPATH ${LOCALPATH}:\$PYTHONPATH" $NAME/bin/activate.csh
ipython kernel install --user --name=$NAME