Skip to content

Commit 28308f3

Browse files
committed
Update docs, fix bug with creating environment in docker
1 parent 705fbb4 commit 28308f3

10 files changed

+39
-218
lines changed

docs/build_guide/include/appendecies/custom_spack_install_notes.rst.inc

-2
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,3 @@ Building Spheral TPLs with your own Spack installation will require deeper knowl
55

66
- Point your spack instances `repo <https://spack.readthedocs.io/en/latest/repositories.html?highlight=repo#spack-repo>`_ at the ``scripts/spack/packages/`` dir. This contains all of our changes to spack packages that have not yet made it to upstream Spack.
77
- You will want to model your ``compiler.yaml`` and ``packages.yaml`` files off of those found in ``scripts/spack/configs/`` (`Spack Configuration Files <https://spack.readthedocs.io/en/latest/configuration.html#configuration>`_).
8-
9-
Further notes on setting up Spack and how it is used with the Spheral dev-tools scripts can be found in `Development Documentation: Spheral Spack / Uberenv <Development_Documentation.html#spheral-spack-uberenv>`_.

docs/build_guide/include/cloning.rst.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
----------------------------------------
44

55
[git_clone-section-start]
6-
If you use git to clone the Spheral source be aware Spheral includes git submodules: `BLT <https://github.com/LLNL/blt>`_ and `Uberenv <https://github.com/LLNL/uberenv>`_. In order to ensure such submodules are properly downloaded when cloning Spheral be sure to use the ``--recursive`` git option:
6+
If you use git to clone the Spheral source be aware Spheral includes the `BLT <https://github.com/LLNL/blt>`_ git submodule. In order to ensure such submodules are properly downloaded when cloning Spheral be sure to use the ``--recursive`` git option:
77

88
::
99

docs/build_guide/include/configure.rst.inc

+5-10
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Configuring Spheral
88

99
After running ``tpl-manager`` you will see a file in your Spheral root directory following the format ``<sys_type>-<spec>.cmake``.
1010

11-
For example if you run ``tpl-manager`` with only a single ``--spec`` e.g. ``gcc~mpi``, you will only see:
11+
For example if you run ``tpl-manager`` with only a single ``--spec`` e.g. ``spheral%gcc~mpi``, you will only see:
1212

1313
::
1414

@@ -22,19 +22,14 @@ Configuring Spheral
2222

2323
After running ``tpl-manager`` you will see a file in your Spheral root directory following the format ``<sys_type>-<spec>.cmake``.
2424

25-
For example if you run ``tpl-manager`` with ``spec-list.json`` on a ``toss_3_x86_64_ib`` system you will see:
25+
For example if you run ``tpl-manager`` on a ``toss_4_x86_64_ib`` system with ``--spec spheral%clang+mpi``, you will see:
2626

2727
::
2828

29-
toss_3_x86_64_ib-clang@9.0.0.cmake
30-
toss_3_x86_64_ib-gcc@8.1.0.cmake
31-
toss_3_x86_64_ib-gcc@8.3.1.cmake
29+
toss_4_x86_64_ib-clang@9.0.0.cmake
3230

33-
However if you ran ``tpl-manager`` with only a single ``--spec`` e.g. ``[email protected]~mpi``, you will only see:
34-
35-
::
36-
37-
toss_3_x86_64_ib-gcc@8.1.0~mpi.cmake
31+
If no ``--spec`` is provided to ``tpl-manager``, the TPLs for all specs in an environment will be built, but no host config file will be generated.
32+
A ``--spec`` must be provided to generate a host config file.
3833

3934
[lc_intro-end]
4035

docs/build_guide/include/quickstart.rst.inc

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Create a directory structure and clone spheral.
3636
Build our TPL dependencies from source with the Spheral tpl-management tool (``tpl-manager.py``).
3737
::
3838

39-
python3 scripts/devtools/tpl-manager.py --spec gcc
39+
python3 scripts/devtools/tpl-manager.py --spec spheral%gcc+mpi
4040

