forked from latinos/mkShapesRDF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·86 lines (64 loc) · 1.98 KB
/
install.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
#!/bin/bash
sourceCommand="echo 'first source of start.sh'"
env=$(hostname)
OS=$(hostnamectl | grep "CPE OS Name")
echo "OS ""$OS"
echo "Custom install ""$1"
if [ -z "$1" ]; then
if [[ "$OS" == *"centos:7"* ]]; then
echo centos7
sourceCommand="$sourceCommand""; source /cvmfs/sft.cern.ch/lcg/views/LCG_103/x86_64-centos7-gcc11-opt/setup.sh"
elif [[ "$OS" == *"enterprise_linux:9"* ]]; then
echo el9
sourceCommand="$sourceCommand""; source /cvmfs/sft.cern.ch/lcg/views/LCG_103/x86_64-centos9-gcc11-opt/setup.sh"
else
echo "$OS"" not supported"
exit 1
fi
elif [ "$1" == "docker" ]; then
sourceCommand="export LD_LIBRARY_PATH=$(root-config --libdir):$(pwd)/xrdfs_locallib/lib:/.singularity.d/libs"
else
echo "$1"" custom install not supported"
exit 1
fi
echo "sourceCommand"
echo "$sourceCommand"
eval "$sourceCommand"
if [ "$1" == "docker" ]; then
ln -s /usr/bin/python3 /usr/bin/python
which python
python --version
fi
python -m venv --system-site-packages myenv
source myenv/bin/activate
if [ "$1" == "docker" ]; then
python -m pip --version
python -m pip install --upgrade pip
python -m pip --version
fi
which python
python --version
python -m pip --version
python -m pip install -e ".[docs,dev,processor]"
python -m pip install --no-binary=correctionlib correctionlib
cd utils
mkdir -p bin
cd src && c++ hadd.cxx -o hadd2 $(root-config --cflags --libs) && cd .. && mv src/hadd2 bin/hadd2
if [ $? -ne 0 ]; then
echo "Failed compiling hadd"
exit 1
fi
cd ..
cat <<EOF > start.sh
#!/bin/bash
$sourceCommand
source `pwd`/myenv/bin/activate
export STARTPATH=`pwd`/start.sh
export PYTHONPATH=`pwd`/myenv/lib64/python3.9/site-packages:\$PYTHONPATH
export PATH=`pwd`/utils/bin:\$PATH
EOF
chmod +x start.sh
wget https://gpizzati.web.cern.ch/mkShapesRDF/jsonpog-integration.tar.gz
tar -xzvf jsonpog-integration.tar.gz
rm -r jsonpog-integration.tar.gz
mv jsonpog-integration mkShapesRDF/processor/data/