pueoBuilder
Loading...
Searching...
No Matches
Optional: Cardinal

Manual Environment Setup on OSC (Cardinal)

  • This is modified from Optional: Pitzer
  • Last tested: Monday March 24, 2025
  • Load the following modules :
    Warning
    Be sure that you are on Cardinal; won't work if you are on Pitzer.
    module load gcc/12.3.0
    module load cmake/3.25.2
    module load fftw/3.3.10

Python

  • Download the source code.
    wget https://www.python.org/ftp/python/3.12.9/Python-3.12.9.tgz
  • Untar as usual,
    tar -xzvf Python-3.12.9.tgz
    cd Python-3.12.9
  • Make the build and install directories.
    mkdir build install; cd build
    Inside the build directory, configure:
    ../configure --prefix=$(pwd)/../install --enable-shared
  • After configuration, compile as usual
    make -j8 && make install
  • After everything is installed, add the install/lib/ directory to the environment variable $LD_LIBRARY_PATH
    export LD_LIBRARY_PATH=path/to/python/install/lib:$LD_LIBRARY_PATH
    and add the newly install python3 to your PATH variable:
    export PATH=path/to/python/install/bin:${PATH}
    Note
    Modify the paths as needed; you might also want to have these in your .bashrc or equivalent so you don't have to type this every time.
  • If you head over to the binary directory,
    cd path/to/python/install/bin
    You should see pip3 and python3.12.
  • If you run
    ./python3
    you should see the Python REPL:
    Python 3.12.9 (main, Mar 24 2025, 19:23:35) [GCC 12.3.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
  • If you run ./pip3 list, you'd see an empty list. To install some useful libraries, run
    ./pip3 install numpy scipy matplotlib

ROOT

  • Here are the different versions of ROOT.
  • Download
    wget https://root.cern/download/root_v6.28.06.source.tar.gz
    and untar
    tar -xzvf root_v6.28.06.source.tar.gz
  • Make the install directory:
    cd root-6.28.06
    mkdir install
    cd build
  • Run CMake, but be sure to enable the mathmore and minuit2 options.
    cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/../install/ -Dminuit2=ON -Dmathmore=ON ..
  • Compile and install as usual:
    make -j8 && make install
  • God willing, there'd be no errors, and you'd be able to run the following to finish setting up ROOT:
    source path/to/your/ROOT/install/bin/thisroot.sh
    Note
    Modify the path as needed and put it in your .bashrc
  • Finally, you should be able to check that ROOT is working; type root to start the REPL

    ------------------------------------------------------------------
    | Welcome to ROOT 6.28/06 https://root.cern |
    | (c) 1995-2023, The ROOT Team; conception: R. Brun, F. Rademakers |
    | Built for linuxx8664gcc on Aug 28 2023, 11:29:15 |
    | From tags/v6-28-06@v6-28-06 |
    | With g++ (Spack GCC) 12.3.0 |
    | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q' |
    ------------------------------------------------------------------
    root [0]

    (run .q to quit the ROOT REPL)

    As well, inside the Python REPL, you should be able to run

    import ROOT

Done