-
Notifications
You must be signed in to change notification settings - Fork 35
Build docs reorg #1519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Build docs reorg #1519
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
1e5c955
first cut at deunifying build instructions
white238 f3a0e42
fix links and cleanup start of macos page
white238 df3187c
fix toc
white238 3b7582d
fix list
white238 9796746
slight tweak
white238 a09400c
fix toc?
white238 6e21282
fix tags
white238 ca64a2a
unhide toc
white238 bc8292f
dont ask
white238 d8bbc50
clean up build guide index
white238 1eb598e
small tweak
white238 92c7e51
more consistent naming and labels
white238 45e974a
more labels
white238 0d60802
move for labels
white238 9ff9256
add more basic structure
white238 b89760a
another crack at the structure
white238 b27c597
add index
white238 c1b2f0a
try renaming the section to not conflict
white238 e246eb4
try removing inner toctree
white238 a5d1403
try something
white238 017855e
limit titles on build guide
white238 7b5b759
try updating sphinx
white238 54790d0
remove quickstart
white238 c5fbac6
fix now broken labels
white238 9c33c0d
clean up entry page
white238 154afb5
add section on host-configs
white238 865cb47
cleanup ubuntu instructions
white238 ed8f0c4
more docs
white238 dff1126
bold it
white238 a10e3da
flush out variants
white238 87108e9
clean sentence
white238 7e9e432
document config build
white238 a74f340
expand build smith docs
white238 228646f
fix numbering
white238 6e88a1d
add example cmake commands
white238 ec94f87
Update src/docs/sphinx/build_guide/build_tpls.rst
white238 bacc620
Update src/docs/sphinx/build_guide/build_smith.rst
white238 f59698b
clarify docs
white238 348be41
clarified and moved to top of documentation
white238 eea8daf
Update src/docs/sphinx/build_guide/build_tpls.rst
white238 95eacdd
Update src/docs/sphinx/build_guide/index.rst
white238 fa51f1b
Update src/docs/sphinx/build_guide/setup_system/setup_macos.rst
white238 51342cf
address comments
white238 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| docutils | ||
| sphinx==6.2.1 | ||
| sphinx-rtd-theme==1.2.2 | ||
| sphinx==8.2.3 | ||
| sphinx-rtd-theme |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,253 @@ | ||
| .. ## Copyright (c) Lawrence Livermore National Security, LLC and | ||
| .. ## other Smith Project Developers. See the top-level COPYRIGHT file for details. | ||
| .. ## | ||
| .. ## SPDX-License-Identifier: (BSD-3-Clause) | ||
|
|
||
| .. _build_smith-label: | ||
|
|
||
| ========================= | ||
| Building Smith with CMake | ||
| ========================= | ||
|
|
||
| Smith uses CMake as its build system. Due to our amount of | ||
| Third-party Libraries (TPLs) and configuration options, we recommend | ||
| utilizing a :ref:`host-config <host_config-label>` to encapsulate most | ||
| of the build information necessary to build Smith. | ||
|
|
||
| If you built the dependencies using Spack/uberenv, the host-config file is output at the | ||
| project root. If you are on LC and a member of the ``smithdev`` group, you can use | ||
| our provided host-configs in the ``host-config`` directory that follow the pattern | ||
| ``<machine_name>-<SYS_TYPE>-<compiler>.cmake``. Contact `Brandon Talamini <talamini1@llnl.gov>`_ for access. | ||
|
|
||
| We provide a python script that encapsulates the CMake configuration step | ||
| but you can also use the CMake executable directly. Below are instructions | ||
| for both. | ||
|
|
||
|
|
||
| Option 1: Configuring the build with ``config-build.py`` | ||
| -------------------------------------------------------- | ||
|
|
||
| ``config-build.py`` is a python script that is aimed at simplifying and hardening | ||
| running CMake. It creates a build and install directory then runs the necessary | ||
| CMake command for you. You just need to point the script | ||
| at the generated or a provided host-config. | ||
|
|
||
| ``config-build.py`` has some command line options it understand to simplify the | ||
| build, they are listed in the table below. Any extra options will be passed directly | ||
| to CMake. Here are some examples on how to run ``config-build.py``: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| # Just a host-config | ||
| $ ./config-build.py -hc /path/to/host-config.cmake | ||
|
|
||
| # host-config + debug build | ||
| $ ./config-build.py -hc /path/to/host-config.cmake -bt Debug | ||
|
|
||
| # host-config + CMake options | ||
| $ ./config-build.py -hc /path/to/host-config.cmake -DENABLE_WARNINGS_AS_ERRORS=OFF | ||
|
|
||
|
|
||
| .. important:: | ||
|
|
||
| ``config-build.py`` automatically deletes the build and install directories. | ||
| Do **not** store any files in these directories that you wish to keep. These | ||
| directories should be treated as **temporary**, as their contents may | ||
| be removed at any time during the build process. | ||
|
|
||
|
|
||
| .. list-table:: ``config-build.py`` command-line options | ||
| :header-rows: 1 | ||
| :widths: 18 28 14 60 | ||
|
|
||
| * - Short Option | ||
| - Long Option | ||
| - Default | ||
| - Description | ||
|
|
||
| * - ``-bp`` | ||
| - ``--buildpath`` | ||
| - ``""`` | ||
| - Specify path for the build directory. If not specified, it will be created | ||
| in the current directory. | ||
|
|
||
| * - ``-ip`` | ||
| - ``--installpath`` | ||
| - ``""`` | ||
| - Specify path for the install directory. If not specified, it will be created | ||
| in the current directory. | ||
|
|
||
| * - ``-bt`` | ||
| - ``--buildtype`` | ||
| - ``Release`` | ||
| - Specify the CMake build type. Valid options are ``Release``, ``Debug``, | ||
| ``RelWithDebInfo``, and ``MinSizeRel``. | ||
|
|
||
| * - ``-e`` | ||
| - ``--eclipse`` | ||
| - ``False`` | ||
| - Create an Eclipse project file. | ||
|
|
||
| * - ``-ecc`` | ||
| - ``--exportcompilercommands`` | ||
| - ``False`` | ||
| - Generate a compilation database (``compile_commands.json``) in the build | ||
| directory. Can be used by Clang tools such as ``clang-modernize``. | ||
|
|
||
| * - ``-hc`` | ||
| - ``--hostconfig`` | ||
| - ``""`` | ||
| - Select a specific host-config file to initialize CMake’s cache. | ||
|
|
||
| * - *(none)* | ||
| - ``--print-default-host-config`` | ||
| - ``False`` | ||
| - Print the default host configuration for this system and exit. | ||
|
|
||
| * - *(none)* | ||
| - ``--print-machine-name`` | ||
| - ``False`` | ||
| - Print the machine name for this system and exit. | ||
|
|
||
| * - ``-n`` | ||
| - ``--ninja`` | ||
| - ``False`` | ||
| - Use the Ninja generator instead of Make to build the project. | ||
|
|
||
|
|
||
| Option 2: Configuring the build with CMake | ||
| ------------------------------------------ | ||
|
|
||
| Another option is to use CMake directly, this can also be useful if you configure VSCode | ||
| to build Smith. | ||
|
|
||
| Here are some examples on how to run CMake: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| # Just a host-config with build and install directories | ||
| $ cmake -C /path/to/host-config.cmake -B build -DCMAKE_INSTALL_PREFIX=/path/to/install | ||
|
|
||
| # host-config + debug build | ||
| $ cmake -C /path/to/host-config.cmake -DCMAKE_BUILD_TYPE=Debug | ||
|
|
||
| # host-config + CMake options | ||
| $ cmake -C /path/to/host-config.cmake -DENABLE_WARNINGS_AS_ERRORS=OFF | ||
|
|
||
|
|
||
| .. list-table:: CMake configuration options | ||
| :header-rows: 1 | ||
| :widths: 35 15 60 | ||
|
|
||
| * - Option | ||
| - Default | ||
| - Description | ||
|
|
||
| * - ``CMAKE_BUILD_TYPE`` | ||
| - ``Release`` | ||
| - Specifies the build type, see the `CMake docs <https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html>`_ | ||
white238 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| * - ``ENABLE_WARNINGS_AS_ERRORS`` | ||
| - ``ON`` | ||
| - Turns compiler warnings into errors. | ||
|
|
||
| * - ``ENABLE_ASAN`` | ||
| - ``OFF`` | ||
| - Enable AddressSanitizer for memory checking. Supported only with | ||
| Clang or GCC; configuration will fail for other compilers. | ||
|
|
||
| * - ``SMITH_ENABLE_CODEVELOP`` | ||
| - ``OFF`` | ||
| - Enable Smith’s *codevelop* build, including MFEM and Axom as CMake | ||
| subdirectories. | ||
|
|
||
| * - ``SMITH_ENABLE_CODE_CHECKS`` | ||
| - ``ON`` | ||
| - Enable Smith’s code checks. | ||
|
|
||
| * - ``SMITH_ENABLE_TESTS`` | ||
| - ``ON`` | ||
| - Enable Smith test builds. This option is only effective when | ||
| ``ENABLE_TESTS`` is ``ON``. | ||
|
|
||
| * - ``SMITH_ENABLE_CUDA`` | ||
| - ``ON`` | ||
| - Enable Smith with CUDA support. This option is only effective when | ||
| ``ENABLE_CUDA`` is ``ON``. | ||
|
|
||
| * - ``SMITH_ENABLE_HIP`` | ||
| - ``ON`` | ||
| - Enable Smith with HIP support. This option is only effective when | ||
| ``ENABLE_HIP`` is ``ON``. | ||
|
|
||
| * - ``SMITH_ENABLE_OPENMP`` | ||
| - ``ON`` | ||
| - Enable Smith with OpenMP support. This option is only effective when | ||
| ``ENABLE_OPENMP`` is ``ON``. | ||
|
|
||
| * - ``SMITH_ENABLE_GRETL`` | ||
| - ``ON`` | ||
| - Enable Smith with Gretl support. | ||
|
|
||
| * - ``SMITH_ENABLE_CONTINUATION`` | ||
| - ``ON`` | ||
| - Enable the Continuation Solver. This option is automatically forced | ||
| to ``OFF`` when either ``SMITH_ENABLE_CUDA`` or ``SMITH_ENABLE_HIP`` | ||
| is enabled, as GPU builds are currently unsupported. | ||
|
|
||
| * - ``SMITH_ENABLE_PROFILING`` | ||
| - ``OFF`` | ||
| - Enable profiling functionality. This option is automatically enabled | ||
| when benchmarking is enabled unless explicitly set by the user. | ||
|
|
||
| * - ``ENABLE_BENCHMARKS`` | ||
| - ``OFF`` | ||
| - Enables Google Benchmark performance tests. | ||
|
|
||
| * - ``SMITH_ENABLE_BENCHMARKS`` | ||
| - ``ON`` | ||
| - Enable Smith benchmark executables. This option is only effective | ||
| when ``ENABLE_BENCHMARKS`` is ``ON``. Benchmarking requires | ||
| ``SMITH_ENABLE_PROFILING`` to be enabled; otherwise configuration | ||
| will fail. | ||
|
|
||
| * - ``SMITH_USE_VDIM_ORDERING`` | ||
| - ``ON`` | ||
| - Use ``mfem::Ordering::byVDIM`` for degree-of-freedom vectors, which | ||
| is typically faster for algebraic multigrid. When disabled, | ||
| ``byNODES`` ordering is used instead. | ||
|
|
||
|
|
||
| Build | ||
| ----- | ||
|
|
||
| Once the build has been configured, Smith can be built with one of the following commands: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| # Makefile | ||
| $ cd <build directory> | ||
| $ make -j16 | ||
|
|
||
| # Ninja | ||
| $ cd <build directory> | ||
| $ ninja -j16 | ||
|
|
||
| # CMake | ||
| $ cmake --build build -- -j16 | ||
|
|
||
|
|
||
| We provide the following useful build targets that can be run from the build directory: | ||
|
|
||
| * ``test``: Runs our unit tests | ||
| * ``docs``: Builds our documentation to the following locations: | ||
|
|
||
| * Sphinx: ``build-*/src/docs/html/index.html`` | ||
| * Doxygen: ``/build-*/src/docs/html/doxygen/html/index.html`` | ||
|
|
||
| * ``style``: Runs styling over source code and replaces files in place | ||
| * ``check``: Runs a set of code checks over source code (CppCheck and clang-format) | ||
| * ``install``: Installs Smith into the previously given ``CMAKE_INSTALL_PREFIX`` directory | ||
|
|
||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This page looks great!