summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorMatthew Thompson <fortran@gmail.com>2017-05-10 11:18:45 -0400
committerAdam J. Stewart <ajstewart426@gmail.com>2017-05-10 10:18:45 -0500
commit604f65f3952eaadfdffe1ce2215517a499bb2dcc (patch)
tree084b7dd45d4e5427dc252b8dbdc00f819cf38400 /share
parente4538658591c85fd86acdf3e62c12db564240c16 (diff)
downloadspack-604f65f3952eaadfdffe1ce2215517a499bb2dcc.tar.gz
spack-604f65f3952eaadfdffe1ce2215517a499bb2dcc.tar.bz2
spack-604f65f3952eaadfdffe1ce2215517a499bb2dcc.tar.xz
spack-604f65f3952eaadfdffe1ce2215517a499bb2dcc.zip
Edits to get setup-env.csh working better (#4044)
* Edits to get setup-env.csh working better. Autosets the sys_type a la setup-env.sh * More stealing from bash setup script for module roots * Add error message if SPACK_ROOT isn't set * Remove _sp_lmod_root per Adam J Stewart
Diffstat (limited to 'share')
-rwxr-xr-xshare/spack/setup-env.csh12
1 files changed, 9 insertions, 3 deletions
diff --git a/share/spack/setup-env.csh b/share/spack/setup-env.csh
index b960c21459..8bb08dafde 100755
--- a/share/spack/setup-env.csh
+++ b/share/spack/setup-env.csh
@@ -39,9 +39,15 @@ if ($?SPACK_ROOT) then
alias spack 'set _sp_args = (\!*); source $_spack_share_dir/csh/spack.csh'
alias _spack_pathadd 'set _pa_args = (\!*) && source $_spack_share_dir/csh/pathadd.csh'
+ # Shamelessly stolen from setup-env.sh
+ set _sp_sys_type = `$SPACK_ROOT/bin/spack python -c 'print(spack.architecture.sys_type())'`
+ set _sp_dotkit_root = `$SPACK_ROOT/bin/spack python -c "print(spack.util.path.canonicalize_path(spack.config.get_config('config').get('module_roots').get('dotkit')))"`
+ set _sp_tcl_root = `$SPACK_ROOT/bin/spack python -c "print(spack.util.path.canonicalize_path(spack.config.get_config('config').get('module_roots').get('tcl')))"`
+
# Set up modules and dotkit search paths in the user environment
- # TODO: fix SYS_TYPE to something non-LLNL-specific
- _spack_pathadd DK_NODE "$_spack_share_dir/dotkit/$SYS_TYPE"
- _spack_pathadd MODULEPATH "$_spack_share_dir/modules/$SYS_TYPE"
+ _spack_pathadd DK_NODE "$_sp_dotkit_root/$_sp_sys_type"
+ _spack_pathadd MODULEPATH "$_sp_tcl_root/$_sp_sys_type"
_spack_pathadd PATH "$SPACK_ROOT/bin"
+else
+ echo "ERROR: Sourcing spack setup-env.csh requires setting SPACK_ROOT to the root of your spack installation"
endif