From 26480f14f901da087efbac263835c8767eaea23a Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 19 Jul 2016 17:10:17 -0700 Subject: Add "default" configuration scope. - Default scope is versioned with spack and can be overridden by site or user config. - Default scope provides sensible default concretization preferences for all of Spack. - per-platform concretization scope can be added later (to force a particular MPI on, e.g., Cray systems) --- .gitignore | 2 +- etc/spack/defaults/modules.yaml | 40 ++++++++++++++++++++++++++++++++++++++++ etc/spack/defaults/packages.yaml | 21 +++++++++++++++++++++ etc/spack/defaults/repos.yaml | 14 ++++++++++++++ etc/spack/modules.yaml | 31 ------------------------------- etc/spack/repos.yaml | 8 -------- lib/spack/spack/config.py | 9 ++++++++- 7 files changed, 84 insertions(+), 41 deletions(-) create mode 100644 etc/spack/defaults/modules.yaml create mode 100644 etc/spack/defaults/packages.yaml create mode 100644 etc/spack/defaults/repos.yaml delete mode 100644 etc/spack/modules.yaml delete mode 100644 etc/spack/repos.yaml diff --git a/.gitignore b/.gitignore index bfc6172a4e..1d4d24aa52 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ *~ .DS_Store .idea -/etc/spack/* +/etc/spack/*.yaml /etc/spackconfig /share/spack/dotkit /share/spack/modules diff --git a/etc/spack/defaults/modules.yaml b/etc/spack/defaults/modules.yaml new file mode 100644 index 0000000000..8864a76547 --- /dev/null +++ b/etc/spack/defaults/modules.yaml @@ -0,0 +1,40 @@ +# ------------------------------------------------------------------------- +# This is the default configuration for Spack's module file generation. +# +# Settings here are versioned with Spack and are intended to provide +# sensible defaults out of the box. Spack maintainers should edit this +# file to keep it current. +# +# Users can override these settings by editing the following files. +# +# Per-spack-instance settings (overrides defaults): +# $SPACK_ROOT/etc/spack/modules.yaml +# +# Per-user settings (overrides default and site settings): +# ~/.spack/modules.yaml +# ------------------------------------------------------------------------- +modules: + enable: + - tcl + - dotkit + prefix_inspections: + bin: + - PATH + man: + - MANPATH + share/man: + - MANPATH + lib: + - LIBRARY_PATH + - LD_LIBRARY_PATH + lib64: + - LIBRARY_PATH + - LD_LIBRARY_PATH + include: + - CPATH + lib/pkgconfig: + - PKG_CONFIG_PATH + lib64/pkgconfig: + - PKG_CONFIG_PATH + '': + - CMAKE_PREFIX_PATH diff --git a/etc/spack/defaults/packages.yaml b/etc/spack/defaults/packages.yaml new file mode 100644 index 0000000000..83f9eb7ece --- /dev/null +++ b/etc/spack/defaults/packages.yaml @@ -0,0 +1,21 @@ +# ------------------------------------------------------------------------- +# This file controls default concretization preferences for Spack. +# +# Settings here are versioned with Spack and are intended to provide +# sensible defaults out of the box. Spack maintainers should edit this +# file to keep it current. +# +# Users can override these settings by editing the following files. +# +# Per-spack-instance settings (overrides defaults): +# $SPACK_ROOT/etc/spack/packages.yaml +# +# Per-user settings (overrides default and site settings): +# ~/.spack/packages.yaml +# ------------------------------------------------------------------------- +packages: + all: + providers: + mpi: [openmpi, mpich] + blas: [openblas] + lapack: [openblas] diff --git a/etc/spack/defaults/repos.yaml b/etc/spack/defaults/repos.yaml new file mode 100644 index 0000000000..f3e00653eb --- /dev/null +++ b/etc/spack/defaults/repos.yaml @@ -0,0 +1,14 @@ +# ------------------------------------------------------------------------- +# This is the default spack repository configuration. It includes the +# builtin spack package repository. +# +# Users can override these settings by editing the following files. +# +# Per-spack-instance settings (overrides defaults): +# $SPACK_ROOT/etc/spack/repos.yaml +# +# Per-user settings (overrides default and site settings): +# ~/.spack/repos.yaml +# ------------------------------------------------------------------------- +repos: + - $spack/var/spack/repos/builtin diff --git a/etc/spack/modules.yaml b/etc/spack/modules.yaml deleted file mode 100644 index 9ae54a2d09..0000000000 --- a/etc/spack/modules.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# ------------------------------------------------------------------------- -# This is the default spack module files generation configuration. -# -# Changes to this file will affect all users of this spack install, -# although users can override these settings in their ~/.spack/modules.yaml. -# ------------------------------------------------------------------------- -modules: - enable: - - tcl - - dotkit - prefix_inspections: - bin: - - PATH - man: - - MANPATH - share/man: - - MANPATH - lib: - - LIBRARY_PATH - - LD_LIBRARY_PATH - lib64: - - LIBRARY_PATH - - LD_LIBRARY_PATH - include: - - CPATH - lib/pkgconfig: - - PKG_CONFIG_PATH - lib64/pkgconfig: - - PKG_CONFIG_PATH - '': - - CMAKE_PREFIX_PATH diff --git a/etc/spack/repos.yaml b/etc/spack/repos.yaml deleted file mode 100644 index 2d4ff54ce6..0000000000 --- a/etc/spack/repos.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# ------------------------------------------------------------------------- -# This is the default spack repository configuration. -# -# Changes to this file will affect all users of this spack install, -# although users can override these settings in their ~/.spack/repos.yaml. -# ------------------------------------------------------------------------- -repos: - - $spack/var/spack/repos/builtin diff --git a/lib/spack/spack/config.py b/lib/spack/spack/config.py index 3a66e9f2a6..8b5e96f97d 100644 --- a/lib/spack/spack/config.py +++ b/lib/spack/spack/config.py @@ -497,8 +497,15 @@ class ConfigScope(object): """Empty cached config information.""" self.sections = {} +"""Default configuration scope is the lowest-level scope. These are + versioned with Spack and can be overridden by sites or users.""" +ConfigScope('defaults', os.path.join(spack.etc_path, 'spack', 'defaults')) -ConfigScope('site', os.path.join(spack.etc_path, 'spack')), +"""Site configuration is per spack instance, for sites or projects. + No site-level configs should be checked into spack by default.""" +ConfigScope('site', os.path.join(spack.etc_path, 'spack')) + +"""User configuration can override both spack defaults and site config.""" ConfigScope('user', os.path.expanduser('~/.spack')) -- cgit v1.2.3-60-g2f50