-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpfsetenv.sh
68 lines (58 loc) · 1.83 KB
/
pfsetenv.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
68
#!/bin/bash
# LLNS Copyright Start
# Copyright (c) 2017, Lawrence Livermore National Security
# This work was performed under the auspices of the U.S. Department
# of Energy by Lawrence Livermore National Laboratory in part under
# Contract W-7405-Eng-48 and in part under Contract DE-AC52-07NA27344.
# Produced at the Lawrence Livermore National Laboratory.
# All rights reserved.
# For details, see the LICENSE file.
# LLNS Copyright End
#############################################################################
# Setup PF environment
#############################################################################
#
# Sets up the Parflow build environment for frequently used machines.
#
# If PARFLOW_DIR is set prior to sourcing this script will use user specified location
# for install. Defauts to current ../install if not specified.
# Make sure this file is sourced not executed since this sets environment variables
if [[ ! "${BASH_SOURCE[0]}" != "${0}" ]]
then
echo "${0} should be sourced, not executed: source ${0}"
fi
# Appends to path if not path not already present
function appendToPath {
echo $PATH | grep -q $1
if [ $? -ne 0 ]
then
PATH=${PATH}:${1}
fi
}
function prependToPath {
echo $PATH | grep -q $1
if [ $? -ne 0 ]
then
PATH=${1}:${PATH}
fi
}
function appendToLdPath {
if [[ -z ${LD_LIBRARY_PATH+x} ]]
then
export LD_LIBRARY_PATH=${1}
else
echo $LD_LIBRARY_PATH | grep -q $1
if [ $? -ne 0 ]
then
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${1}
fi
fi
}
#=============================================================================
# Machine specific configuration
#=============================================================================
case $(hostname) in
cori*)
. ~/m2511/parflow/cori-10layer-691933-2019-02-26/setenv.sh
;;
esac