-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.sh
67 lines (53 loc) · 2.61 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#! /bin/sh
# $Id$
###########################################################################
# @Project: SFrame - ROOT-based analysis framework for ATLAS #
# #
# @author Stefan Ask <[email protected]> - Manchester #
# @author David Berge <[email protected]> - CERN #
# @author Johannes Haller <[email protected]> - Hamburg #
# @author A. Krasznahorkay <[email protected]> - NYU/Debrecen #
# #
# Script that has to be sourced before compiling/running SFrame. #
# #
###########################################################################
# Greet the user
echo "Setting up environment for compiling/running SFrame"
if [ $SFRAME_DIR ]; then
echo SFRAME_DIR is already defined, use a clean shell
return 1
fi
# specify the SFRAME base directory, i.e. the directory in which this file lives
# do it this way so it can be sourced from anywhere
export SFRAME_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Modify to describe your directory structure. Default is to use the a structure where
# all directories are below the SFrame base directory specified above
export SFRAME_BIN_PATH=${SFRAME_DIR}/bin
export SFRAME_LIB_PATH=${SFRAME_DIR}/lib
# Check if bin/lib/include directories exist, if not create them
if [ ! -d ${SFRAME_BIN_PATH} ]; then
echo Directory ${SFRAME_BIN_PATH} does not exist ... creating it
mkdir ${SFRAME_BIN_PATH}
fi
if [ ! -d ${SFRAME_LIB_PATH} ]; then
echo Directory ${SFRAME_LIB_PATH} does not exist ... creating it
mkdir ${SFRAME_LIB_PATH}
fi
# The Makefiles depend only on the root-config script to use ROOT,
# so make sure that is available
if [[ `which root-config` == "" ]]; then
echo "Error: ROOT environment doesn't seem to be configured!"
fi
if [[ `root-config --platform` == "macosx" ]]; then
# With Fink ROOT installations, DYLD_LIBRARY_PATH doesn't have
# to be defined for ROOT to work. So let's leave the test for it...
export DYLD_LIBRARY_PATH=${SFRAME_LIB_PATH}:${DYLD_LIBRARY_PATH}
else
if [ ! $LD_LIBRARY_PATH ]; then
echo "Warning: so far you haven't setup your ROOT enviroment properly (no LD_LIBRARY_PATH): SFrame will not work"
fi
export LD_LIBRARY_PATH=${SFRAME_LIB_PATH}:${LD_LIBRARY_PATH}
fi
export PATH=${SFRAME_BIN_PATH}:${PATH}
export PYTHONPATH=${SFRAME_DIR}/python:${PYTHONPATH}
export PAR_PATH=${SFRAME_DIR}/:${SFRAME_LIB_PATH}