Skip to content

Commit 4c8c82a

Browse files
author
Benedikt Hegner
committed
Merge branch 'develop' of https://github.com/LLNL/spack into binary_packages
2 parents e7773ce + 407920e commit 4c8c82a

298 files changed

Lines changed: 11040 additions & 2651 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ before_install:
1616

1717
script:
1818
- . share/spack/setup-env.sh
19+
- spack compilers
20+
- spack config get compilers
1921
- spack test
22+
- spack install -v libdwarf
2023

2124
notifications:
2225
email:

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ written in pure Python, and specs allow package authors to write a
1919
single build script for many different builds of the same package.
2020

2121
See the
22-
[Feature Overview](http://llnl.github.io/spack/features.html)
22+
[Feature Overview](http://software.llnl.gov/spack/features.html)
2323
for examples and highlights.
2424

2525
To install spack and install your first package:
@@ -31,7 +31,7 @@ To install spack and install your first package:
3131
Documentation
3232
----------------
3333

34-
[**Full documentation**](http://llnl.github.io/spack) for Spack is
34+
[**Full documentation**](http://software.llnl.gov/spack) for Spack is
3535
the first place to look.
3636

3737
See also:
@@ -59,7 +59,8 @@ can join it here:
5959

6060
At the moment, contributing to Spack is relatively simple. Just send us
6161
a [pull request](https://help.github.com/articles/using-pull-requests/).
62-
When you send your request, make ``develop`` the destination branch.
62+
When you send your request, make ``develop`` the destination branch on the
63+
[Spack repository](https://github.com/LLNL/spack).
6364

6465
Spack is using a rough approximation of the [Git
6566
Flow](http://nvie.com/posts/a-successful-git-branching-model/)

bin/sbang

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#!/bin/bash
2+
#
3+
# `sbang`: Run scripts with long shebang lines.
4+
#
5+
# Many operating systems limit the length of shebang lines, making it
6+
# hard to use interpreters that are deep in the directory hierarchy.
7+
# `sbang` can run such scripts, either as a shebang interpreter, or
8+
# directly on the command line.
9+
#
10+
# Usage
11+
# -----------------------------
12+
# Suppose you have a script, long-shebang.sh, like this:
13+
#
14+
# 1 #!/very/long/path/to/some/interpreter
15+
# 2
16+
# 3 echo "success!"
17+
#
18+
# Invoking this script will result in an error on some OS's. On
19+
# Linux, you get this:
20+
#
21+
# $ ./long-shebang.sh
22+
# -bash: ./long: /very/long/path/to/some/interp: bad interpreter:
23+
# No such file or directory
24+
#
25+
# On Mac OS X, the system simply assumes the interpreter is the shell
26+
# and tries to run with it, which is likely not what you want.
27+
#
28+
#
29+
# `sbang` on the command line
30+
# -----------------------------
31+
# You can use `sbang` in two ways. The first is to use it directly,
32+
# from the command line, like this:
33+
#
34+
# $ sbang ./long-shebang.sh
35+
# success!
36+
#
37+
#
38+
# `sbang` as the interpreter
39+
# -----------------------------
40+
# You can also use `sbang` *as* the interpreter for your script. Put
41+
# `#!/bin/bash /path/to/sbang` on line 1, and move the original
42+
# shebang to line 2 of the script:
43+
#
44+
# 1 #!/bin/bash /path/to/sbang
45+
# 2 #!/long/path/to/real/interpreter with arguments
46+
# 3
47+
# 4 echo "success!"
48+
#
49+
# $ ./long-shebang.sh
50+
# success!
51+
#
52+
# On Linux, you could shorten line 1 to `#!/path/to/sbang`, but other
53+
# operating systems like Mac OS X require the interpreter to be a
54+
# binary, so it's best to use `sbang` as a `bash` argument.
55+
# Obviously, for this to work, `sbang` needs to have a short enough
56+
# path that *it* will run without hitting OS limits.
57+
#
58+
#
59+
# How it works
60+
# -----------------------------
61+
# `sbang` is a very simple bash script. It looks at the first two
62+
# lines of a script argument and runs the last line starting with
63+
# `#!`, with the script as an argument. It also forwards arguments.
64+
#
65+
66+
# First argument is the script we want to actually run.
67+
script="$1"
68+
69+
# Search the first two lines of script for interpreters.
70+
lines=0
71+
while read line && ((lines < 2)) ; do
72+
if [[ "$line" = '#!'* ]]; then
73+
interpreter="${line#\#!}"
74+
fi
75+
lines=$((lines+1))
76+
done < "$script"
77+
78+
# Invoke any interpreter found, or raise an error if none was found.
79+
if [ -n "$interpreter" ]; then
80+
exec $interpreter "$@"
81+
else
82+
echo "error: sbang found no interpreter in $script"
83+
exit 1
84+
fi

etc/spack/modules.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# -------------------------------------------------------------------------
2+
# This is the default spack module files generation configuration.
3+
#
4+
# Changes to this file will affect all users of this spack install,
5+
# although users can override these settings in their ~/.spack/modules.yaml.
6+
# -------------------------------------------------------------------------
7+
modules:
8+
enable: ['tcl', 'dotkit']

lib/spack/docs/basic_usage.rst

Lines changed: 99 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -149,26 +149,46 @@ customize an installation in :ref:`sec-specs`.
149149
``spack uninstall``
150150
~~~~~~~~~~~~~~~~~~~~~
151151

152-
To uninstall a package, type ``spack uninstall <package>``. This will
153-
completely remove the directory in which the package was installed.
152+
To uninstall a package, type ``spack uninstall <package>``. This will ask the user for
153+
confirmation, and in case will completely remove the directory in which the package was installed.
154154

155155
.. code-block:: sh
156156
157157
spack uninstall mpich
158158
159159
If there are still installed packages that depend on the package to be
160-
uninstalled, spack will refuse to uninstall it. You can override this
161-
behavior with ``spack uninstall -f <package>``, but you risk breaking
162-
other installed packages. In general, it is safer to remove dependent
163-
packages *before* removing their dependencies.
160+
uninstalled, spack will refuse to uninstall it.
164161

165-
A line like ``spack uninstall mpich`` may be ambiguous, if multiple
166-
``mpich`` configurations are installed. For example, if both
162+
To uninstall a package and every package that depends on it, you may give the
163+
`--dependents` option.
164+
165+
.. code-block:: sh
166+
167+
spack uninstall --dependents mpich
168+
169+
will display a list of all the packages that depends on `mpich` and, upon confirmation,
170+
will uninstall them in the right order.
171+
172+
A line like
173+
174+
.. code-block:: sh
175+
176+
spack uninstall mpich
177+
178+
may be ambiguous, if multiple ``mpich`` configurations are installed. For example, if both
167179
``mpich@3.0.2`` and ``mpich@3.1`` are installed, ``mpich`` could refer
168180
to either one. Because it cannot determine which one to uninstall,
169-
Spack will ask you to provide a version number to remove the
170-
ambiguity. As an example, ``spack uninstall mpich@3.1`` is
171-
unambiguous in this scenario.
181+
Spack will ask you either to provide a version number to remove the
182+
ambiguity or use the ``--all`` option to uninstall all of the matching packages.
183+
184+
You may force uninstall a package with the `--force` option
185+
186+
.. code-block:: sh
187+
188+
spack uninstall --force mpich
189+
190+
but you risk breaking other installed packages. In general, it is safer to remove dependent
191+
packages *before* removing their dependencies or use the `--dependents` option.
172192

173193

174194
Seeing installed packages
@@ -352,25 +372,32 @@ how this is done is in :ref:`sec-specs`.
352372
``spack compiler add``
353373
~~~~~~~~~~~~~~~~~~~~~~~
354374

375+
An alias for ``spack compiler find``.
376+
377+
.. _spack-compiler-find:
378+
379+
``spack compiler find``
380+
~~~~~~~~~~~~~~~~~~~~~~~
381+
355382
If you do not see a compiler in this list, but you want to use it with
356-
Spack, you can simply run ``spack compiler add`` with the path to
383+
Spack, you can simply run ``spack compiler find`` with the path to
357384
where the compiler is installed. For example::
358385

359-
$ spack compiler add /usr/local/tools/ic-13.0.079
360-
==> Added 1 new compiler to /Users/gamblin2/.spackconfig
386+
$ spack compiler find /usr/local/tools/ic-13.0.079
387+
==> Added 1 new compiler to /Users/gamblin2/.spack/compilers.yaml
361388
intel@13.0.079
362389

363-
Or you can run ``spack compiler add`` with no arguments to force
390+
Or you can run ``spack compiler find`` with no arguments to force
364391
auto-detection. This is useful if you do not know where compilers are
365392
installed, but you know that new compilers have been added to your
366393
``PATH``. For example, using dotkit, you might do this::
367394

368395
$ module load gcc-4.9.0
369-
$ spack compiler add
370-
==> Added 1 new compiler to /Users/gamblin2/.spackconfig
396+
$ spack compiler find
397+
==> Added 1 new compiler to /Users/gamblin2/.spack/compilers.yaml
371398
gcc@4.9.0
372399

373-
This loads the environment module for gcc-4.9.0 to get it into the
400+
This loads the environment module for gcc-4.9.0 to add it to
374401
``PATH``, and then it adds the compiler to Spack.
375402

376403
.. _spack-compiler-info:
@@ -398,27 +425,34 @@ Manual compiler configuration
398425
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
399426

400427
If auto-detection fails, you can manually configure a compiler by
401-
editing your ``~/.spackconfig`` file. You can do this by running
402-
``spack config edit``, which will open the file in your ``$EDITOR``.
428+
editing your ``~/.spack/compilers.yaml`` file. You can do this by running
429+
``spack config edit compilers``, which will open the file in your ``$EDITOR``.
403430

404431
Each compiler configuration in the file looks like this::
405432

406433
...
407-
[compiler "intel@15.0.0"]
408-
cc = /usr/local/bin/icc-15.0.024-beta
409-
cxx = /usr/local/bin/icpc-15.0.024-beta
410-
f77 = /usr/local/bin/ifort-15.0.024-beta
411-
fc = /usr/local/bin/ifort-15.0.024-beta
412-
...
434+
chaos_5_x86_64_ib:
435+
...
436+
intel@15.0.0:
437+
cc: /usr/local/bin/icc-15.0.024-beta
438+
cxx: /usr/local/bin/icpc-15.0.024-beta
439+
f77: /usr/local/bin/ifort-15.0.024-beta
440+
fc: /usr/local/bin/ifort-15.0.024-beta
441+
...
442+
443+
The chaos_5_x86_64_ib string is an architecture string, and multiple
444+
compilers can be listed underneath an architecture. The architecture
445+
string may be replaced with the string 'all' to signify compilers that
446+
work on all architectures.
413447

414448
For compilers, like ``clang``, that do not support Fortran, put
415449
``None`` for ``f77`` and ``fc``::
416450

417-
[compiler "clang@3.3svn"]
418-
cc = /usr/bin/clang
419-
cxx = /usr/bin/clang++
420-
f77 = None
421-
fc = None
451+
clang@3.3svn:
452+
cc: /usr/bin/clang
453+
cxx: /usr/bin/clang++
454+
f77: None
455+
fc: None
422456

423457
Once you save the file, the configured compilers will show up in the
424458
list displayed by ``spack compilers``.
@@ -767,6 +801,39 @@ Environment modules
767801
Spack provides some limited integration with environment module
768802
systems to make it easier to use the packages it provides.
769803

804+
805+
Installing Environment Modules
806+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
807+
808+
In order to use Spack's generated environment modules, you must have
809+
installed the *Environment Modules* package. On many Linux
810+
distributions, this can be installed from the vendor's repository.
811+
For example: ```yum install environment-modules``
812+
(Fedora/RHEL/CentOS). If your Linux distribution does not have
813+
Environment Modules, you can get it with Spack:
814+
815+
1. Install with::
816+
817+
.. code-block:: sh
818+
819+
spack install environment-modules
820+
821+
2. Activate with::
822+
823+
Add the following two lines to your ``.bashrc`` profile (or similar):
824+
825+
.. code-block:: sh
826+
827+
MODULES_HOME=`spack location -i environment-modules`
828+
source ${MODULES_HOME}/Modules/init/bash
829+
830+
In case you use a Unix shell other than bash, substitute ``bash`` by
831+
the appropriate file in ``${MODULES_HOME}/Modules/init/``.
832+
833+
834+
Spack and Environment Modules
835+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
836+
770837
You can enable shell support by sourcing some files in the
771838
``/share/spack`` directory.
772839

@@ -896,7 +963,7 @@ Or, similarly with modules, you could type:
896963
$ spack load mpich %gcc@4.4.7
897964
898965
These commands will add appropriate directories to your ``PATH``,
899-
``MANPATH``, and ``LD_LIBRARY_PATH``. When you no longer want to use
966+
``MANPATH``, ``CPATH``, and ``LD_LIBRARY_PATH``. When you no longer want to use
900967
a package, you can type unload or unuse similarly:
901968

902969
.. code-block:: sh

lib/spack/docs/developer_guide.rst

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,19 +73,32 @@ with a high level view of Spack's directory structure::
7373
spack/ <- installation root
7474
bin/
7575
spack <- main spack executable
76+
77+
etc/
78+
spack/ <- Spack config files.
79+
Can be overridden by files in ~/.spack.
80+
7681
var/
7782
spack/ <- build & stage directories
83+
repos/ <- contains package repositories
84+
builtin/ <- pkg repository that comes with Spack
85+
repo.yaml <- descriptor for the builtin repository
86+
packages/ <- directories under here contain packages
87+
7888
opt/
7989
spack/ <- packages are installed here
90+
8091
lib/
8192
spack/
8293
docs/ <- source for this documentation
8394
env/ <- compiler wrappers for build environment
8495

96+
external/ <- external libs included in Spack distro
97+
llnl/ <- some general-use libraries
98+
8599
spack/ <- spack module; contains Python code
86100
cmd/ <- each file in here is a spack subcommand
87101
compilers/ <- compiler description files
88-
packages/ <- each file in here is a spack package
89102
test/ <- unit test modules
90103
util/ <- common code
91104

lib/spack/docs/features.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ creates a simple python file:
103103
It doesn't take much python coding to get from there to a working
104104
package:
105105

106-
.. literalinclude:: ../../../var/spack/packages/libelf/package.py
106+
.. literalinclude:: ../../../var/spack/repos/builtin/packages/libelf/package.py
107107
:lines: 25-
108108

109109
Spack also provides wrapper functions around common commands like

lib/spack/docs/getting_started.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ go:
2222
$ spack install libelf
2323
2424
For a richer experience, use Spack's `shell support
25-
<http://llnl.github.io/spack/basic_usage.html#environment-modules>`_:
25+
<http://software.llnl.gov/spack/basic_usage.html#environment-modules>`_:
2626

2727
.. code-block:: sh
2828

lib/spack/docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ configurations can coexist on the same system.
1818
Most importantly, Spack is *simple*. It offers a simple *spec* syntax
1919
so that users can specify versions and configuration options
2020
concisely. Spack is also simple for package authors: package files
21-
are writtin in pure Python, and specs allow package authors to
21+
are written in pure Python, and specs allow package authors to
2222
maintain a single file for many different builds of the same package.
2323

2424
See the :doc:`features` for examples and highlights.

0 commit comments

Comments
 (0)