3 # This defines some Bash functions which help simply development of
4 # WCT on the assumption that externals are installed in a Spack view
5 # (or equivalent) and that WCT itself is installed in some other
6 # directory (although the two may be degenerate)
9 # This file can be sourced with paths to externals and WCT
10 # installation prefix:
12 # source sourceme-external-prefix.sh /path/to/externals /path/to/prefix
14 # or define WCT_EXTERNALS and WCT_PREFIX to each path, respectively.
16 export WCT_EXTERNALS=${WCT_EXTERNALS:-$1}
17 export WCT_PREFIX=${WCT_PREFIX:-$2}
21 local pathvar=${2:-PATH}
22 local pathval="${!pathvar}"
23 pathval=${pathval//":$1"/}
24 pathval=${pathval//"$1:"/}
25 export $pathvar="$1:$pathval"
30 addpath "$WCT_EXTERNALS/lib/pkgconfig" PKG_CONFIG_PATH
31 addpath "$WCT_EXTERNALS/share/pkgconfig" PKG_CONFIG_PATH
33 local mydir=$(dirname $(readlink -f $BASH_SOURCE))
37 --prefix=$WCT_PREFIX \
38 --boost-includes=$WCT_EXTERNALS/include \
39 --boost-libs=$WCT_EXTERNALS/lib \
41 --with-eigen=$WCT_EXTERNALS \
42 --with-jsoncpp=$WCT_EXTERNALS \
43 --with-tbb=$WCT_EXTERNALS \
44 --with-root=$WCT_EXTERNALS \
45 --with-fftw=$WCT_EXTERNALS \
46 --with-jsonnet=$WCT_EXTERNALS \
53 local mydir=$(dirname $(readlink -f $BASH_SOURCE))
54 local old_ld_library_path="$LD_LIBRARY_PATH"
55 addpath $WCT_EXTERNALS/lib LD_LIBRARY_PATH
56 for maybe in $mydir/build/* ;
58 maybe="$(readlink -f $maybe)"
59 if [ -d "$maybe" ] ; then
60 addpath $maybe LD_LIBRARY_PATH
63 $mydir/build/*/test_$name $@
64 LD_LIBRARY_PATH=$old_ld_library_path
68 local mydir=$(dirname $(readlink -f $BASH_SOURCE))
69 local old_ld_library_path="$LD_LIBRARY_PATH"
70 local old_path="$PATH"
71 addpath $WCT_EXTERNALS/lib LD_LIBRARY_PATH
72 addpath $WCT_EXTERNALS/bin PATH
73 addpath $WCT_PREFIX/lib LD_LIBRARY_PATH
74 addpath $WCT_PREFIX/bin PATH
76 # configuration and field/wire data files
77 addpath $WCT_PREFIX/share/wirecell/data WIRECELL_PATH
78 addpath $WCT_PREFIX/share/wirecell/config WIRECELL_PATH
79 addpath $WCT_PREFIX/data WIRECELL_PATH
81 for maybe in $mydir/build/* ;
83 maybe="$(readlink -f $maybe)"
84 if [ -d "$maybe" ] ; then
85 addpath $maybe LD_LIBRARY_PATH
89 LD_LIBRARY_PATH=$old_ld_library_path