-
Notifications
You must be signed in to change notification settings - Fork 2
/
installme.sh
127 lines (98 loc) · 4.59 KB
/
installme.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
#!/bin/bash
# Environment name variable - change "custom-env-name" to your desired environment name
ENV_NAME="py-BB"
# Installing conda
mkdir ./Executables
if [ "$(uname)" == "Darwin" ]; then
# Do something under Mac OS X platform
if [ "$(uname -m)" == "x86_64" ]; then
wget -O ./Executables/Miniforge3-latest.sh https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-x86_64.sh
elif [ "$(uname -m)" == "arm64" ]; then
wget -O ./Executables/Miniforge3-latest.sh https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh
fi
elif [ "$(uname)" == "Linux" ]; then
# Do something under Linux platform
wget -O ./Executables/Miniforge3-latest.sh https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
fi
bash ./Executables/Miniforge3-latest.sh -b -p ./Executables/miniforge3 -f
# Create your own virtual environment in a new folder
source ./Executables/miniforge3/bin/activate
conda update -n base -c conda-forge conda
conda create -n $ENV_NAME python=3.10
conda activate $ENV_NAME
# FOR GPU Calculations
#=======================================
conda install mamba -n base -c conda-forge
pip install cupy-cuda11x
./Executables/miniforge3/bin/mamba install cudatoolkit=11.8.0
pip install gpustat
# Install generic python packages
#========================================
pip install jupyterlab
pip install ipywidgets
pip install PyYAML
pip install pyarrow
pip install pandas
pip install dask==2024.2.1
pip install bokeh
pip install matplotlib
pip install scipy
pip install ipympl
pip install ruamel.yaml
pip install rich
pip install lfm
pip install pytest
pip install twine
# Adding the jupyter kernel to the list of kernels
python -m ipykernel install --user --name $ENV_NAME --display-name "$ENV_NAME"
# Install project package
pip install -e ./
# Installing fortran and other compilers
conda install compilers cmake
if [ "$(uname)" == "Linux" ]; then
# Do something under Linux platform
conda install gcc_linux-64 gxx_linux-64
fi
# If needed, could add the same line for Mac eventually: conda install clang_osx-arm64 clangxx_osx-arm64
# Install CERN packages
#=========================================
pip install cpymad
git clone https://github.com/pbelange/nafflib.git ./Executables/$ENV_NAME/nafflib
pip install -e ./Executables/$ENV_NAME/nafflib
git clone https://github.com/lhcopt/lhcmask.git ./Executables/$ENV_NAME/lhcmask
pip install -e ./Executables/$ENV_NAME/lhcmask
git clone https://github.com/xsuite/xobjects ./Executables/$ENV_NAME/xobjects
pip install -e ./Executables/$ENV_NAME/xobjects
git clone https://github.com/xsuite/xdeps ./Executables/$ENV_NAME/xdeps
pip install -e ./Executables/$ENV_NAME/xdeps
git clone https://github.com/xsuite/xpart ./Executables/$ENV_NAME/xpart
pip install -e ./Executables/$ENV_NAME/xpart
git clone https://github.com/xsuite/xtrack ./Executables/$ENV_NAME/xtrack
pip install -e ./Executables/$ENV_NAME/xtrack
git clone https://github.com/xsuite/xmask ./Executables/$ENV_NAME/xmask
pip install -e ./Executables/$ENV_NAME/xmask
git clone https://github.com/xsuite/xfields ./Executables/$ENV_NAME/xfields
pip install -e ./Executables/$ENV_NAME/xfields
git clone https://github.com/PyCOMPLETE/FillingPatterns.git ./Executables/$ENV_NAME/FillingPatterns
pip install -e ./Executables/$ENV_NAME/FillingPatterns
git clone https://gitlab.cern.ch/mrufolo/fillingstudies.git ./Executables/$ENV_NAME/fillingstudies
pip install -e ./Executables/$ENV_NAME/fillingstudies
# final xsuite installation below
# Download outsourced files
#=========================================
cd ./Executables/$ENV_NAME/xmask
git submodule init
git submodule update
git clone https://github.com/xsuite/xsuite ./Executables/$ENV_NAME/xsuite
pip install -e ./Executables/$ENV_NAME/xsuite
xsuite-prebuild regenerate
# Downloading sequences
cd ../../../
wget https://gitlab.cern.ch/acc-models/acc-models-lhc/-/raw/2023/lhc.seq -P BBStudies/Machines/sequences/
wget https://gitlab.cern.ch/acc-models/acc-models-lhc/-/raw/2023/lhcb4.seq -P BBStudies/Machines/sequences/
# Downloading macro file
wget https://gitlab.cern.ch/acc-models/acc-models-lhc/-/raw/2023/toolkit/macro.madx -P BBStudies/Machines/toolkit/
wget https://gitlab.cern.ch/acc-models/acc-models-lhc/-/blob/2023/toolkit/slice.madx -P BBStudies/Machines/toolkit/
# Downloading optics
rsync -rv phbelang@lxplus.cern.ch:"/afs/cern.ch/eng/lhc/optics/runIII/RunIII_dev/Proton_2022/opticsfile.*" BBStudies/Machines/optics/
rsync -rv phbelang@lxplus.cern.ch:"/afs/cern.ch/eng/lhc/optics/runIII/RunIII_dev/Proton_2022/README" BBStudies/Machines/optics/