path-remove ()
{
local IFS=':';
local NEWPATH;
local DIR;
local PATHVARIABLE=${2:-PATH};
for DIR in ${!PATHVARIABLE};
do
if [ "$DIR" != "$1" ]; then
NEWPATH=${NEWPATH:+$NEWPATH:}$DIR;
fi;
done;
export $PATHVARIABLE="$NEWPATH"
}
path-prepend ()
{
path-remove "$1" "$2";
local PATHVARIABLE="${2:-PATH}";
export $PATHVARIABLE="$1${!PATHVARIABLE:+:${!PATHVARIABLE}}"
}
path-append ()
{
path-remove "$1" "$2";
local PATHVARIABLE="${2:-PATH}";
export $PATHVARIABLE="${!PATHVARIABLE:+${!PATHVARIABLE}:}$1"
}
source /cvmfs/uboone.opensciencegrid.org/products/setup_uboone.sh
setup uboonecode v08_00_00_42 -q e17:prof
setup numpy v1_14_3 -q e17:openblas:p2714b:prof
setup libtorch v1_0_1 -q e17:prof
setup SparseConvNet 8422a6f -q e17:prof
git clone [email protected]:BNLIF/wire-cell.git
cd wire-cell
git submodule init
git submodule update
Configure (change prefix as needed)
env CC=gcc CXX=g++ FC=gfortran ./waf-tools/waf configure \
--with-root="$ROOTSYS" \
--boost-includes="$BOOST_INC" \
--boost-libs="$BOOST_LIB" \
--boost-mt \
--with-fftw="$FFTW_FQ_DIR" \
--with-fftw-include="$FFTW_INC" \
--with-fftw-lib="$FFTW_LIBRARY" \
--with-eigen="$EIGEN_DIR" \
--with-glpk="$GLPK_FQ_DIR/" --with-glpk-include="$GLPK_INC" --with-glpk-lib="$GLPK_LIB" \
--with-python="$PYTHON_ROOT/" --with-python-include="$PYTHON_INCLUDE" --with-python-lib="$PYTHON_LIB" \
--prefix="/uboone/app/users/$USER/products/wire-cell/"
Build and install:
./waf-tools/waf -p install
# use local build of WCP
# change WCP_FQ_DIR as needed
WCP_FQ_DIR=/uboone/app/users/$USER/products/wire-cell/
path-prepend $WCP_FQ_DIR/lib/ LD_LIBRARY_PATH
path-prepend $WCP_FQ_DIR/lib64/ LD_LIBRARY_PATH
path-prepend $WCP_FQ_DIR/bin/ PATH
path-prepend $WCP_FQ_DIR/python PYTHONPATH
./build/pyutil/test_call_func test_funcs multiply 2 3