2019-01-01 14:04:23 +08:00
|
|
|
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
|
2018-10-08 04:52:23 +08:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
2014-08-17 05:58:15 +08:00
|
|
|
#
|
2018-10-08 04:52:23 +08:00
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
2014-08-17 05:58:15 +08: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-23 02:00:19 +08:00
|
|
|
alias _spack_pathadd 'set _pa_args = (\!*) && source $_spack_share_dir/csh/pathadd.csh'
|
2014-08-17 05:58:15 +08:00
|
|
|
|
2018-07-17 06:43:44 +08:00
|
|
|
# Set variables needed by this script
|
2018-07-19 00:36:22 +08:00
|
|
|
_spack_pathadd PATH "$SPACK_ROOT/bin"
|
2018-07-17 06:43:44 +08:00
|
|
|
eval `spack --print-shell-vars csh`
|
2017-05-10 23:18:45 +08:00
|
|
|
|
2014-08-17 05:58:15 +08:00
|
|
|
# Set up modules and dotkit search paths in the user environment
|
2019-03-28 04:06:46 +08: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 23:18:45 +08:00
|
|
|
else
|
2018-10-15 06:21:57 +08:00
|
|
|
echo "ERROR: Sourcing spack setup-env.csh requires setting SPACK_ROOT to "
|
|
|
|
echo " the root of your spack installation."
|
2014-08-17 05:58:15 +08:00
|
|
|
endif
|