forked from difx/difx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.bash
160 lines (143 loc) · 4.64 KB
/
setup.bash
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
####### DIFX VERSION ########################
export DIFX_VERSION=trunk
####### ROOT PATHS ##########################
export DIFXROOT=/usr/local/difx
export DIFX_PREFIX=$DIFXROOT
export PGPLOTDIR=
export IPPROOT=/opt/intel
####### COMPILER ############################
export DIFXMPIDIR=/usr
export MPICXX="${DIFXMPIDIR}"/bin/mpicxx
####### LIBRARY PATHS #######################
####### Uncomment and modify if needed, #####
####### such as 64-bit OpenSuSE #############
# export IPP_LIBRARY_PATH="${IPPROOT}"/ipp/lib/intel64:"${IPPROOT}"/compiler/lib/intel64
# export MPI_LIBRARY_PATH="${DIFXMPIDIR}"/lib64
####### USE GFORTRAN IN PREFERENCE TO G77? ##
####### Comment out if not desired ##########
export USEGFORTRAN="yes"
# you may need this for calcserver,difxcalc11
# export FFLAGS=-fallow-argument-mismatch
####### PERL VERSION/SUBVERSION #############
perlver="5"
perlsver="5.10.1"
####### PORTS FOR DIFXMESSAGE ###############
# Uncomment these to enable DIFX_MESSAGES
export DIFX_MESSAGE_GROUP=224.2.2.1
export DIFX_MESSAGE_PORT=50201
export DIFX_BINARY_GROUP=224.2.2.1
export DIFX_BINARY_PORT=50202
####### CALC SERVER NAME #########
export CALC_SERVER=localhost
####### HOPS ENVIRONMENT #########
# uncomment/modify these lines if you have enabled HOPS
# or alternatively be sure to source $DIFXROOT/bin/hops.bash
# export GS_DEVICE=x11
# export PGPLOT_TYPE=/xw
# export DEF_CONTROL=/dev/null
# export DATADIR=/tmp
# export HOPS_DOCS=${DIFXROOT}/share/hops
# export PROGDOC=${HOPS_DOCS}/vhelp
# export AHELP=${HOPS_DOCS}/vhelp/aedit
# export TEXT=${HOPS_DOCS}/text
####### MPI RUNTIME OPTIONS #################
####### Uncomment and modify if needed, #####
####### such as Open MPI 1.8.4 ##############
# export DIFX_MPIRUNOPTIONS="--mca mpi_yield_when_idle 1 --mca rmaps seq"
####### No User configurable values below here
####### Operating System, use $OSTYPE
if [ ${OSTYPE:0:6} = "darwin" ]
then
OS=darwin
elif [ "${OSTYPE:0:5}" = "linux" ]
then
OS=linux
else
echo "Warning unsupported O/S $OSTYPE"
return
fi
PurgePath()
{
Path="$1"
eval CurPath=\$"$Path"
if [ -x /bin/awk ] && [ -x /bin/sed ];
then
eval export $Path=$(echo ${CurPath} | /bin/awk -v RS=: -v ORS=: '/\<DiFX\>/ {next} {print}' IGNORECASE=1 | /bin/sed 's/:*$//')
fi
}
PrependPath()
{
Path="$1"
NewItem="$2"
eval CurPath=\$"$Path"
#################################################################
# Add the item. If the path is currently empty, just set it to
# the new item, otherwise, prepend the new item and colon
# separator.
#################################################################
if [ -n "$CurPath" ]
then
#################################################################
# Check to see if the item is already in the list
#################################################################
if [ `expr "$CurPath" ':' ".*$NewItem\$"` -eq '0' -a \
`expr "$CurPath" ':' ".*$NewItem\:.*"` -eq '0' ]
then
eval $Path=\"$NewItem\:$CurPath\"
fi
else
eval export $Path="$NewItem"
fi
}
####### PURGE EXISTING DIFX FROM PATHS ######
PurgePath PERL5LIB
PurgePath PATH
PurgePath LD_LIBRARY_PATH
PurgePath DYLD_LIBRARY_PATH
PurgePath PYTHONPATH
PurgePath PKG_CONFIG_PATH
####### 32/64 BIT DEPENDENT MODIFICATIONS ###
arch=(`uname -m`)
if [ "$arch" = "i386" -o "$arch" = "i686" ] #32 bit
then
export DIFXBITS=32
PrependPath PERL5LIB "${DIFXROOT}/perl/lib/perl$perlver/site_perl/$perlsver"
elif [ "$arch" = "x86_64" ] #64 bit
then
export DIFXBITS=64
PrependPath PERL5LIB "${DIFXROOT}/perl/lib64/perl$perlver/site_perl/$perlsver/x86_64-linux-thread-multi"
else
echo "Unknown architecture $arch - leaving paths unaltered"
fi
####### LIBRARY/EXECUTABLE PATHS ############
PrependPath PATH "${DIFXMPIDIR}"/bin
PrependPath PATH "${DIFXROOT}"/bin
if [ -z "${IPP_LIBRARY_PATH}" ]; then
PrependPath LD_LIBRARY_PATH "${IPP_LIBRARY_PATH}"
fi
if [ -z "${MPI_LIBRARY_PATH}" ]; then
PrependPath LD_LIBRARY_PATH "${MPI_LIBRARY_PATH}"
fi
if [ "$OS" = "darwin" ]
then
PrependPath DYLD_LIBRARY_PATH "${DIFXROOT}/lib"
PrependPath DYLD_LIBRARY_PATH "${PGPLOTDIR}"
else
PrependPath LD_LIBRARY_PATH "${DIFXROOT}/lib"
PrependPath LD_LIBRARY_PATH "${PGPLOTDIR}"
if [ "$arch" = "x86_64" ] #64 bit
then
PrependPath LD_LIBRARY_PATH "${DIFXROOT}/lib64"
fi
fi
PrependPath PKG_CONFIG_PATH "${DIFXROOT}/lib/pkgconfig"
PrependPath PYTHONPATH "${DIFXROOT}/lib/python"
if [ "$arch" = "x86_64" ] #64 bit
then
PrependPath PKG_CONFIG_PATH "${DIFXROOT}/lib64/pkgconfig"
PrependPath PYTHONPATH "${DIFXROOT}/lib64/python"
fi
if test "$PS1" != ""; then
echo " DiFX version $DIFX_VERSION is selected"
export PS1="\u@\h $DIFX_VERSION \W> "
fi