Skip to content

Commit

Permalink
Deploy preview for PR 995 🛫
Browse files Browse the repository at this point in the history
  • Loading branch information
dominichofer committed Sep 6, 2024
1 parent 729b380 commit b3394ff
Show file tree
Hide file tree
Showing 75 changed files with 8,702 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pr-preview/pr-995/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: f6db92028f33311ee95b17fa21cd92e0
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added pr-preview/pr-995/.doctrees/QuickStart.doctree
Binary file not shown.
Binary file added pr-preview/pr-995/.doctrees/SpackChoice.doctree
Binary file not shown.
Binary file added pr-preview/pr-995/.doctrees/SpackCommands.doctree
Binary file not shown.
Binary file added pr-preview/pr-995/.doctrees/Testing.doctree
Binary file not shown.
Binary file not shown.
Binary file added pr-preview/pr-995/.doctrees/environment.pickle
Binary file not shown.
Binary file added pr-preview/pr-995/.doctrees/index.doctree
Binary file not shown.
264 changes: 264 additions & 0 deletions pr-preview/pr-995/C2SMGuidelines.html

Large diffs are not rendered by default.

205 changes: 205 additions & 0 deletions pr-preview/pr-995/CodeDevelopment.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Develop packages &mdash; C2SM Spack documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=80d5e7a1" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=19f00094" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />


<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->

<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=5929fcd5"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/clipboard.min.js?v=a7894cd8"></script>
<script src="_static/copybutton.js?v=a5fa425f"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Target Users of spack-c2sm" href="SpackChoice.html" />
<link rel="prev" title="Upstream management" href="UpstreamManagement.html" />
</head>

<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >



<a href="index.html" class="icon icon-home">
C2SM Spack
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="QuickStart.html">Quick Start</a></li>
<li class="toctree-l1"><a class="reference internal" href="C2SMGuidelines.html">C2SM Guidelines for Spack</a></li>
<li class="toctree-l1"><a class="reference internal" href="InstanceManagement.html">How to manage your own Spack instance</a></li>
<li class="toctree-l1"><a class="reference internal" href="SpackCommands.html">Important Spack Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Testing.html">Testing</a></li>
<li class="toctree-l1"><a class="reference internal" href="UpstreamManagement.html">Upstream management</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Develop packages</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#plain-dev-build">Plain dev-build</a></li>
<li class="toctree-l2"><a class="reference internal" href="#dev-build-in-combination-with-build-env">Dev-build in combination with build-env</a></li>
<li class="toctree-l2"><a class="reference internal" href="#environments-with-spack-develop">Environments with Spack develop</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="SpackChoice.html">Target Users of spack-c2sm</a></li>
<li class="toctree-l1"><a class="reference internal" href="SpackChoice.html#why-was-spack-chosen-by-meteoswiss">Why was Spack chosen by MeteoSwiss?</a></li>
</ul>

</div>
</div>
</nav>

<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">C2SM Spack</a>
</nav>

<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Develop packages</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/CodeDevelopment.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">

