Adding more init_config as args to all_compilers,all_compilers_config, and get_compiler_config
This commit is contained in:
parent
fe30113502
commit
1303b5a6a9
@ -83,7 +83,7 @@ def _to_dict(compiler):
|
|||||||
return {'compiler': d}
|
return {'compiler': d}
|
||||||
|
|
||||||
|
|
||||||
def get_compiler_config(scope=None):
|
def get_compiler_config(scope=None, init_config=True):
|
||||||
"""Return the compiler configuration for the specified architecture.
|
"""Return the compiler configuration for the specified architecture.
|
||||||
"""
|
"""
|
||||||
def init_compiler_config():
|
def init_compiler_config():
|
||||||
@ -98,7 +98,7 @@ def init_compiler_config():
|
|||||||
# Update the configuration if there are currently no compilers
|
# Update the configuration if there are currently no compilers
|
||||||
# configured. Avoid updating automatically if there ARE site
|
# configured. Avoid updating automatically if there ARE site
|
||||||
# compilers configured but no user ones.
|
# compilers configured but no user ones.
|
||||||
if not config:
|
if not config and init_config:
|
||||||
if scope is None:
|
if scope is None:
|
||||||
# We know no compilers were configured in any scope.
|
# We know no compilers were configured in any scope.
|
||||||
init_compiler_config()
|
init_compiler_config()
|
||||||
@ -153,23 +153,23 @@ def remove_compiler_from_config(compiler_spec, scope=None):
|
|||||||
spack.config.update_config('compilers', filtered_compiler_config, scope)
|
spack.config.update_config('compilers', filtered_compiler_config, scope)
|
||||||
|
|
||||||
|
|
||||||
def all_compilers_config(scope=None):
|
def all_compilers_config(scope=None, init_config=True):
|
||||||
"""Return a set of specs for all the compiler versions currently
|
"""Return a set of specs for all the compiler versions currently
|
||||||
available to build with. These are instances of CompilerSpec.
|
available to build with. These are instances of CompilerSpec.
|
||||||
"""
|
"""
|
||||||
# Get compilers for this architecture.
|
# Get compilers for this architecture.
|
||||||
global _cache_config_file #Create a cache of the config file so we don't load all the time.
|
global _cache_config_file #Create a cache of the config file so we don't load all the time.
|
||||||
if not _cache_config_file:
|
if not _cache_config_file:
|
||||||
_cache_config_file = get_compiler_config(scope)
|
_cache_config_file = get_compiler_config(scope, init_config)
|
||||||
return _cache_config_file
|
return _cache_config_file
|
||||||
else:
|
else:
|
||||||
return _cache_config_file
|
return _cache_config_file
|
||||||
|
|
||||||
|
|
||||||
def all_compilers(scope=None):
|
def all_compilers(scope=None, init_config=True):
|
||||||
# Return compiler specs from the merged config.
|
# Return compiler specs from the merged config.
|
||||||
return [spack.spec.CompilerSpec(s['compiler']['spec'])
|
return [spack.spec.CompilerSpec(s['compiler']['spec'])
|
||||||
for s in all_compilers_config(scope)]
|
for s in all_compilers_config(scope, init_config)]
|
||||||
|
|
||||||
|
|
||||||
def default_compiler():
|
def default_compiler():
|
||||||
|
Loading…
Reference in New Issue
Block a user