Skip to content

Commit 18c14e7

Browse files
ratpac-setup instructions
1 parent 11a2f4a commit 18c14e7

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

episodes/00-setup.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,40 @@ You can test that your installation is functional by running:
8383
rat macros/validation/electron.mac
8484
```
8585
A simulation should be performed, and rat should exit with no error. You should now see a log file as well as `output.root` in your directory. Congratulations, you now have a working version of RATPAC2!
86+
87+
## via ratpac-setup
88+
We also provide a script to facilitate dependency installation and management. You can find it [here](https://github.com/rat-pac/ratpac-setup#).
89+
::::: caution
90+
`ratpac-setup` is written primarily with Ubuntu 22.04 in mind. However, many RAT developers have tried it out in different distros, including fedora and arch linux. MacOS should work as well.
91+
:::::
92+
There are some packages that ratpac-setup assumes to be present in the operating system. You can make sure that they are installed with the following one-liner in ubuntu:
93+
```sh
94+
apt install git curl build-essential vim libx11-dev libxpm-dev libqt5opengl5-dev ssh cmake \
95+
xserver-xorg-video-intel libxft-dev libxext-dev libxerces-c-dev \
96+
libxkbcommon-x11-dev libopengl-dev python3 python3-dev python3-numpy \
97+
libcurl4-gnutls-dev ca-certificates libssl-dev libffi-dev
98+
```
99+
Most of these packages should already be present on a standard linux system. On distros other than ubuntu, you probably need to change some of the package names. Please reach out to us if you run into trouble with this.
100+
101+
You can then install the needed dependencies using `setup.sh`. There's many packages provided. We recommend at least the following:
102+
```sh
103+
./setup.sh --only root geant4 cry tensorflow nlopt hdf5 chroma
104+
```
105+
You can append `-j$(nproc)` to use all available CPUs on your system for compilation. This is highly recommended, especially for root and geant4, since they take quite a while to compile.
106+
107+
After this is complete, you can then access all the installed packages in your shell with `source env.sh`. Then you can follow the standard RAT compilation instructions:
108+
```sh
109+
git clone git@github.com:rat-pac/ratpac-two.git
110+
cd ratpac-two
111+
make # add -j $(nproc) if you would like to compile on multiple cores (recommended).
112+
source ratpac.sh
113+
```
114+
and _voila_!
115+
:::::callout
116+
You can also install ratpac-two itself via `./setup.sh ratpac`, but this is not recommended if you plan on working on the code yourself.
117+
:::::
118+
:::::caution
119+
A common mishap with this method is that you are running these commands in a shell polluted by other enviornment variables. Be extra careful that you do not have another instance of root or geant4 installed somewhere else on your system that's polluting your environment variables, as this might cause the compilation procedure to misbehave. Double check that there's no reference to external geant4/root installed in your `~/.bashrc`. You can also examine the environment variables currently set in your shell by running `env`. Make sure that there's no variables pointing to binaries / data files elsewhere in your system.
120+
121+
Whenever a installation breaks, the first thing to try should be to close out of your terminal / ssh session, and try the install again in a clean shell.
122+
:::::

0 commit comments

Comments
 (0)