Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Spack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eic_tools
Spack
Commits
00f44d55
Commit
00f44d55
authored
8 years ago
by
Massimiliano Culpo
Browse files
Options
Downloads
Patches
Plain Diff
modules : started working on naming schemes and conflict
parent
1b4c4be1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/spack/spack/config.py
+8
-1
8 additions, 1 deletion
lib/spack/spack/config.py
lib/spack/spack/modules.py
+34
-22
34 additions, 22 deletions
lib/spack/spack/modules.py
with
42 additions
and
23 deletions
lib/spack/spack/config.py
+
8
−
1
View file @
00f44d55
...
...
@@ -297,6 +297,9 @@
'
properties
'
:
{
'
whitelist
'
:
{
'
$ref
'
:
'
#/definitions/array_of_strings
'
},
'
blacklist
'
:
{
'
$ref
'
:
'
#/definitions/array_of_strings
'
},
'
naming_scheme
'
:
{
'
type
'
:
'
string
'
# Can we be more specific here?
}
}
},
{
...
...
@@ -322,7 +325,11 @@
'
tcl
'
:
{
'
allOf
'
:
[
{
'
$ref
'
:
'
#/definitions/module_type_configuration
'
},
# Base configuration
{}
# Specific tcl extensions
{
'
properties
'
:
{
'
conflict
'
:
{
'
type
'
:
'
string
'
}
}
}
# Specific tcl extensions
]
},
'
dotkit
'
:
{
...
...
This diff is collapsed.
Click to expand it.
lib/spack/spack/modules.py
+
34
−
22
View file @
00f44d55
...
...
@@ -41,11 +41,11 @@
Each hook in hooks/ implements the logic for writing its specific type of module file.
"""
import
copy
import
datetime
import
os
import
os.path
import
re
import
textwrap
import
datetime
import
llnl.util.tty
as
tty
import
spack
...
...
@@ -75,7 +75,7 @@ def print_help():
"
. %s/setup-env.sh
"
%
spack
.
share_path
,
""
,
"
For csh and tcsh:
"
,
"
setenv SPACK_ROOT %s
"
%
spack
.
prefix
,
"
setenv SPACK_ROOT %s
"
%
spack
.
prefix
,
"
source %s/setup-env.csh
"
%
spack
.
share_path
,
""
)
...
...
@@ -263,6 +263,34 @@ def __init__(self, spec=None):
if
self
.
spec
.
package
.
__doc__
:
self
.
long_description
=
re
.
sub
(
r
'
\s+
'
,
'
'
,
self
.
spec
.
package
.
__doc__
)
@property
def
naming_scheme
(
self
):
try
:
naming_scheme
=
CONFIGURATION
[
self
.
name
][
'
naming_scheme
'
]
except
KeyError
:
naming_scheme
=
self
.
default_naming_format
return
naming_scheme
@property
def
tokens
(
self
):
tokens
=
{
'
name
'
:
self
.
spec
.
name
,
'
version
'
:
self
.
spec
.
version
,
'
compiler
'
:
self
.
spec
.
compiler
,
'
hash
'
:
self
.
spec
.
dag_hash
()
}
return
tokens
@property
def
use_name
(
self
):
"""
Subclasses should implement this to return the name the module command uses to refer to the package.
"""
naming_tokens
=
self
.
tokens
naming_scheme
=
self
.
naming_scheme
name
=
naming_scheme
.
format
(
**
naming_tokens
)
return
name
@property
def
category
(
self
):
# Anything defined at the package level takes precedence
...
...
@@ -379,12 +407,6 @@ def file_name(self):
where this module lives.
"""
raise
NotImplementedError
()
@property
def
use_name
(
self
):
"""
Subclasses should implement this to return the name the
module command uses to refer to the package.
"""
raise
NotImplementedError
()
def
remove
(
self
):
mod_file
=
self
.
file_name
if
os
.
path
.
exists
(
mod_file
):
...
...
@@ -408,17 +430,12 @@ class Dotkit(EnvModule):
prerequisite_format
=
None
# TODO : does something like prerequisite exist for dotkit?
default_naming_format
=
'
{name}-{version}-{compiler.name}-{compiler.version}-{hash}
'
@property
def
file_name
(
self
):
return
join_path
(
Dotkit
.
path
,
self
.
spec
.
architecture
,
'
%s.dk
'
%
self
.
use_name
)
@property
def
use_name
(
self
):
return
"
%s-%s-%s-%s-%s
"
%
(
self
.
spec
.
name
,
self
.
spec
.
version
,
self
.
spec
.
compiler
.
name
,
self
.
spec
.
compiler
.
version
,
self
.
spec
.
dag_hash
())
@property
def
header
(
self
):
# Category
...
...
@@ -456,17 +473,12 @@ class TclModule(EnvModule):
prerequisite_format
=
'
prereq {module_file}
\n
'
default_naming_format
=
'
{name}-{version}-{compiler.name}-{compiler.version}-{hash}
'
@property
def
file_name
(
self
):
return
join_path
(
TclModule
.
path
,
self
.
spec
.
architecture
,
self
.
use_name
)
@property
def
use_name
(
self
):
return
"
%s-%s-%s-%s-%s
"
%
(
self
.
spec
.
name
,
self
.
spec
.
version
,
self
.
spec
.
compiler
.
name
,
self
.
spec
.
compiler
.
version
,
self
.
spec
.
dag_hash
())
@property
def
header
(
self
):
# TCL Modulefile header
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment