![]() |
GollumFit
|
The following necessary prerequisites are included as subdirectories in GollumFit already:
The following tools and libraries must be available on your system. Where relevant, the version that was most recently checked to work is indicated:
g++ (9.2.0)make (4.2.1)GSLboost (1.71.0)hdf5pthreadphotospline (https://github.com/cnweaver/photospline)cfitsio (https://heasarc.gsfc.nasa.gov/fitsio/)pybind11 (for Python bindings; highly recommended)To access these tools and libraries, IceCube users should use the cvmfs:
Otherwise, they must be installed and available.
First, set up the environment and create the necessary directories:
For the Boost dependency, ensure that library and header directories are at the location $BOOST_DIR.
Now check out the necessary code, including necessary submodules:
Compile the required software, one-by-one:
Now, compile GollumFit itself:
Finally, compile the pybindings so that we can call functions and handle I/O in a python script. This is the most convienient way to access GollumFit functionalities:
After building these, you may optionally build the various functions in the $GOLLUMSOURCEPATH/GollumFit/resources folder. For example, FluxOscCalculator can be built as follows:
In addition to building from source, you may also choose to use a container.
The repository includes a Dockerfile that can be used to create both a Docker and a Singularity container. The Docker container can be used in environments where one has Admin priviliges (like your local machine), while the Singularity container should be used on, for example, HPC clusters.
The following section explains how to build a Docker image on your local machine and upload it to your personal Docker Hub account (which you can simply link to your Github account). The Singularity container can then be simply built on the cluster by pulling the Docker image from Docker Hub. Both the Docker container and the Singularity container can be used to start a Jupyter server inside the container, to which you then can connect to use GollumFit in Jupyter notebooks.
cd into it.docker buildx create --name gollumfit-builder --useWe want to build the container for amd64 architectures (most clusters and non-Mac PCs) and push it to your Docker Hub. Optionally, as described further below, the container can additionally be built for arm64 (most Mac PCs) architectures. The amd64 build can be achieved with
docker buildx build --platform linux/amd64 -f docker/Dockerfile -t <your_dockerhub_username>/<repo_name>:<tag> --push .
You can choose, for example, gollumfit as repo name and latest as tag. After executing the command, the images for both architectures can be seen in your Docker Hub repository. If you also want to run this container on your Mac (i.e. arm64 architecture), execute aboves command with --platform linux/amd64,linux/arm64. Note that we have experienced that the latter takes very long if the container is built on a non-Mac PC.
The Singularity container can be built from the Docker image that you uploaded to your Docker Hub in the previous step.
singularity --version or apptainer --version (singularity and apptainer are basically synonyms)Pull the Docker image and convert it to a singularity image file with singularity pull --docker-login docker://<your_dockerhub_username>/<repo_name>:<tag>
You will be asked for your Docker Hub username and a password, for which you can take the PAT that you created in step 2. There might be warnings about the usage of undefined variables, which can be ignored.
start-jupyter-server, which executes the script that you can find in docker/start-jupyter-server-in-container.sh. Start the server with singularity exec <sif_file> start-jupyter-serverhttp://127.0.0.1:<port>/tree?token=<token>.Select Kernel. Then choose Existing Jupyter Server and copy/paste the URL from step 2.ssh -L <port>:localhost:<port> <username>@<remote_host> on your local machine, where <port> is the port found in the URL in step 2, and <username>/<remote host> are the username and the hostname in your ssh config (the one you use to connect to the cluster). Then you can open a browser and copy/paste the URL in step 2 into the address line.