Skip to content
Snippets Groups Projects
Singularity 3.38 KiB
Newer Older
  • Learn to ignore specific revisions
  • Whitney Armstrong's avatar
    Whitney Armstrong committed
    Bootstrap: docker
    
    From: hallac/hcana:latest
    
    Whitney Armstrong's avatar
    Whitney Armstrong committed
    
    %help
    
      Hall A/C container.
      Tools:
         - evio        : EVIO DAQ data format  
         - analyzer    : Hall A analyzer (podd) 
         - hcana       : Hall C analyzer (hcana)
    
    Sylvester Joosten's avatar
    Sylvester Joosten committed
         - root        : root version used for the analyzer
         - rootls, rootbrowse, root-config
    
    Whitney Armstrong's avatar
    Whitney Armstrong committed
    
    %labels
    
      Maintainer "Whitney Armstrong, Sylvester Joosten"
    
    Whitney Armstrong's avatar
    Whitney Armstrong committed
      Version v1.0
    
    
    %setup -c /bin/bash
      export SINGULARITY_SHELL=/bin/bash
    
    
    Whitney Armstrong's avatar
    Whitney Armstrong committed
    %environment -c /bin/bash
    
      export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
      export PATH=/usr/local/bin:${PATH}
      export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
      export ROOT_INCLUDE_PATH=/usr/local/include:/usr/local/include/podd:/usr/local/include/hcana
    
    Whitney Armstrong's avatar
    Whitney Armstrong committed
    
    %post -c /bin/bash
      echo "Hello from post"
    
      echo "Install additional software here"
    
    Whitney Armstrong's avatar
    Whitney Armstrong committed
      source /usr/local/bin/thisroot.sh
    
      ## libformat and nlohmann json used heavily in new generation replay scripts
      ## libformat
    
      cd /tmp && git clone https://github.com/fmtlib/fmt.git && cd fmt && \
        git checkout 5.3.0 && mkdir /tmp/build && cd /tmp/build && \
        cmake -DBUILD_SHARED_LIBS=TRUE ../fmt &&
        make -j4 install && cd /tmp && rm -r /tmp/build && rm -r /tmp/fmt
    
      ## json
      apt-get install nlohmann-json-dev
    
    Whitney Armstrong's avatar
    Whitney Armstrong committed
    
    
    # =======================
    # global
    # =======================
    
    Whitney Armstrong's avatar
    Whitney Armstrong committed
    
    %runscript
    
      echo "Launching a shell in the Hall A/C singularity container
      exec bash
    
    Whitney Armstrong's avatar
    Whitney Armstrong committed
    
    
    # =======================
    # root
    
    # =======================
    %apprun root
      root "$@"
    
    %appenv root
      export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
      export PATH=/usr/local/bin:${PATH}
      export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
      export ROOT_INCLUDE_PATH=/usr/local/include/podd:/usr/local/include/hcana
    
    # =======================
    # analyzer
    # =======================
    %apprun analyzer
      analyzer "$@"
    
    %appenv analyzer
      export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
      export PATH=/usr/local/bin:${PATH}
      export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
      export ROOT_INCLUDE_PATH=/usr/local/include/podd:/usr/local/include/hcana
    
    # =======================
    # hcana
    # =======================
    %apphelp hcana
      Run the Hall-C analyzer with same root-style arguments.
    
    %apprun hcana
      hcana "$@"
    
    %appenv hcana
      export DB_DIR=DBASE
      export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
      export PATH=/usr/local/bin:${PATH}
      export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
      export ROOTSYS=/usr/local
      export ROOT_INCLUDE_PATH=/usr/local/include
    
    # =======================
    # root-config
    # =======================
    %apprun root-config
      root-config "$@"
    
    %appenv root-config
      export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
      export PATH=/usr/local/bin:${PATH}
      export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
      export ROOT_INCLUDE_PATH=/usr/local/include/podd:/usr/local/include/hcana
    
    
    # =======================
    # rootbrowse
    # =======================
    %apprun rootbrowse
      rootbrowse "$@"
    
    %appenv rootbrowse
      export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
      export PATH=/usr/local/bin:${PATH}
      export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
      export ROOT_INCLUDE_PATH=/usr/local/include/podd:/usr/local/include/hcana
    
    # =======================
    # rootls
    # =======================
    %apprun rootls
      rootls "$@"
    
    %appenv rootls
      export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
      export PATH=/usr/local/bin:${PATH}
      export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
      export ROOT_INCLUDE_PATH=/usr/local/include/podd:/usr/local/include/hcana