4141
.. note::
4242
This command sequence assumes ``gcc`` is installed and will use the version in your system path. If you wish to use a different compiler (such as ``clang``) ensure it is in your path and replace ``gcc`` with the compiler name of your choice (e.g. ``clang``).
@@ -56,7 +56,7 @@ Build our TPL dependencies from source with the Spheral tpl-management tool (``t
5656
Build our TPL dependencies from source with the Spheral tpl-management tool (``tpl-manager.py``).
5757
::
5858

59-
./scripts/devtools/tpl-manager.py --spec [email protected]
59+
./scripts/devtools/tpl-manager.py --spec spheral%[email protected]+mpi
6060

6161
.. warning::
6262
This command needs to be run under an allocation as any TPLs that need to be built will be built in parallel.

docs/build_guide/include/tpls.rst.inc

+18-43
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Spheral provides a tool (``tpl-manager.py``) in an attempt to simplify the spack
1717
- Set up a local ``Spack`` instance for Spheral.
1818
- Generate a dependency tree of third party libraries (relative to the provided configuration).
1919
- Build and install all dependent libraries in the local ``Spack`` instance.
20-
- Generate a `CMake host-config <https://llnl-blt.readthedocs.io/en/develop/tutorial/host_configs.html>`_ file for configuring Spheral builds.
20+
- Generate a `CMake host-config <https://llnl-blt.readthedocs.io/en/develop/tutorial/host_configs.html>`_ file for configuring Spheral builds (if a spec is given).
2121

2222
``tpl-manager`` is located at ``scripts/devtools/tpl-manager.py``. ``tpl-manager`` can be used in two ways:
2323

@@ -29,7 +29,7 @@ Spheral provides a tool (``tpl-manager.py``) in an attempt to simplify the spack
2929
[ex_tpl_manager_notes-start]
3030

3131
.. note:
32-
The External User Guide does not cover building the full range of tpl configurations. Please see the LC User Guide for more informtaion.
32+
The External User Guide does not cover building the full range of tpl configurations. Please see the LC User Guide for more information.
3333

3434
[ex_tpl_manager_notes-end]
3535
[lc_tpl_manager_notes-start]
@@ -47,56 +47,31 @@ Running tpl-manager
4747

4848
``tpl-manager`` requires ``python3`` and should be run from the root Spheral directory.
4949

50-
``tpl-manager`` takes a ``--spec`` argument to determine what compiler to use and what configuration we want to build Spheral in.
51-
52-
::
53-
54-
python3 scripts/devtools/tpl-manager.py --spec gcc
50+
``tpl-manager`` takes a ``--spec`` argument to determine what compiler to use and what configuration we want to build Spheral in. For example,
5551

56-
This will install the local Spheral Spack instance into the adjacent directory of your Spheral root dir. You can use ``--spheral-spack-dir`` if you would like to setup the spack instance somewhere else.
57-
58-
Above we are telling ``tpl-manager`` to build our TPLs with the ``gcc`` that is in our path. By default this will build with ``+mpi`` support, however we can disable ``mpi`` support for the TPLs and Spheral by appending ``~mpi`` to our spec.
5952
::
6053

61-
python3 scripts/devtools/tpl-manager.py --spec gcc~mpi
62-
63-
.. note::
64-
By default we have ``python`` bindings enabled (``+python``) and docs disabled (``~docs``). Therefore the spec ``gcc+mpi+python~docs`` will build the same TPL set as just ``gcc``.For more information on ``spec`` syntax please see the spack documentation on `specs-dependencies <https://spack.readthedocs.io/en/latest/basic_usage.html#specs-dependencies>`_.
54+
python3 scripts/devtools/tpl-manager.py --spec spheral%gcc
6555

66-
.. note::
67-
Spheral minimally requires a C++14 compliant compiler.
56+
This will download a new Spack instance in a directory adjacent to your Spheral root directory called ``spheral-spack-tpls/spack``. You can use ``--spack-dir`` if you would like to setup the Spack instance somewhere else. By default, Spheral is built with MPI support unless the spec is appended with ``~mpi``. The ``%`` symbol denotes the compiler to use.
6857

69-
ERROR: invalid spack config dir
70-
===============================
58+
When run for the first time, ``tpl-manager`` will do a few things:
7159

72-
If you are trying to run ``tpl-manager.py`` on an operating system other than Ubuntu20.04, you will
73-
see an error to the effect of:
74-
``[ERROR: invalid spack config dir: /<path>/scripts/spack/configs/<OperatingSystem><Version> ]``
60+
#. Create and activate a Spack environment in ``spheral/scripts/spack/environments`` based on the output of ``spack arch``. All subsequent Spack commands will modify this environment by adding specs, compilers, and external packages to it.
7561

76-
We define configuration files for Ubuntu20.04, as well as our common LLNL operating systems.
77-
You will need to create a set of files for your own system.
62+
#. Run ``spack compiler find`` to find system compilers. Spack searches the ``$PATH`` environment variable for compilers and packages. Add any paths to ``$PATH`` to ensure Spack will find them before running the ``tpl-manager``.
7863

79-
The configuration files tell spack where the packages installed in :ref:`Required System Packages`
80-
are located and what version they are. We have provided a ``generic`` set of config files to
81-
help in setting this up for you.
64+
#. Run ``spack external find --not-buildable`` It will run Spack commands to try to find existing system installs for things like CMake, Git, Python, and MPICH (when the spec has ``+mpi``).
8265

83-
#. Copy the directory ``scripts/spack/configs/generic`` to ``scripts/spack/config/<OperatingSystem><Version>`` (you want to match the name of the directory to the one ``tpl-manager.py`` expects to find).
66+
#. Add the current spec to the environment with ``spack add <spec>`` and concretize using ``spack concretize -U``.
8467

68+
#. Install the TPLs and create the host config file for the given spec with ``spack install -u initconfig <spec>``.
8569

86-
#. For each package within the ``packages.py`` file of your new folder edit the version number to be the same as
87-
what is installed on your system. There are a number of ways to retrieve versions for a given package:
88-
89-
* Most version numbers should be searchable through your package manager, there are however, some system libraries that may not be managed by your package manager.
90-
91-
* If the package has an executable, often you can run with some form of ``-V`` or ``--version``. e.g. for mpich:``mpiexec --version`` will report the MPI version.
92-
93-
* For packages that only provide libraries, often the system library will be symlinked to one with the version as the extension. e.g. ``ls -lha /usr/lib/x86_64_gnu-linux/libreadlines.so`` will show it is symlinked to ``libreadlines.so.8.1``.
94-
95-
96-
#. Each package requires the ``prefix:`` of the installation be provided. In most cases ``/usr`` is sufficient. Typically packages installed with a package manager will place files in: ``/usr/bin``, ``/usr/share``, ``/usr/lib``, ``/usr/lib64``, sometimes ``/usr/lib/x86_64.../``. Here the common prefix is ``/usr``.
97-
98-
* If you are building Spheral on a system where you don't have permissions to run package manager and install to ``/usr``, then you might have installed the system packages somewhere else. In that case, replace the ``prefix:`` path for those given packages as necessary.
70+
.. note::
71+
By default we have ``python`` bindings enabled (``+python``) and docs disabled (``~docs``). Therefore the spec ``spheral%gcc+mpi+python~docs`` will build the same TPL set as just ``spheral%gcc``.For more information on ``spec`` syntax please see the spack documentation on `specs-dependencies <https://spack.readthedocs.io/en/latest/basic_usage.html#specs-dependencies>`_.
9972

73+
.. note::
74+
Spheral minimally requires a C++14 compliant compiler.
10075

10176
[ex_running_tpl_manager-end]
10277

@@ -110,9 +85,9 @@ Running tpl-manager
11085

11186
::
11287

113-
./scripts/devtools/tpl-manager.py --spec [email protected]
88+
./scripts/devtools/tpl-manager.py --spec spheral%[email protected]
11489

115-
This will install the local Spheral Spack instance into the adjacent directory of your Spheral root dir. You can use ``--spheral-spack-dir`` if you would like to setup the spack instance somewhere else.
90+
This will install the local Spheral Spack instance into the adjacent directory of your Spheral root dir. You can use ``--spack-dir`` if you would like to setup the spack instance somewhere else.
11691

11792
.. warning::
11893
If running on LC be sure to launch ``tpl-manager`` in a resource allocation, as ``tpl-manager`` will take advantage of parallel builds when compiling libraries. An example appropriate for use on rzgenie would be::
@@ -135,7 +110,7 @@ CUDA Support
135110

136111
To build Spheral TPLs and configure Spheral to build with CUDA on LC systems we need to add the spack variant ``+cuda`` to our spec. We also need to define the cuda hardware architecture we are targetting Spheral to run on. This can be done with ``cuda_arch=XX``. On most LC NVIDIA systems we will be targetting ``sm_70`` architecture. Therefore a gcc spec with cuda support will look as such.::
137112

138-
./scripts/devtools/tpl-manager.py --spec "[email protected]+cuda cuda_arch=70"
113+
./scripts/devtools/tpl-manager.py --spec "spheral%[email protected]+cuda cuda_arch=70"
139114

140115
.. note::
141116
We need to use "" here as spack requires spacing to define ``cuda_arch``. This ensures tpl-manager doesn't register the spec as separate arguments.

docs/build_guide/include/updating.rst.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
----------------------------------------
44

55
[git_update-section-start]
6-
When you want/need to update an existing clone of the Spheral GitHub repository, you need to be aware Spheral includes git submodules: `BLT <https://github.com/LLNL/blt>`_ and `Uberenv <https://github.com/LLNL/uberenv>`_. In order to ensure such submodules are properly updated you should update using the following git commands:
6+
When you want/need to update an existing clone of the Spheral GitHub repository, you need to be aware Spheral includes the `BLT <https://github.com/LLNL/blt>`_ git submodule. In order to ensure such submodules are properly updated you should update using the following git commands:
77

88
::
99

docs/developer/design/spack_uberenv_design.rst

-145
This file was deleted.

docs/developer/design_docs.rst

-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ Welcome to Spheral's design documentation. This documentation is a work in progr
88
:maxdepth: 1
99

1010
design/python_module_install.rst
11-
design/spack_uberenv_design.rst
1211

1312

docs/developer/dev/submodules.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Submodules
22
##########
33

4-
Spheral uses submodules to rbing other codes/project directly into our source tree, such as BLT, and Uberenv. This guide explains some of the common practices one might want to perform with submodules during Spheral development.
4+
Spheral uses submodules to rbing other codes/project directly into our source tree, such as BLT, and PYB11Generator. This guide explains some of the common practices one might want to perform with submodules during Spheral development.
55

66
.. _update_local_submodules:
77

0 commit comments

Comments
 (0)