File: GMXRC.bash.in

package info (click to toggle)
gromacs 3.3.1-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 57,284 kB
  • ctags: 26,126
  • sloc: asm: 844,363; ansic: 231,461; sh: 15,665; makefile: 1,514; fortran: 1,362; csh: 715; python: 264; perl: 261
file content (62 lines) | stat: -rw-r--r-- 1,702 bytes parent folder | download | duplicates (3)
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
# zsh configuration file for Gromacs
# First we remove old gromacs stuff from the paths
# by selecting everything else.
# This is not 100% necessary, but very useful when we
# repeatedly switch between gmx versions in a shell.

# First remove gromacs part of ld_library_path
tmppath=""
for i in `echo $LD_LIBRARY_PATH | sed "s/:/ /g"`; do
  if test "$i" != "$GMXLDLIB"; then
    tmppath=${tmppath}:$i
  fi
done
LD_LIBRARY_PATH=$tmppath

# remove gromacs part of path
tmppath=""
for i in `echo $PATH | sed "s/:/ /g"`; do
  if test "$i" != "$GMXBIN"; then
    tmppath=${tmppath}:$i
  fi
done
PATH=$tmppath

# and remove the gmx part of manpath
tmppath=""
for i in `echo $MANPATH | sed "s/:/ /g"`; do
  if test "$i" != "$GMXMAN"; then
    tmppath=${tmppath}:$i
  fi
done
MANPATH=$tmppath

##########################################################
# This is the real configuration part. We save the Gromacs
# things in separate vars, so we can remove them later.
# If you move gromacs, change the next four line.
##########################################################
GMXBIN=@bindir@
GMXLDLIB=@libdir@
GMXMAN=@mandir@
GMXDATA=@datadir@
	
# NB: The variables already begin with ':' now, or are empty
LD_LIBRARY_PATH=${GMXLDLIB}${LD_LIBRARY_PATH}
PATH=${GMXBIN}${PATH}
MANPATH=${GMXMAN}${MANPATH}

# export should be separate, so /bin/sh understands it
export GMXBIN GMXLDLIB GMXMAN GMXDATA LD_LIBRARY_PATH PATH MANPATH

# read bash completions if understand how to use them
# and this shell supports extended globbing
if (complete) > /dev/null 2>&1; then
  if (shopt -s extglob) > /dev/null 2>&1; then
    if [ -f $GMXBIN/completion.bash ]; then
      source $GMXBIN/completion.bash; 
    fi
  fi
fi