Using the new module autoload option

105 views
Skip to first unread message

Patrick Gartung

unread,
Jun 30, 2016, 2:25:53 PM6/30/16
to Spack
I tried copying spack/etc/spack/modules.yaml to ~/.spack and editing to look like below following the example in
https://github.com/LLNL/spack/pull/984
and now I get the error below. What am I doing wrong?

modules:
  tcl:
    %g...@4.9.3:
    load:
      g...@4.9.3
  enable:
    - tcl
    - dotkit
  prefix_inspections:
    bin:
      - PATH
    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


Traceback (most recent call last):
  File "/home/gartung/llnl-spack/bin/spack", line 119, in <module>
    module = spack.cmd.get_module(cmd)
  File "/home/gartung/llnl-spack/lib/spack/spack/cmd/__init__.py", line 72, in get_module
    level=0)
  File "/home/gartung/llnl-spack/lib/spack/spack/cmd/cd.py", line 26, in <module>
    import spack.modules
  File "/home/gartung/llnl-spack/lib/spack/spack/modules.py", line 62, in <module>
    CONFIGURATION = spack.config.get_config('modules')
  File "/home/gartung/llnl-spack/lib/spack/spack/config.py", line 621, in get_config
    data = scope.get_section(section)
  File "/home/gartung/llnl-spack/lib/spack/spack/config.py", line 474, in get_section
    data   = _read_config_file(path, schema)
  File "/home/gartung/llnl-spack/lib/spack/spack/config.py", line 549, in _read_config_file
    "Error parsing yaml%s: %s" % (str(e.context_mark), e.problem))
spack.config.ConfigFileError: Error parsing yamlNone: found character '%' that cannot start any token


Patrick Gartung

unread,
Jun 30, 2016, 2:35:09 PM6/30/16
to Spack
And while I am at it "spack module refresh" gives me this error with the default etc/spack/modules.yaml

[gartung@gartung spack]$ spack module refresh
==> Regenerating tcl module files.

Traceback (most recent call last):
  File "/home/gartung/llnl-spack/bin/spack", line 179, in <module>
    main()
  File "/home/gartung/llnl-spack/bin/spack", line 157, in main
    return_val = command(parser, args)
  File "/home/gartung/llnl-spack/lib/spack/spack/cmd/module.py", line 154, in module
    module_refresh()
  File "/home/gartung/llnl-spack/lib/spack/spack/cmd/module.py", line 145, in module_refresh
    if os.path.isdir(cls.path):
AttributeError: type object 'TclModule' has no attribute 'path'


Massimiliano Culpo

unread,
Jun 30, 2016, 3:10:12 PM6/30/16
to Spack
Hi,


On Thursday, June 30, 2016 at 8:35:09 PM UTC+2, Patrick Gartung wrote:
And while I am at it "spack module refresh" gives me this error with the default etc/spack/modules.yaml
 
see 'fixes' in #1135

For Yaml, I would try quoting the stuff, i.e. "%g...@4.9.3". Please tell me if that works, otherwise I'll have a look tomorrow.

M.

Patrick Gartung

unread,
Jun 30, 2016, 7:25:26 PM6/30/16
to Spack
Using "%g...@4.9.3": in modules.yaml worked. I used you branch to refresh the modules.
Reply all
Reply to author
Forward
0 new messages