#!/bin/bash

# This is a local wcdo rc file for project myproj.
# It was initally generated but is recomended for customizing by you, dear user.
# It is included at the end of the main RC files.
    
# These are optional but required if wcdo-mrb-* commands are to be used.
wcdo_mrb_project_name="larsoft"
#wcdo_mrb_project_version="v08_32_00"
wcdo_mrb_project_version="v08_37_00"
wcdo_mrb_project_quals="e17:prof"

source /cvmfs/dune.opensciencegrid.org/products/dune/setup_dune.sh

export UPS_OVERRIDE='-H Linux64bit+5.0-2.17-sl7-6'

# needed for process pDUNE data. NOTE: this resets WIRECELL_PATH
setup dunetpc $wcdo_mrb_project_version -q $wcdo_mrb_project_quals
setup hdf5 v1_10_5 -q e17
setup h5cpp v1_10_4_1

wcdo-ups-init
path-prepend $wcdo_ups_products PRODUCTS

# this include setup larsoft
wcdo-mrb-init

# wire-cell toolkit
setup wirecell wctdev -q $wcdo_mrb_project_quals
export WIRECELL_PATH=/wcdo/src/wct/cfg:/wcdo/share/wirecell/data
#optional: wcdo-wirecell-path default
echo WIRECELL_PATH=$WIRECELL_PATH

# other local products, e.g. larwirecell
mrbsetenv
mrbslp # setup local products
export FHICL_FILE_PATH=$WIRECELL_PATH:$FHICL_FILE_PATH

#export PATH=/home/yuhw/go/jsonnet/bin:$PATH
#export PATH=/home/yuhw/jsonnet/jsonnet:$PATH

export     LD_LIBRARY_PATH=/home/yuhw/jsonnet/jsonnet:$LD_LIBRARY_PATH
export     LD_LIBRARY_PATH=/.singularity.d/libs:$LD_LIBRARY_PATH
export     LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
export     LD_LIBRARY_PATH=/home/yuhw/torch/libtorch/lib:$LD_LIBRARY_PATH
export PATH=/usr/local/cuda/bin:$PATH

export DISPLAY=:1001
export XAUTHORITY=/home/yuhw/.Xauthority
bind '"\e[A":history-search-backward' #PageUp
bind '"\e[B":history-search-forward' #PageDown
set autolist
set autoexpand
export PS1='[s]$(pwd)\n$'
alias ls='ls --color=auto'
alias ll='ls -lh'
alias vi='vim'
find-fhicl(){
  fhicl_file=$1
  for path in `echo $FHICL_FILE_PATH  | sed -e 's/:/\n/g'`;do find $path -name "$fhicl_file"  2>/dev/null;done
}
