1 # bash configuration file for Gromacs
2 # First we remove old gromacs stuff from the paths
3 # by selecting everything else.
4 # This is not 100% necessary, but very useful when we
5 # repeatedly switch between gmx versions in a shell.
7 # First remove gromacs part of ld_library_path
9 for i in `echo $LD_LIBRARY_PATH | sed "s/:/ /g"`; do
10 if test "$i" != "$GMXLDLIB"; then
11 tmppath="${tmppath}${tmppath:+:}${i}"
14 LD_LIBRARY_PATH=$tmppath
16 # remove gromacs part of PKG_CONFIG_PATH
18 for i in `echo $PKG_CONFIG_PATH | sed "s/:/ /g"`; do
19 if test "$i" != "$GMXLDLIB/pkgconfig"; then
20 tmppath="${tmppath}${tmppath:+:}${i}"
23 PKG_CONFIG_PATH=$tmppath
25 # remove gromacs part of path
27 for i in `echo $PATH | sed "s/:/ /g"`; do
28 if test "$i" != "$GMXBIN"; then
29 tmppath="${tmppath}${tmppath:+:}${i}"
34 # and remove the gmx part of manpath
36 for i in `echo $MANPATH | sed "s/:/ /g"`; do
37 if test "$i" != "$GMXMAN"; then
38 tmppath="${tmppath}${tmppath:+:}${i}"
43 ##########################################################
44 # This is the real configuration part. We save the Gromacs
45 # things in separate vars, so we can remove them later.
46 # If you move gromacs, change the next four line.
47 ##########################################################
48 GMXBIN=@BIN_INSTALL_DIR@
49 GMXLDLIB=@LIB_INSTALL_DIR@
50 GMXMAN=@MAN_INSTALL_DIR@
51 GMXDATA=@DATA_INSTALL_DIR@
53 LD_LIBRARY_PATH=${GMXLDLIB}${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}
54 PKG_CONFIG_PATH=${GMXLDLIB}/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}
55 PATH=${GMXBIN}${PATH:+:}${PATH}
56 #debian/ubuntu needs a : at the end
57 MANPATH=${GMXMAN}:${MANPATH}
59 # export should be separate, so /bin/sh understands it
60 export GMXBIN GMXLDLIB GMXMAN GMXDATA LD_LIBRARY_PATH PATH MANPATH PKG_CONFIG_PATH
62 # read bash completions if understand how to use them
63 # and this shell supports extended globbing
64 if (complete) > /dev/null 2>&1; then
65 if (shopt -s extglob) > /dev/null 2>&1; then
66 if [ -f $GMXBIN/completion.bash ]; then
67 source $GMXBIN/completion.bash;