pueoBuilder
Loading...
Searching...
No Matches
Old README

A simple script to download and build nicemc and pueoSim, along with the (modified) necessary ANITA software

Requirements:

Your system will need access to root, fftw, cmake, gsl, and gcc. If you are on the Ohio Supercomputer (OSC), you can load these dependencies using two options:

Option 1: load everything all at once:

module use /users/PAS0654/kaeliautumn/local/share/lmodfiles

module load pueo_all

Option 2: load each package individually:

module use /users/PAS0654/wluszczak/local/share/lmodfiles

module load cmake, gcc, fftw, gsl, root

On the Chicago Midway computer, you can usually load these libraries individually, using "module load XXX" directly.

On your personal computer, you should install these packages using whatever tools are most familiar. Later in the document there are instructions for using conda for this, which some people prefer.

Getting pueoBuilder

In your terminal do

git clone git@github.com:PUEOCollaboration/pueoBuilder pueo

If this throws an error, one possibility is that your SSH key is not set up yet for your computer. You can find directions on how to set this up here:

You can optionally give this a name by appending it to the end of hte previous line. Some people like to call it pueo and also use it as an installation target. From now on we will call wherever you checked out to ${PUEO_BUILD_DIR}

This will check out the builder, which will then procede to checkout all other relevant projects into components subdirectories, which are each their own git repository (NOT part of pueoBuilder).

Some people like to symlink directories from components elsewhere for easier access.

Building for the first time

The build system needs to know where you want it to install things, which is done using the PUEO_UTIL_INSTALL_DIR environmental variable. This usually should be different from ANITA_UTIL_INSTALL_DIR if you want to be able to work with both. It CAN be /usr or /usr/local though that's not recommended. Two popular options are the same directory that you checked out to (especially if you gave it a name other than pueoBuilder) or something like $HOME/pueo/usr.

The simulation tools (nicemc and pueoSim) also need to know where their source lives for some reason (to be fixed later?).

As an example, say you installed the pueoBuilder code in $HOME/pueo. Then you could do:

 export PUEO_UTIL_INSTALL_DIR=$HOME/pueo
 export PUEO_BUILD_DIR=$HOME/pueo
 export NICEMC_SRC=${PUEO_BUILD_DIR}/components/nicemc
 export NICEMC_BUILD=${PUEO_BUILD_DIR}/build/components/nicemc
 export PUEOSIM_SRC=${PUEO_BUILD_DIR}/components/pueoSim

It is recommended that you add ${PUEO_UTIL_INSTALL_DIR}/lib to your LD_LIBRARY_PATH (Linux) or DYLD_LIBRARY_PATH (MacOS, though that may also require some other magic to circumvent default security things).

 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${PUEO_UTIL_INSTALL_DIR}/lib

Finally, to download and install things, you can simply run

./pueoBuilder.sh

The build script is not very sophisticated it will attempt to:

1) Checkout the libraries from GitHub
2) Make a build directory and run cmake in that directory to generate Makefiles
3) Build the libraries (make)
4) Install the libraries in to PUEO_UTIL_INSTALL_DIR (make install)

This will build and install everything with the defaults. However, there are some optional arguments

./pueoBuilder.sh [njobs = 1] [configure = 0] [nuke build dir = 1]
Argument Default What it does
njobs 1 The number of threads you wish to compile with. njobs > 1 will result in faster compilation, however, warnings and errors may appear out of order.
configure 0 Edit compiler flags and other options before building.
nuke build dir 1 Whether or not the build directory will be deleted and completely re-compiled.

The main prerequisites are: ROOT https://root.cern.ch with Minuit2, MathMore, and Fortran. See https://root.cern.ch/build-prerequisites to make sure you have the prerequisites required for those features. FFTW http://www.fftw.org cmake https://cmake.org these should be available using your favourite package manager for your system.

Fedora or EL

If you have admin access, it's easiest to get this working on Fedora or EL. For EL, you'll need to install the EPEL repositories. TLDR, dnf install root-devel root-minuit2 root-mathmore fftw3-devel gsl-devel cmake g++ probably does what you need? Might be edited.

Note
Oct 6, 2024 update:
  • For Fedora Linux users, root-mathmore is already included in dnf-installed root.
  • No such thing as root-devel, at least not from dnf.
  • Lastly, gsl-devel does not seem to be needed.

Options for Conda installation

If you don't want to manually install the required dependencies (including ROOT...), you can try installing via Conda. These instructions come from Austin via his colleague at PSU

Prerequirement

Working conda installation. We recommend to install Miniconda to save some disk space compared to anaconda.

Install Miniconda

Step 4 is not strictly neccesary but recommended as mamba is a better solver than base conda (way faster)

  1. wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
  2. bash miniconda.sh
  3. bash
  4. conda install mamba conda-devenv -n base -c conda-forge
  5. mamba init bash
  6. rm miniconda.sh

Create PUEO enviroment

Save the following code as pueo.devenv.yml in the desired directory

name: pueo_env
channels:
- conda-forge
- defaults
dependencies:
- fftw
- root
variables:
PUEO_BUILD_DIR: {{ root }}/pueo_build
PUEO_UTIL_INSTALL_DIR: {{ root }}/pueo_build/install
NICEMC_SRC: {{ root }}/pueo_build/components/nicemc
NICEMC_BUILD: {{ root }}/pueo_build/build/components/nicemc
PUEOSIM_SRC: {{ root }}/pueo_build/components/pueoSim

