-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathLPC_envSetup.sh
More file actions
executable file
·22 lines (18 loc) · 919 Bytes
/
LPC_envSetup.sh
File metadata and controls
executable file
·22 lines (18 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash
NAME=hgcalKeras
LCG=/cvmfs/sft.cern.ch/lcg/views/LCG_96python3/x86_64-centos7-gcc8-opt/setup.sh
source $LCG
# following https://aarongorka.com/blog/portable-virtualenv/, an alternative is https://github.com/pantsbuild/pex
python -m venv --copies $NAME
source $NAME/bin/activate
python -m pip install setuptools pip --upgrade
python -m pip install tensorflow==1.5
#python -m pip install keras==2.3.1
python -m pip install pyjet
export PYTHONPATH=$PWD/$NAME/lib/python3.6/site-packages:$PYTHONPATH
sed -i '40s/.*/VIRTUAL_ENV="$(cd "$(dirname "$(dirname "${BASH_SOURCE[0]}" )")" \&\& pwd)"/' $NAME/bin/activate
sed -i '1s/#!.*python$/#!\/usr\/bin\/env python/' $NAME/bin/*
sed -i "2a source ${LCG}" $NAME/bin/activate
sed -i "3a export PYTHONPATH=${PWD}/${NAME}/lib/python3.6/site-packages:$PYTHONPATH" $NAME/bin/activate
ipython kernel install --user --name=$NAME
tar -zcf ${NAME}.tar.gz ${NAME}