2019-01-01 06:04:23 +00:00
|
|
|
# Copyright 2013-2019 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-08-16 21:58:15 +00:00
|
|
|
#
|
2018-10-07 20:52:23 +00:00
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
2014-08-16 21:58:15 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# This file is part of Spack and sets up the spack environment for
|
|
|
|
# csh and tcsh. This includes dotkit support, module support, and
|
|
|
|
# it also puts spack in your path. Source it like this:
|
|
|
|
#
|
|
|
|
# setenv SPACK_ROOT /path/to/spack
|
|
|
|
# source $SPACK_ROOT/share/spack/setup-env.csh
|
|
|
|
#
|
|
|
|
if ($?SPACK_ROOT) then
|
|
|
|
set _spack_source_file = $SPACK_ROOT/share/spack/setup-env.csh
|
|
|
|
set _spack_share_dir = $SPACK_ROOT/share/spack
|
|
|
|
|
|
|
|
# Command aliases point at separate source files
|
|
|
|
alias spack 'set _sp_args = (\!*); source $_spack_share_dir/csh/spack.csh'
|
2014-08-22 18:00:19 +00:00
|
|
|
alias _spack_pathadd 'set _pa_args = (\!*) && source $_spack_share_dir/csh/pathadd.csh'
|
2014-08-16 21:58:15 +00:00
|
|
|
|
2018-07-16 22:43:44 +00:00
|
|
|
# Set variables needed by this script
|
2018-07-18 16:36:22 +00:00
|
|
|
_spack_pathadd PATH "$SPACK_ROOT/bin"
|
2018-07-16 22:43:44 +00:00
|
|
|
eval `spack --print-shell-vars csh`
|
2017-05-10 15:18:45 +00:00
|
|
|
|
2014-08-16 21:58:15 +00:00
|
|
|
# Set up modules and dotkit search paths in the user environment
|
2019-03-27 20:06:46 +00:00
|
|
|
set tcl_roots = `echo $_sp_tcl_roots:q | sed 's/:/ /g'`
|
|
|
|
foreach tcl_root ($tcl_roots:q)
|
|
|
|
_spack_pathadd MODULEPATH "$tcl_root/$_sp_sys_type"
|
|
|
|
end
|
|
|
|
|
|
|
|
set dotkit_roots = `echo $_sp_dotkit_roots:q | sed 's/:/ /g'`
|
|
|
|
foreach dotkit_root ($dotkit_roots)
|
|
|
|
_spack_pathadd DK_NODE "$dotkit_root/$_sp_sys_type"
|
|
|
|
end
|
2017-05-10 15:18:45 +00:00
|
|
|
else
|
2018-10-14 22:21:57 +00:00
|
|
|
echo "ERROR: Sourcing spack setup-env.csh requires setting SPACK_ROOT to "
|
|
|
|
echo " the root of your spack installation."
|
2014-08-16 21:58:15 +00:00
|
|
|
endif
|