Now run

mamba-devenv -f pueo.devenv.yml

This creates a conda enviroment with required packages and enviroment variables. Change the path in the .yml according to your wishes for the path you want the PUEO tools to be installed/built. You can change the enviroment name to what ever you desire. Just remember to activate the enviroment whenever you want to use pueo tools.

Setup PUEO tools

  1. activate PUEO environment
    conda activate pueo_env
  2. Get PUEO Builder
    git clone git@github.com:PUEOCollaboration/pueoBuilder ${PUEO_BUILD_DIR}
  3. Create INSTALL_DIR for PUEO
    cd ${PUEO_BUILD_DIR} && mkdir install
  4. Run the UTIL builder
    ./pueoBuilder.sh

Create PUEO sim work setup

  1. Create pueo sim build directory
    cd ${PUEO_BUILD_DIR}/components/pueoSim && mkdir build
  2. Build pueo sim
    cd build
    cmake .. && cmake --build .

Now you can change the src of pueo sim as you like and just redo step 2 above to build pueo sim with your changes.

Running pueoSim

nicemc/pueoSim is the updated replacement for icemc; it can be run by going to ${PUEO_BUILD_DIR)/build/compononents/pueoSim and running simulatePueo as one would run icemc.

For more information, see the nicemc and pueoSim pages

Developing

If you are developing in any of the repositories, you probably want to unshallow it (git pull --unshallow), as by default only shallow clones are made (TODO: fix this?). If you aren't seeing a branch you expect, you may need to do something like ‘git remote set-branches origin ’*'` as shallow cloning seems to only grab one branch.

Known working systems

Manjaro Linux x86_64
  • gcc 11.1.0
  • ROOT 6.24.00
  • cmake 3.21.2
  • fftw 3.3.9-1
CentOS Linux 7
  • gcc 11.1.0
  • ROOT 6.24.00
  • cmake 3.22.1
  • fftw 3.3.9
  • Notes for the CentOS Linux 7 build:
    • gcc 11.1.0 is required, 9.X (what my system seems to use by default) is insufficient
    • You'll need to rebuild ROOT from the source using gcc 11.1.0. I couldn't seem to get any of the pre-compiled binary distributions to work. Remember to enable fortran and minuit2 with -Dfortran=ON -Dminuit2=ON when building
    • I didn't have root access, so I had to install all the prerequisites in nonstandard locations. If you do this, you'll need to set the following environment variables:
      export PATH=$(gcc-11.1.0_install_dir)/bin:$PATH
      export LD_LIBRARY_PATH=$(gcc-11.1.0_install_dir)/lib64:$LD_LIBRARY_PATH
      export CC=$(gcc-11.1.0_install_dir)/bin/gcc-11.1
      export CXX=$(gcc-11.1.0_install_dir)/bin/g++-11.1
      export FC=$(gcc-11.1.0_install_dir)/gfortran-11.1
      export FFTWDIR=$(fftw_install_dir)
      Where $(gcc-11.1.0_install_dir) and $(fftw_install_dir) are where your local installations of gcc-11.1.0 and FFTW live.
    • FFTW has an odd build process. In order to get pueoBuilder to recognize it, you'll need to build it with CMake instead of the standard process listed in the FFTW documentation. For me, this process involved building FFTW twice with different flags:
      cmake -DCMAKE_INSTALL_PREFIX=$(fftw_install_dir) -DBUILD_SHARED_LIBS=ON -DENABLE_OPENMP=ON -DENABLE_THREADS=ON ../fftw-3.3.9
      make install -j $(nproc)
      rm * #remove everything except the include and lib64 directories
      rm -r CMakeFiles #remove everything except the include and lib64 directories
      cmake -DCMAKE_INSTALL_PREFIX=$(fftw_install_dir) -DBUILD_SHARED_LIBS=ON -DENABLE_OPENMP=ON -DENABLE_THREADS=ON -DENABLE_FLOAT=ON ../fftw-3.3.9
      make install -j $(nproc)
      The goal here is to ensure that the FFTW install directory contains all of the following files:
      include/fftw3.f
      include/fftw3.f03
      include/fftw3.h
      include/fftw3l.f03
      include/fftw3q.f03
      lib64/libfftw3f.so
      lib64/libfftw3f_threads.so.3
      lib64/libfftw3_omp.so.3.6.9
      lib64/libfftw3_threads.so
      lib64/libfftw3f_omp.so
      lib64/libfftw3f.so.3
      lib64/libfftw3f_threads.so.3.6.9
      lib64/libfftw3.so
      lib64/libfftw3_threads.so.3
      lib64/libfftw3f_omp.so.3
      lib64/libfftw3f.so.3.6.9
      lib64/libfftw3_omp.so
      lib64/libfftw3.so.3
      lib64/libfftw3_threads.so.3.6.9
      lib64/libfftw3f_omp.so.3.6.9
      lib64/libfftw3f_threads.so
      lib64/libfftw3_omp.so.3
      lib64/libfftw3.so.3.6.9
      If pueoBuilder ends up complaining about \ilinebr<br> CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: FFTWF_LIB (ADVANCED) ` Then some of the above files are missing and re-compiling FFTW with different flags to fill in the missing files might help.