summaryrefslogtreecommitdiff
path: root/lib/spack/docs/getting_started.rst
blob: 676697a54940e87aaafbb4659f55fa1dcdf166d7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
===============
Getting Started
===============

--------
Download
--------

Getting spack is easy.  You can clone it from the `github repository
<https://github.com/llnl/spack>`_ using this command:

.. code-block:: console

   $ git clone https://github.com/llnl/spack.git

This will create a directory called ``spack``.  We'll assume that the
full path to this directory is in the ``SPACK_ROOT`` environment
variable.  Add ``$SPACK_ROOT/bin`` to your path and you're ready to
go:

.. code-block:: console

   $ export PATH=$SPACK_ROOT/bin:$PATH
   $ spack install libelf

For a richer experience, use Spack's `shell support
<http://software.llnl.gov/spack/basic_usage.html#environment-modules>`_:

.. code-block:: console

   # For bash users
   $ export SPACK_ROOT=/path/to/spack
   $ . $SPACK_ROOT/share/spack/setup-env.sh

   # For tcsh or csh users (note you must set SPACK_ROOT)
   $ setenv SPACK_ROOT /path/to/spack
   $ source $SPACK_ROOT/share/spack/setup-env.csh

This automatically adds Spack to your ``PATH``.

------------
Installation
------------

You don't need to install Spack; it's ready to run as soon as you
clone it from git.

You may want to run it out of a prefix other than the git repository
you cloned.  The ``spack bootstrap`` command provides this
functionality.  To install spack in a new directory, simply type:

.. code-block:: console

   $ spack bootstrap /my/favorite/prefix

This will install a new spack script in ``/my/favorite/prefix/bin``,
which you can use just like you would the regular spack script.  Each
copy of spack installs packages into its own ``$PREFIX/opt``
directory.