@@ -117,6 +117,20 @@ elsewhere too) can be done as follows::
117
117
versionsuffix: !join [-Python-, *pyver]
118
118
119
119
120
+ .. _easyconfig_yeb_format_syntax_escaping :
121
+
122
+ Escaping string values with single or double quotes
123
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
124
+
125
+ Strings in YAML can be unquoted. However, when they contain special characters they need to be escaped by either single-
126
+ or double-quoting the string.
127
+
128
+ Special characters that require single quotes are: `: ` `{ ` `} ` `[ ` `] ` `, ` `& ` `* ` `# ` `? ` `| ` `- ` `< ` `> ` `= ` `! ` `% ` `@ ` and `\` `.
129
+ When using single-quoted strings, any single quote inside the string must be doubled to escape it.
130
+
131
+ If the string contains control characters such as `\n `, it must be escaped with double quotes.
132
+
133
+
120
134
.. _easyconfig_yeb_format_syntax_easyconfig_parameters :
121
135
122
136
Easyconfig parameter values
@@ -138,6 +152,7 @@ Using scalar values is straight-forward, no special syntax is required.
138
152
139
153
For string values, no quotes must be used (in general).
140
154
However, quotes are sometimes required to escape characters that have special meaning in YAML (like '``: ``').
155
+ (Also see: :ref: `easyconfig_yeb_format_syntax_escaping `)
141
156
It's worth noting that there's a subtle difference between using single and double quotes, see
142
157
`Flow Scalar Styles <http://www.yaml.org/spec/1.2/spec.html#id2786942 >`_.
143
158
@@ -211,9 +226,9 @@ For example, sequence values can be used in a mapping::
211
226
212
227
And sequences of sequences are also supported::
213
228
214
- dependencies:
215
- - [bzip2, 1.0.6]
216
- - [Python, 2.7.10 ]
229
+ osdependencies
230
+ - zlib
231
+ - [openssl-devel, libssl-dev, libopenssl-devel ]
217
232
218
233
219
234
.. _easyconfig_yeb_format_syntax_template_values_constants :
@@ -238,19 +253,27 @@ See also :ref:`easyconfig_param_templates`.
238
253
Dependencies
239
254
~~~~~~~~~~~~
240
255
241
- The list of (build) dependencies can be specified as list of lists, see also
242
- :ref: `easyconfig_yeb_format_syntax_nesting `.
256
+ We updated the way dependencies are specified to match with the new toolchain format (:ref: `easyconfig_yeb_format_new `)
257
+ The format is a bit more verbose than before, but easier to read. Each dependency is a list entry, indicated by a dash
258
+ and space (`- `). Each entry can specify a ``name: version `` key-value pair, and a ``versionsuffix `` and ``toolchain ``.
259
+ Only the ``name: version `` pair is required.
260
+
261
+ Dependencies can also be external modules. In this case, the dependency has to be specified with a ``name `` and the marker
262
+ ``external_module: True ``. The boolean value is not case-sensitive.
263
+
243
264
244
265
A straightforward example::
245
266
246
- dependencies: [
247
- [libreadline, 6.3],
248
- [Tcl, 8.6.4],
249
- ]
250
- builddependencies: [
267
+ dependencies:
268
+ - libreadline: 6.3
269
+ - Tcl: 8.6.4
270
+ - name: fftw/3.3.4.4
271
+ external_module: True
272
+
273
+ builddependencies:
251
274
# empty versionsuffix, different toolchain (GCC/4.9.2)
252
- [ CMake, 3.2.2, '', [GCC, 4.9.2],
253
- ]
275
+ - CMake: 3.2.2
276
+ toolchain: GCC, 4.9.2
254
277
255
278
A more complicated example from a toolchain easyconfig, where also the ``!join `` operator
256
279
(see :ref: `easyconfig_yeb_format_syntax_string_concatenation `) and internal variables
@@ -268,17 +291,69 @@ A more complicated example from a toolchain easyconfig, where also the ``!join``
268
291
269
292
- &comp_mpi_tc [gompi, 1.4.10]
270
293
271
- dependencies: [
272
- *comp,
273
- [OpenMPI, 1.6.4, '', *comp],
274
- [*blaslib, *blasver, *blas_suff, *comp_mpi_tc],
275
- [FFTW, 3.3.3, '', *comp_mpi_tc],
276
- [ScaLAPACK, 2.0.2, !join [-, *blas, *blas_suff], *comp_mpi_tc]
277
- ]
294
+ dependencies:
295
+ - *comp_name: *comp_version
296
+ - OpenMPI: 1.6.4
297
+ toolchain: *comp
298
+ - *blaslib: *blasver
299
+ versionsuffix: *blas_suff
300
+ toolchain: *comp_mpi_tc
301
+ - FFTW: 3.3.3
302
+ toolchain: *comp_mpi_tc
303
+ - ScaLAPACK: 2.0.2
304
+ versionsuffix: !join [-, *blas, *blas_suff]
305
+ toolchain: *comp_mpi_tc
278
306
279
307
For the full version of this easyconfig file, see the example ``.yeb `` easyconfig
280
308
:ref: `easyconfig_yeb_format_examples_goolf1410 `.
281
309
310
+ .. _easyconfig_yeb_format_new :
311
+
312
+ OS dependencies and sanity check paths
313
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
314
+
315
+ To specify parameters that used to contain tuples such as ``osdependencies `` and ``sanity_check_paths ``, simply use
316
+ lists (sequences) instead of tuples.
317
+
318
+ For example::
319
+
320
+ # note: this is eb syntax, will not work in .yeb files
321
+ osdependencies = [('openssl-devel', 'libssl-dev', 'libopenssl-devel')]
322
+
323
+ Becomes::
324
+
325
+ osdependencies: [[openssl-devel, libssl-dev, libopenssl-devel]]
326
+
327
+ And::
328
+
329
+ # note: this is eb syntax, will not work in .yeb files
330
+ sanity_check_paths = {
331
+ 'files': ['fileA', ('fileB', 'fileC')],
332
+ 'dirs' : ['dirA', 'dirB'],
333
+ }
334
+
335
+ Becomes::
336
+
337
+ sanity_check_paths: {
338
+ files: [fileA, [fileB, fileC]],
339
+ dirs: [dirA, dirB]
340
+ }
341
+
342
+ Shorthands for common easyconfig parameters
343
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
344
+
345
+ Toolchain format
346
+ ################
347
+
348
+ The easyconfig parameter ``toolchain `` in .eb files is defined as a dictionary ``{'name':'foo', 'version':'bar'} ``. In
349
+ the .yeb format, this can be done much easier by just using ``name, version ``. E.g::
350
+
351
+ # note: this is eb syntax, will not work in yeb files
352
+ toolchain = {'name':'intel', 'version':'2015b'}
353
+
354
+ becomes::
355
+
356
+ toolchain: intel, 2015b
282
357
283
358
.. _easyconfig_yeb_format_examples :
284
359
@@ -306,7 +381,7 @@ Example easyconfig for gzip v1.6 using the ``GCC/4.9.2`` toolchain.
306
381
gzip is a popular data compression program
307
382
as a replacement for compress
308
383
309
- toolchain: {name: GCC, version: 4.9.2}
384
+ toolchain: GCC, 4.9.2
310
385
311
386
# http://ftp.gnu.org/gnu/gzip/gzip-1.6.tar.gz
312
387
source_urls: [*GNU_SOURCE]
@@ -359,13 +434,18 @@ Easyconfig file in YAML syntax for the goolf v1.4.10 toolchain.
359
434
# compiler toolchain dependencies
360
435
# we need GCC and OpenMPI as explicit dependencies instead of gompi toolchain
361
436
# because of toolchain preperation functions
362
- dependencies: [
363
- *comp,
364
- [OpenMPI, 1.6.4, '', *comp],
365
- [*blaslib, *blasver, *blas_suff, *comp_mpi_tc],
366
- [FFTW, 3.3.3, '', *comp_mpi_tc],
367
- [ScaLAPACK, 2.0.2, !join [-, *blas, *blas_suff], *comp_mpi_tc]
368
- ]
437
+ dependencies:
438
+ - *comp_name: *comp_version
439
+ - OpenMPI: 1.6.4
440
+ toolchain: *comp
441
+ - *blaslib: *blasver
442
+ versionsuffix: *blas_suff
443
+ toolchain: *comp_mpi_tc
444
+ - FFTW: 3.3.3
445
+ toolchain: *comp_mpi_tc
446
+ - ScaLAPACK: 2.0.2
447
+ versionsuffix: !join [-, *blas, *blas_suff]
448
+ toolchain: *comp_mpi_tc
369
449
370
450
moduleclass: toolchain
371
451
@@ -390,22 +470,24 @@ Python-2.7.10-intel-2015b.yeb
390
470
Python is a programming language that lets you work more quickly and integrate your systems
391
471
more effectively.
392
472
393
- toolchain: {name: intel, version: 2015b}
473
+ toolchain: intel, 2015b
394
474
toolchainopts: {pic: True, opt: True, optarch: True}
395
475
396
476
source_urls: ['http://www.python.org/ftp/python/%(version)s/']
397
477
sources: [*SOURCE_TGZ]
398
478
399
479
# python needs bzip2 to build the bz2 package
400
480
dependencies: [
401
- [bzip2, 1.0.6],
402
- [zlib, 1.2.8],
403
- [libreadline, '6.3'],
404
- [ncurses, '5.9'],
405
- [SQLite, 3.8.10.2],
406
- [Tk, 8.6.4, -no-X11],
407
- # [OpenSSL, 1.0.1m], # OS dependency should be preferred if the os version is more recent then this version, its
408
- # nice to have an up to date openssl for security reasons
481
+ - bzip2: 1.0.6
482
+ - zlib: 1.2.8
483
+ - libreadline: 6.3
484
+ - ncurses: 5.9
485
+ - SQLite: 3.8.10.2
486
+ - Tk: 8.4.6
487
+ versionsuffix: -no-X11
488
+ # - OpenSSL: 1.0.1m
489
+ # OS dependency should be preferred if the os version is more recent then this version, its
490
+ # nice to have an up to date openssl for security reasons
409
491
]
410
492
411
493
osdependencies: [[openssl-devel, libssl-dev, libopenssl-devel]]
0 commit comments