You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorial_build_automation.rst
+17-32Lines changed: 17 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,53 +109,36 @@ Here is the test's code:
109
109
110
110
111
111
When :attr:`~reframe.core.pipeline.RegressionTest.build_system` is set to ``'Spack'``, ReFrame will leverage Spack environments in order to build the test code.
112
-
If the environment is not specified by the user, ReFrame will automatically create one inside the stage directory.
113
-
ReFrame treats Spack environments specified by the user as *test resources* so it expects to find them under the test's :attr:`~reframe.core.pipeline.RegressionTest.sourcesdir`, which defaults to ``'src'``.
114
-
Here is the directory structure for the test in this particular example that we show here:
115
-
116
-
.. code:: console
117
-
118
-
tutorials/build_systems/spack/
119
-
├── spack_test.py
120
-
└── src
121
-
└── myenv
122
-
└── spack.yaml
123
-
124
-
125
-
We could have placed ``spack.yaml`` directly under the ``src/`` directory, in which case we would need to specify ``'.'`` as an environment.
126
-
For reference, here are the contents of ``spack.yaml``:
By default, ReFrame will create a new Spack environment in the test's stage directory and add the requested :attr:`~reframe.core.buildsystems.Spack.specs` to it.
113
+
Users may also specify an existing Spack environment by setting the :attr:`~reframe.core.buildsystems.Spack.environment` attribute.
114
+
In this case, ReFrame treats the environment as a *test resource* so it expects to find it under the test's :attr:`~reframe.core.pipeline.RegressionTest.sourcesdir`, which defaults to ``'src'``.
130
115
131
116
As with every other test, ReFrame will copy the test's resources to its stage directory before building it.
132
-
ReFrame will then activate the environment and install the associated specs as in this case.
133
-
Optionally, we can add more specs to the environment by setting the :attr:`~reframe.core.buildsystems.Spack.specs` attribute of the build system.
134
-
Here is what ReFrame generates as a build script in this example:
117
+
ReFrame will then activate the generated environment (either the one provided by the user or the one generated by ReFrame), add the given specs using the ``spack add`` command and, finally, install the packages in the environment.
118
+
Here is what ReFrame generates as a build script for this example:
Any additional specs specified inside the ReFrame test will be added using the ``spack add`` command.
143
129
As you might have noticed ReFrame expects that Spack is already installed on the system.
144
130
The packages specified in the environment and the tests will be installed in the test's stage directory, where the environment is copied before building.
145
131
Here is the stage directory structure:
146
132
147
133
.. code:: console
148
134
149
135
stage/generic/default/builtin/BZip2SpackCheck/
150
-
├── myenv
136
+
├── rfm_spack_env
151
137
│ ├── spack
152
-
│ │ ├── opt
153
-
│ │ │ └── spack
154
-
│ │ │ ├── bin
155
-
│ │ │ └── darwin-catalina-skylake
156
-
│ │ └── share
157
-
│ │ └── spack
158
-
│ │ └── modules
138
+
│ │ └── opt
139
+
│ │ └── spack
140
+
│ │ ├── bin
141
+
│ │ └── darwin-catalina-skylake
159
142
│ ├── spack.lock
160
143
│ └── spack.yaml
161
144
├── rfm_BZip2SpackCheck_build.err
@@ -172,7 +155,9 @@ Finally, here is the generated run script that ReFrame uses to run the test, onc
0 commit comments