sourceme-prefix-has-deps.sh
Go to the documentation of this file.
1 #!/bin/bash
2 
3 # if the prefix for installing Wire Cell also holds all the deps, then
4 # this script simplifies configuration.
5 
6 
7 ### latest ROOT no longer needs this workaround
8 # if [ "$(lsb_release -s -c)" = "xenial" ] ; then
9 # echo "Setting compilers to GCC 4.9 on xenial"
10 # export CC=/usr/bin/gcc-4.9
11 # export CXX=/usr/bin/g++-4.9
12 # fi
13 
14 wcb-configure () {
15  local prefix="$1" ; shift
16  if [ -z "$prefix" ] ; then
17  echo usage: "wcb-configure /path/to/prefix [...]"
18  return 1
19  fi
20 
21  prefix=$(readlink -f $prefix)
22 
23  for sd in lib lib64 share
24  do
25  maybe="$prefix/$sd/pkgconfig"
26  if [ -d $maybe ] ; then
27  PKG_CONFIG_PATH=$PKG_CONFIG_PATH${PKG_CONFIG_PATH:+:}$maybe
28  fi
29  done
30  export PKG_CONFIG_PATH
31 
32 
33  local mydir=$(dirname $(readlink -f $BASH_SOURCE))
34  cd $mydir
35  ./wcb configure \
36  --prefix=$prefix \
37  --with-eigen=$prefix \
38  --with-jsoncpp=$prefix \
39  --with-tbb=$prefix \
40  --boost-includes=$prefix/include \
41  --boost-libs=$prefix/lib \
42  --boost-mt \
43  --with-root=$prefix \
44  --with-fftw=$prefix \
45  "$@"
46 }
47 
48 # setup run time environment
49 wcb-runtime-setup () {
50  local prefix="$1" ; shift
51  if [ -z "$prefix" ] ; then
52  echo usage: "wcb-runtime-setup /path/to/prefix [...]"
53  return 1
54  fi
55  prefix=$(readlink -f $prefix)
56  PATH=$prefix/bin:$PATH
57  # fixme, what about lib64?
58  export LD_LIBRARY_PATH=$prefix/lib:${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
59  #export PKG_CONFIG_PATH=$prefix/lib:${PKG_CONFIG_PATH:+:}$PKG_CONFIG_PATH
60 }
61 
62 #wcb-run-test () {
63 # for exe in $(find . -name $testprog