<section id="develop-packages">
<h1>Develop packages<a class="headerlink" href="#develop-packages" title="Link to this heading"></a></h1>
<p>Spack offers several options for package development.
Depending on your workflow, one or the other option is preferred.
Also some packages like ICON or COSMO have their own
development workflow which is maintained by C2SM.</p>
<section id="plain-dev-build">
<h2>Plain dev-build<a class="headerlink" href="#plain-dev-build" title="Link to this heading"></a></h2>
<p>This is the easiest way to build local sources.
Enter the root of your source repository and execute:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>spack<span class="w"> </span>dev-build<span class="w"> </span>--until<span class="w"> </span>build<span class="w"> </span>&lt;package&gt;<span class="w"> </span>@&lt;version&gt;
</pre></div>
</div>
<p>This will build the package as is. The downside of this approach is that
you need to go through all phases of a package build.</p>
</section>
<section id="dev-build-in-combination-with-build-env">
<h2>Dev-build in combination with build-env<a class="headerlink" href="#dev-build-in-combination-with-build-env" title="Link to this heading"></a></h2>
<p>We assume that developers of a package are familiar with its build system.
Therefore, we reccomend to use Spack to set up the environment for the package.
Building and testing should be done with the package’s build and test system.</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp"># </span>Load<span class="w"> </span>Spack!
<span class="gp">$ </span>spack<span class="w"> </span>dev-build<span class="w"> </span>--before<span class="w"> </span>build<span class="w"> </span>&lt;package&gt;<span class="w"> </span>@develop<span class="w"> </span>&lt;variant&gt;<span class="w"> </span><span class="c1"># stops dev-build before executing the phase &#39;build&#39;</span>
<span class="gp">$ </span>spack<span class="w"> </span>build-env<span class="w"> </span>&lt;package&gt;<span class="w"> </span>@develop<span class="w"> </span>&lt;variant&gt;<span class="w"> </span>--<span class="w"> </span>bash<span class="w"> </span><span class="c1"># nests a bash shell with the build env vars loaded</span>
<span class="gp"># </span>Work<span class="w"> </span>on<span class="w"> </span>the<span class="w"> </span>package!
<span class="gp"># </span>Use<span class="w"> </span>the<span class="w"> </span>build<span class="w"> </span>system<span class="w"> </span>of<span class="w"> </span>the<span class="w"> </span>package!<span class="w"> </span><span class="o">(</span>e.g.<span class="w"> </span><span class="s1">&#39;make&#39;</span><span class="o">)</span>
<span class="gp"># </span>Use<span class="w"> </span>the<span class="w"> </span>testing<span class="w"> </span>infrastructure<span class="w"> </span>of<span class="w"> </span>the<span class="w"> </span>package!
<span class="gp">$ </span><span class="nb">exit</span><span class="w"> </span><span class="c1"># to exit the nested bash</span>
</pre></div>
</div>
<p>If you want multiple dev-builds at the same time, label them with separate <code class="docutils literal notranslate"><span class="pre">&#64;&lt;your-label&gt;</span></code>.
The identifier <code class="docutils literal notranslate"><span class="pre">&#64;develop</span></code> is common in the Spack documentation but you can use any string.</p>
</section>
<section id="environments-with-spack-develop">
<h2>Environments with Spack develop<a class="headerlink" href="#environments-with-spack-develop" title="Link to this heading"></a></h2>
<p>Environments sit in a folder with a name and are defined in a <code class="docutils literal notranslate"><span class="pre">spack.yaml</span></code> file.
For more information about environments in general, consider reading the
<a class="reference external" href="https://spack.readthedocs.io/en/latest/environments.html">official Spack docs</a>.</p>
<div class="literal-block-wrapper docutils container" id="id1">
<div class="code-block-caption"><span class="caption-text">Example environment for ICON</span><a class="headerlink" href="#id1" title="Link to this code"></a></div>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="c1"># This is a Spack Environment file.</span>
<span class="c1">#</span>
<span class="c1"># It describes a set of packages to be installed, along with</span>
<span class="c1"># configuration settings.</span>
<span class="nt">spack</span><span class="p">:</span>
<span class="w"> </span><span class="c1"># add package specs to the `specs` list</span>
<span class="w"> </span><span class="nt">specs</span><span class="p">:</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">icon@develop%nvhpc +ecrad +rte-rrtmgp +cuda</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">[email protected]%nvhpc</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">nvidia-blas%nvhpc</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">nvidia-lapack%nvhpc</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">[email protected]%gcc</span>
<span class="w"> </span><span class="nt">view</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
<span class="w"> </span><span class="nt">concretizer</span><span class="p">:</span>
<span class="w"> </span><span class="nt">unify</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
<span class="w"> </span><span class="nt">develop</span><span class="p">:</span>
<span class="w"> </span><span class="nt">icon</span><span class="p">:</span>
<span class="w"> </span><span class="nt">spec</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">icon@develop%nvhpc +ecrad +rte-rrtmgp +cuda</span>
<span class="w"> </span><span class="nt">path</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">../../../../</span>
</pre></div>
</div>
</div>
<p>The key part of the environments is the <code class="docutils literal notranslate"><span class="pre">develop</span></code> keyword.
This tells Spack to look for a certain spec in <code class="docutils literal notranslate"><span class="pre">path</span></code>.
It is possible to specify multiple packages under <code class="docutils literal notranslate"><span class="pre">develop</span></code>.</p>
<p>To activate a Spack environment, type</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>spack<span class="w"> </span>env<span class="w"> </span>activate<span class="w"> </span>&lt;path_to_folder_with_spack_yaml&gt;
</pre></div>
</div>
<p>To install the environment, type</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>spack<span class="w"> </span>install
</pre></div>
</div>
<p>To deactivate a Spack environment, type</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>spack<span class="w"> </span>env<span class="w"> </span>deactivate
</pre></div>
</div>
<p>Most of the Spack commands are sensitive to environments, see
<a class="reference external" href="https://spack.readthedocs.io/en/latest/environments.html#environment-sensitive-commands">Spack docs</a>.</p>
</section>
</section>


</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="UpstreamManagement.html" class="btn btn-neutral float-left" title="Upstream management" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="SpackChoice.html" class="btn btn-neutral float-right" title="Target Users of spack-c2sm" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>

<hr/>

<div role="contentinfo">
<p>&#169; Copyright 2020-2024, C2SM.</p>
</div>

Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.


</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>

</body>
</html>
Loading

0 comments on commit b3394ff

Please sign in to comment.