From 604f65f3952eaadfdffe1ce2215517a499bb2dcc Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Wed, 10 May 2017 11:18:45 -0400 Subject: 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 --- share/spack/setup-env.csh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'share') 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 -- cgit v1.2.3-60-g2f50