1 # sh/bash/zsh 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 #we make use of IFS, which needs shwordsplit in zsh
8 test -n "${ZSH_VERSION+set}" && setopt shwordsplit
12 # First remove gromacs part of ld_library_path
14 for i in $@LD_LIBRARY_PATH@; do
15 if test "$i" != "$GMXLDLIB"; then
16 tmppath="${tmppath}${tmppath:+:}${i}"
19 @LD_LIBRARY_PATH@=$tmppath
21 # remove gromacs part of PKG_CONFIG_PATH
23 for i in $PKG_CONFIG_PATH; do
24 if test "$i" != "$GMXLDLIB/pkgconfig"; then
25 tmppath="${tmppath}${tmppath:+:}${i}"
28 PKG_CONFIG_PATH=$tmppath
30 # remove gromacs part of path
33 if test "$i" != "$GMXBIN"; then
34 tmppath="${tmppath}${tmppath:+:}${i}"
39 # and remove the gmx part of manpath
42 if test "$i" != "$GMXMAN"; then
43 tmppath="${tmppath}${tmppath:+:}${i}"
48 ##########################################################
49 # This is the real configuration part. We save the Gromacs
50 # things in separate vars, so we can remove them later.
51 # If you move gromacs, change the first line.
52 ##########################################################
53 GMXPREFIX=@CMAKE_INSTALL_PREFIX@
54 GMXBIN=${GMXPREFIX}/@CMAKE_INSTALL_BINDIR@
55 GMXLDLIB=${GMXPREFIX}/@CMAKE_INSTALL_LIBDIR@
56 GMXMAN=${GMXPREFIX}/@CMAKE_INSTALL_MANDIR@
57 GMXDATA=${GMXPREFIX}/@GMX_INSTALL_GMXDATADIR@
58 GMXTOOLCHAINDIR=${GMXPREFIX}/@GMX_INSTALL_CMAKEDIR@
59 GROMACS_DIR=${GMXPREFIX}
61 @LD_LIBRARY_PATH@=${GMXLDLIB}${@LD_LIBRARY_PATH@:+:}${@LD_LIBRARY_PATH@}
62 PKG_CONFIG_PATH=${GMXLDLIB}/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}
63 PATH=${GMXBIN}${PATH:+:}${PATH}
64 #debian/ubuntu needs a : at the end
65 MANPATH=${GMXMAN}:${MANPATH}
67 # export should be separate, so /bin/sh understands it
68 export GMXBIN GMXLDLIB GMXMAN GMXDATA @LD_LIBRARY_PATH@ PATH MANPATH
69 export PKG_CONFIG_PATH GROMACS_DIR
74 # read bash completions if understand how to use them
75 # and this shell supports extended globbing
76 if test -n "${BASH_VERSION+set}" && (complete) > /dev/null 2>&1; then
77 if (shopt -s extglob) > /dev/null 2>&1; then
79 if [ -f $GMXBIN/gmx-completion.bash ]; then
80 source $GMXBIN/gmx-completion.bash
81 for cfile in $GMXBIN/gmx-completion-*.bash ; do
86 elif test -n "${ZSH_VERSION+set}" > /dev/null 2>&1 ; then
88 if (bashcompinit) > /dev/null 2>&1; then
90 if [ -f $GMXBIN/gmx-completion.bash ]; then
91 source $GMXBIN/gmx-completion.bash
92 for cfile in $GMXBIN/gmx-completion-*.bash ; do