2019-12-31 06:36:56 +00:00
|
|
|
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
2018-10-07 20:52:23 +00:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
2014-07-08 08:56:32 +00:00
|
|
|
#
|
2018-10-07 20:52:23 +00:00
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
2014-07-08 08:56:32 +00:00
|
|
|
|
2016-05-12 04:22:25 +00:00
|
|
|
########################################################################
|
2014-07-08 08:56:32 +00:00
|
|
|
#
|
2017-04-28 23:54:44 +00:00
|
|
|
# This file is part of Spack and sets up the spack environment for bash,
|
2019-10-03 05:15:01 +00:00
|
|
|
# zsh, and dash (sh). This includes environment modules and lmod support,
|
|
|
|
# and it also puts spack in your path. The script also checks that at least
|
2017-04-28 23:54:44 +00:00
|
|
|
# module support exists, and provides suggestions if it doesn't. Source
|
|
|
|
# it like this:
|
2014-07-08 08:56:32 +00:00
|
|
|
#
|
2014-08-16 21:53:57 +00:00
|
|
|
# . /path/to/spack/share/spack/setup-env.sh
|
2014-07-08 08:56:32 +00:00
|
|
|
#
|
|
|
|
########################################################################
|
|
|
|
# This is a wrapper around the spack command that forwards calls to
|
2019-10-03 05:15:01 +00:00
|
|
|
# 'spack load' and 'spack unload' to shell functions. This in turn
|
|
|
|
# allows them to be used to invoke environment modules functions.
|
2014-07-08 08:56:32 +00:00
|
|
|
#
|
2019-10-03 05:15:01 +00:00
|
|
|
# 'spack load' is smarter than just 'load' because it converts its
|
|
|
|
# arguments into a unique Spack spec that is then passed to module
|
2014-07-08 08:56:32 +00:00
|
|
|
# commands. This allows the user to use packages without knowing all
|
|
|
|
# their installation details.
|
|
|
|
#
|
2016-04-15 10:21:32 +00:00
|
|
|
# e.g., rather than requiring a full spec for libelf, the user can type:
|
2014-07-08 08:56:32 +00:00
|
|
|
#
|
2019-10-03 05:15:01 +00:00
|
|
|
# spack load libelf
|
2014-07-08 08:56:32 +00:00
|
|
|
#
|
2019-10-03 05:15:01 +00:00
|
|
|
# This will first find the available libelf module file and use a
|
2014-07-08 08:56:32 +00:00
|
|
|
# matching one. If there are two versions of libelf, the user would
|
|
|
|
# need to be more specific, e.g.:
|
|
|
|
#
|
2019-10-03 05:15:01 +00:00
|
|
|
# spack load libelf@0.8.13
|
2014-07-08 08:56:32 +00:00
|
|
|
#
|
|
|
|
# This is very similar to how regular spack commands work and it
|
|
|
|
# avoids the need to come up with a user-friendly naming scheme for
|
2019-10-03 05:15:01 +00:00
|
|
|
# spack module files.
|
2014-07-08 08:56:32 +00:00
|
|
|
########################################################################
|
2015-12-29 17:04:54 +00:00
|
|
|
|
2017-04-28 23:54:44 +00:00
|
|
|
spack() {
|
2020-01-23 06:36:02 +00:00
|
|
|
# Store LD_LIBRARY_PATH variables from spack shell function
|
|
|
|
# This is necessary because MacOS System Integrity Protection clears
|
|
|
|
# (DY?)LD_LIBRARY_PATH variables on process start.
|
|
|
|
if [ -n "${LD_LIBRARY_PATH-}" ]; then
|
|
|
|
export SPACK_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
|
|
|
|
fi
|
|
|
|
if [ -n "${DYLD_LIBRARY_PATH-}" ]; then
|
|
|
|
export SPACK_DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH
|
|
|
|
fi
|
|
|
|
|
2017-04-28 23:54:44 +00:00
|
|
|
# Zsh does not do word splitting by default, this enables it for this
|
|
|
|
# function only
|
2016-11-30 01:04:29 +00:00
|
|
|
if [ -n "${ZSH_VERSION:-}" ]; then
|
2016-07-13 18:33:14 +00:00
|
|
|
emulate -L sh
|
|
|
|
fi
|
|
|
|
|
2019-07-03 19:43:13 +00:00
|
|
|
# accumulate flags meant for the main spack command
|
|
|
|
# the loop condition is unreadable, but it means:
|
|
|
|
# while $1 is set (while there are arguments)
|
|
|
|
# and $1 starts with '-' (and the arguments are flags)
|
2014-08-17 08:41:32 +00:00
|
|
|
_sp_flags=""
|
2019-07-03 19:43:13 +00:00
|
|
|
while [ ! -z ${1+x} ] && [ "${1#-}" != "${1}" ]; do
|
2014-08-17 08:41:32 +00:00
|
|
|
_sp_flags="$_sp_flags $1"
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
# h and V flags don't require further output parsing.
|
2017-04-28 23:54:44 +00:00
|
|
|
if [ -n "$_sp_flags" ] && \
|
|
|
|
[ "${_sp_flags#*h}" != "${_sp_flags}" ] || \
|
|
|
|
[ "${_sp_flags#*V}" != "${_sp_flags}" ];
|
|
|
|
then
|
2014-08-17 08:41:32 +00:00
|
|
|
command spack $_sp_flags "$@"
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2019-07-03 19:43:13 +00:00
|
|
|
# set the subcommand if there is one (if $1 is set)
|
2018-07-27 13:14:01 +00:00
|
|
|
_sp_subcommand=""
|
2019-07-03 19:43:13 +00:00
|
|
|
if [ ! -z ${1+x} ]; then
|
2018-07-27 13:14:01 +00:00
|
|
|
_sp_subcommand="$1"
|
|
|
|
shift
|
|
|
|
fi
|
2014-07-08 08:56:32 +00:00
|
|
|
|
|
|
|
# Filter out use and unuse. For any other commands, just run the
|
|
|
|
# command.
|
2014-08-16 21:53:57 +00:00
|
|
|
case $_sp_subcommand in
|
2014-08-22 05:59:39 +00:00
|
|
|
"cd")
|
2018-07-27 13:14:01 +00:00
|
|
|
_sp_arg=""
|
|
|
|
if [ -n "$1" ]; then
|
|
|
|
_sp_arg="$1"
|
|
|
|
shift
|
|
|
|
fi
|
2017-04-28 23:54:44 +00:00
|
|
|
if [ "$_sp_arg" = "-h" ] || [ "$_sp_arg" = "--help" ]; then
|
2014-09-30 05:39:36 +00:00
|
|
|
command spack cd -h
|
|
|
|
else
|
2016-04-29 16:33:54 +00:00
|
|
|
LOC="$(spack location $_sp_arg "$@")"
|
2017-04-28 23:54:44 +00:00
|
|
|
if [ -d "$LOC" ] ; then
|
2016-04-28 22:43:05 +00:00
|
|
|
cd "$LOC"
|
2017-06-28 11:41:04 +00:00
|
|
|
else
|
|
|
|
return 1
|
2016-04-29 16:33:54 +00:00
|
|
|
fi
|
2014-09-30 05:39:36 +00:00
|
|
|
fi
|
2014-08-22 05:59:39 +00:00
|
|
|
return
|
|
|
|
;;
|
2018-10-14 22:21:57 +00:00
|
|
|
"env")
|
|
|
|
_sp_arg=""
|
|
|
|
if [ -n "$1" ]; then
|
|
|
|
_sp_arg="$1"
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
|
2017-04-28 23:54:44 +00:00
|
|
|
if [ "$_sp_arg" = "-h" ] || [ "$_sp_arg" = "--help" ]; then
|
2018-10-14 22:21:57 +00:00
|
|
|
command spack env -h
|
|
|
|
else
|
|
|
|
case $_sp_arg in
|
|
|
|
activate)
|
2020-03-31 23:57:14 +00:00
|
|
|
# Get --sh, --csh, or -h/--help arguments.
|
|
|
|
# Space needed here becauses regexes start with a space
|
|
|
|
# and `-h` may be the only argument.
|
|
|
|
_a=" $@"
|
|
|
|
# Space needed here to differentiate between `-h`
|
|
|
|
# argument and environments with "-h" in the name.
|
|
|
|
# Also see: https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html#Shell-Parameter-Expansion
|
2019-07-03 19:43:13 +00:00
|
|
|
if [ -z ${1+x} ] || \
|
2020-03-31 23:57:14 +00:00
|
|
|
[ "${_a#* --sh}" != "$_a" ] || \
|
|
|
|
[ "${_a#* --csh}" != "$_a" ] || \
|
|
|
|
[ "${_a#* -h}" != "$_a" ] || \
|
|
|
|
[ "${_a#* --help}" != "$_a" ];
|
2017-04-28 23:54:44 +00:00
|
|
|
then
|
2020-03-31 23:57:14 +00:00
|
|
|
# No args or args contain --sh, --csh, or -h/--help: just execute.
|
2017-04-28 23:54:44 +00:00
|
|
|
command spack env activate "$@"
|
2018-10-14 22:21:57 +00:00
|
|
|
else
|
2020-03-31 23:57:14 +00:00
|
|
|
# Actual call to activate: source the output.
|
2018-10-14 22:21:57 +00:00
|
|
|
eval $(command spack $_sp_flags env activate --sh "$@")
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
deactivate)
|
2020-03-31 23:57:14 +00:00
|
|
|
# Get --sh, --csh, or -h/--help arguments.
|
|
|
|
# Space needed here becauses regexes start with a space
|
|
|
|
# and `-h` may be the only argument.
|
|
|
|
_a=" $@"
|
|
|
|
# Space needed here to differentiate between `--sh`
|
|
|
|
# argument and environments with "--sh" in the name.
|
|
|
|
# Also see: https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html#Shell-Parameter-Expansion
|
|
|
|
if [ "${_a#* --sh}" != "$_a" ] || \
|
|
|
|
[ "${_a#* --csh}" != "$_a" ];
|
2017-04-28 23:54:44 +00:00
|
|
|
then
|
2020-03-31 23:57:14 +00:00
|
|
|
# Args contain --sh or --csh: just execute.
|
2017-04-28 23:54:44 +00:00
|
|
|
command spack env deactivate "$@"
|
|
|
|
elif [ -n "$*" ]; then
|
2020-03-31 23:57:14 +00:00
|
|
|
# Any other arguments are an error or -h/--help: just run help.
|
2017-04-28 23:54:44 +00:00
|
|
|
command spack env deactivate -h
|
2018-10-14 22:21:57 +00:00
|
|
|
else
|
2020-03-31 23:57:14 +00:00
|
|
|
# No args: source the output of the command.
|
2018-10-14 22:21:57 +00:00
|
|
|
eval $(command spack $_sp_flags env deactivate --sh)
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
2017-04-28 23:54:44 +00:00
|
|
|
command spack env $_sp_arg "$@"
|
2018-10-14 22:21:57 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
return
|
|
|
|
;;
|
2019-10-03 05:15:01 +00:00
|
|
|
"load"|"unload")
|
2020-03-31 23:57:14 +00:00
|
|
|
# Get --sh, --csh, -h, or --help arguments.
|
|
|
|
# Space needed here becauses regexes start with a space
|
|
|
|
# and `-h` may be the only argument.
|
2020-01-23 06:36:02 +00:00
|
|
|
_a=" $@"
|
2020-03-31 23:57:14 +00:00
|
|
|
# Space needed here to differentiate between `-h`
|
|
|
|
# argument and specs with "-h" in the name.
|
|
|
|
# Also see: https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html#Shell-Parameter-Expansion
|
2020-01-23 06:36:02 +00:00
|
|
|
if [ "${_a#* --sh}" != "$_a" ] || \
|
|
|
|
[ "${_a#* --csh}" != "$_a" ] || \
|
|
|
|
[ "${_a#* -h}" != "$_a" ] || \
|
|
|
|
[ "${_a#* --help}" != "$_a" ];
|
|
|
|
then
|
2020-03-31 23:57:14 +00:00
|
|
|
# Args contain --sh, --csh, or -h/--help: just execute.
|
2020-01-23 06:36:02 +00:00
|
|
|
command spack $_sp_flags $_sp_subcommand "$@"
|
|
|
|
else
|
|
|
|
eval $(command spack $_sp_flags $_sp_subcommand --sh "$@" || \
|
|
|
|
echo "return 1") # return 1 if spack command fails
|
|
|
|
fi
|
2014-07-31 20:42:34 +00:00
|
|
|
;;
|
2014-07-08 08:56:32 +00:00
|
|
|
*)
|
2017-04-28 23:54:44 +00:00
|
|
|
command spack $_sp_flags $_sp_subcommand "$@"
|
2014-08-22 05:59:39 +00:00
|
|
|
;;
|
2014-07-08 08:56:32 +00:00
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2017-04-28 23:54:44 +00:00
|
|
|
|
2014-07-08 08:56:32 +00:00
|
|
|
########################################################################
|
|
|
|
# Prepends directories to path, if they exist.
|
|
|
|
# pathadd /path/to/dir # add to PATH
|
|
|
|
# or pathadd OTHERPATH /path/to/dir # add to OTHERPATH
|
|
|
|
########################################################################
|
2017-04-28 23:54:44 +00:00
|
|
|
_spack_pathadd() {
|
2014-07-08 08:56:32 +00:00
|
|
|
# If no variable name is supplied, just append to PATH
|
|
|
|
# otherwise append to that variable.
|
2014-08-16 21:53:57 +00:00
|
|
|
_pa_varname=PATH
|
|
|
|
_pa_new_path="$1"
|
2014-07-08 08:56:32 +00:00
|
|
|
if [ -n "$2" ]; then
|
2014-08-16 21:53:57 +00:00
|
|
|
_pa_varname="$1"
|
|
|
|
_pa_new_path="$2"
|
2014-07-08 08:56:32 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Do the actual prepending here.
|
2016-03-19 22:42:06 +00:00
|
|
|
eval "_pa_oldvalue=\${${_pa_varname}:-}"
|
2014-08-16 21:53:57 +00:00
|
|
|
|
2017-04-28 23:54:44 +00:00
|
|
|
_pa_canonical=":$_pa_oldvalue:"
|
|
|
|
if [ -d "$_pa_new_path" ] && \
|
|
|
|
[ "${_pa_canonical#*:${_pa_new_path}:}" = "${_pa_canonical}" ];
|
|
|
|
then
|
2014-08-16 21:53:57 +00:00
|
|
|
if [ -n "$_pa_oldvalue" ]; then
|
|
|
|
eval "export $_pa_varname=\"$_pa_new_path:$_pa_oldvalue\""
|
2014-07-08 08:56:32 +00:00
|
|
|
else
|
2014-08-16 21:53:57 +00:00
|
|
|
export $_pa_varname="$_pa_new_path"
|
2014-07-08 08:56:32 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-09-08 17:15:06 +00:00
|
|
|
# Determine which shell is being used
|
2017-04-28 23:54:44 +00:00
|
|
|
_spack_determine_shell() {
|
2019-12-16 22:51:58 +00:00
|
|
|
if [ -f "/proc/$$/exe" ]; then
|
|
|
|
# If procfs is present this seems a more reliable
|
|
|
|
# way to detect the current shell
|
|
|
|
_sp_exe=$(readlink /proc/$$/exe)
|
2020-02-14 02:07:09 +00:00
|
|
|
# Shell may contain number, like zsh5 instead of zsh
|
|
|
|
basename ${_sp_exe} | tr -d '0123456789'
|
2019-12-16 22:51:58 +00:00
|
|
|
elif [ -n "${BASH:-}" ]; then
|
2019-07-12 15:33:23 +00:00
|
|
|
echo bash
|
2019-02-14 01:52:18 +00:00
|
|
|
elif [ -n "${ZSH_NAME:-}" ]; then
|
2019-07-12 15:33:23 +00:00
|
|
|
echo zsh
|
2019-02-14 01:52:18 +00:00
|
|
|
else
|
|
|
|
PS_FORMAT= ps -p $$ | tail -n 1 | awk '{print $4}' | sed 's/^-//' | xargs basename
|
|
|
|
fi
|
2017-09-08 17:15:06 +00:00
|
|
|
}
|
2017-04-28 23:54:44 +00:00
|
|
|
_sp_shell=$(_spack_determine_shell)
|
|
|
|
|
|
|
|
|
|
|
|
# Export spack function so it is available in subshells (only works with bash)
|
|
|
|
if [ "$_sp_shell" = bash ]; then
|
|
|
|
export -f spack
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Figure out where this file is.
|
|
|
|
#
|
|
|
|
if [ "$_sp_shell" = bash ]; then
|
|
|
|
_sp_source_file="${BASH_SOURCE[0]:-}"
|
|
|
|
elif [ "$_sp_shell" = zsh ]; then
|
|
|
|
_sp_source_file="${(%):-%N}"
|
|
|
|
else
|
|
|
|
# Try to read the /proc filesystem (works on linux without lsof)
|
|
|
|
# In dash, the sourced file is the last one opened (and it's kept open)
|
|
|
|
_sp_source_file_fd="$(\ls /proc/$$/fd 2>/dev/null | sort -n | tail -1)"
|
|
|
|
if ! _sp_source_file="$(readlink /proc/$$/fd/$_sp_source_file_fd)"; then
|
|
|
|
# Last resort: try lsof. This works in dash on macos -- same reason.
|
|
|
|
# macos has lsof installed by default; some linux containers don't.
|
|
|
|
_sp_lsof_output="$(lsof -p $$ -Fn0 | tail -1)"
|
|
|
|
_sp_source_file="${_sp_lsof_output#*n}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# If we can't find this script's path after all that, bail out with
|
|
|
|
# plain old $0, which WILL NOT work if this is sourced indirectly.
|
|
|
|
if [ ! -f "$_sp_source_file" ]; then
|
|
|
|
_sp_source_file="$0"
|
|
|
|
fi
|
|
|
|
fi
|
2017-09-08 17:15:06 +00:00
|
|
|
|
2019-05-30 06:41:55 +00:00
|
|
|
#
|
|
|
|
# Find root directory and add bin to path.
|
|
|
|
#
|
|
|
|
# We send cd output to /dev/null to avoid because a lot of users set up
|
|
|
|
# their shell so that cd prints things out to the tty.
|
|
|
|
_sp_share_dir="$(cd "$(dirname $_sp_source_file)" > /dev/null && pwd)"
|
|
|
|
_sp_prefix="$(cd "$(dirname $(dirname $_sp_share_dir))" > /dev/null && pwd)"
|
2017-04-28 23:54:44 +00:00
|
|
|
if [ -x "$_sp_prefix/bin/spack" ]; then
|
|
|
|
export SPACK_ROOT="${_sp_prefix}"
|
|
|
|
else
|
|
|
|
# If the shell couldn't find the sourced script, fall back to
|
|
|
|
# whatever the user set SPACK_ROOT to.
|
|
|
|
if [ -n "$SPACK_ROOT" ]; then
|
|
|
|
_sp_prefix="$SPACK_ROOT"
|
|
|
|
_sp_share_dir="$_sp_prefix/share/spack"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# If SPACK_ROOT didn't work, fail. We should need this rarely, as
|
|
|
|
# the tricks above for finding the sourced file are pretty robust.
|
|
|
|
if [ ! -x "$_sp_prefix/bin/spack" ]; then
|
|
|
|
echo "==> Error: SPACK_ROOT must point to spack's prefix when using $_sp_shell"
|
|
|
|
echo "Run this with the correct prefix before sourcing setup-env.sh:"
|
|
|
|
echo " export SPACK_ROOT=</path/to/spack>"
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
fi
|
2019-05-30 06:41:55 +00:00
|
|
|
_spack_pathadd PATH "${_sp_prefix%/}/bin"
|
|
|
|
|
2017-09-08 17:15:06 +00:00
|
|
|
#
|
2017-09-11 02:54:23 +00:00
|
|
|
# Check whether a function of the given name is defined
|
2017-09-08 17:15:06 +00:00
|
|
|
#
|
2017-04-28 23:54:44 +00:00
|
|
|
_spack_fn_exists() {
|
2017-09-26 19:28:50 +00:00
|
|
|
LANG= type $1 2>&1 | grep -q 'function'
|
2017-09-08 17:15:06 +00:00
|
|
|
}
|
2015-12-14 20:36:53 +00:00
|
|
|
|
2017-09-08 17:15:06 +00:00
|
|
|
need_module="no"
|
2017-09-11 02:54:23 +00:00
|
|
|
if ! _spack_fn_exists use && ! _spack_fn_exists module; then
|
2017-09-08 17:15:06 +00:00
|
|
|
need_module="yes"
|
|
|
|
fi;
|
|
|
|
|
|
|
|
#
|
2018-07-16 22:43:44 +00:00
|
|
|
# make available environment-modules
|
2017-09-08 17:15:06 +00:00
|
|
|
#
|
|
|
|
if [ "${need_module}" = "yes" ]; then
|
2018-07-16 22:43:44 +00:00
|
|
|
eval `spack --print-shell-vars sh,modules`
|
|
|
|
|
|
|
|
# _sp_module_prefix is set by spack --print-sh-vars
|
|
|
|
if [ "${_sp_module_prefix}" != "not_installed" ]; then
|
2019-02-28 12:22:44 +00:00
|
|
|
# activate it!
|
|
|
|
# environment-modules@4: has a bin directory inside its prefix
|
2019-07-16 05:43:53 +00:00
|
|
|
_sp_module_bin="${_sp_module_prefix}/bin"
|
|
|
|
if [ ! -d "${_sp_module_bin}" ]; then
|
2019-02-28 12:22:44 +00:00
|
|
|
# environment-modules@3 has a nested bin directory
|
2019-07-16 05:43:53 +00:00
|
|
|
_sp_module_bin="${_sp_module_prefix}/Modules/bin"
|
2019-02-28 12:22:44 +00:00
|
|
|
fi
|
2019-07-16 05:43:53 +00:00
|
|
|
|
|
|
|
# _sp_module_bin and _sp_shell are evaluated here; the quoted
|
|
|
|
# eval statement and $* are deferred.
|
|
|
|
_sp_cmd="module() { eval \`${_sp_module_bin}/modulecmd ${_sp_shell} \$*\`; }"
|
|
|
|
eval "$_sp_cmd"
|
|
|
|
_spack_pathadd PATH "${_sp_module_bin}"
|
2017-09-08 17:15:06 +00:00
|
|
|
fi;
|
2018-07-16 22:43:44 +00:00
|
|
|
else
|
|
|
|
eval `spack --print-shell-vars sh`
|
2017-09-08 17:15:06 +00:00
|
|
|
fi;
|
|
|
|
|
2017-04-28 23:54:44 +00:00
|
|
|
|
2017-09-08 17:15:06 +00:00
|
|
|
#
|
2018-07-16 22:43:44 +00:00
|
|
|
# set module system roots
|
2017-09-08 17:15:06 +00:00
|
|
|
#
|
2019-03-27 20:06:46 +00:00
|
|
|
_sp_multi_pathadd() {
|
|
|
|
local IFS=':'
|
2017-04-28 23:54:44 +00:00
|
|
|
if [ "$_sp_shell" = zsh ]; then
|
2020-01-14 23:32:57 +00:00
|
|
|
emulate -L sh
|
2019-03-27 20:06:46 +00:00
|
|
|
fi
|
2019-04-24 02:53:25 +00:00
|
|
|
for pth in $2; do
|
2019-09-26 20:51:16 +00:00
|
|
|
for systype in ${_sp_compatible_sys_types}; do
|
|
|
|
_spack_pathadd "$1" "${pth}/${systype}"
|
|
|
|
done
|
2019-03-27 20:06:46 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
_sp_multi_pathadd MODULEPATH "$_sp_tcl_roots"
|
2017-02-06 20:34:35 +00:00
|
|
|
|
|
|
|
# Add programmable tab completion for Bash
|
|
|
|
#
|
2017-04-28 23:54:44 +00:00
|
|
|
if [ "$_sp_shell" = bash ]; then
|
2017-02-06 20:34:35 +00:00
|
|
|
source $_sp_share_dir/spack-completion.bash
|
|
|
|
fi
|