Skip to content

Commit 4e54cad

Browse files
authored
Update line highlighting (#314)
1 parent 0d90182 commit 4e54cad

6 files changed

Lines changed: 22 additions & 74 deletions

File tree

tutorial/examples/Cmake/2.package.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def cmake_args(self):
2626
args = ["-DCALLPATH_WALKER=dyninst"]
2727

2828
if self.spec.satisfies("^dyninst@9.3.0:"):
29-
std.flag = self.compiler.cxx_flag
29+
std_flag = self.compiler.cxx_flag
3030
args.append("-DCMAKE_CXX_FLAGS='{0}' -fpermissive'".format(
3131
std_flag))
3232

tutorial_buildsystems.rst

Lines changed: 9 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ This will open the :code:`AutotoolsPackage` file in your text editor.
111111

112112

113113
.. literalinclude:: _spack_root/lib/spack/spack/build_systems/autotools.py
114-
:emphasize-lines: 2,4,22-31
115-
:lines: 140-160,597-615
114+
:emphasize-lines: 2,4,28-37
115+
:lines: 138-158,589-617
116116
:linenos:
117117

118118

@@ -210,8 +210,8 @@ Take note of the following:
210210

211211
.. literalinclude:: _spack_root/lib/spack/spack/build_systems/makefile.py
212212
:language: python
213-
:emphasize-lines: 61,65,70
214-
:lines: 35-109
213+
:emphasize-lines: 60,64,69
214+
:lines: 40-111
215215
:linenos:
216216

217217
Similar to :code:`Autotools`, :code:`MakefilePackage` class has properties
@@ -497,8 +497,8 @@ Let's look at these defaults in the :code:`CMakePackage` class in the :code:`_st
497497
498498
.. literalinclude:: _spack_root/lib/spack/spack/build_systems/cmake.py
499499
:language: python
500-
:lines: 217-271
501-
:emphasize-lines: 5,14
500+
:lines: 167-300
501+
:emphasize-lines: 87,96
502502
:linenos:
503503

504504
Some :code:`CMake` packages use different generators. Spack is able to support
@@ -639,68 +639,18 @@ so we override the :code:`install()` method to do it for us:
639639
PythonPackage
640640
--------------
641641

642-
Python extensions and modules are built differently from source than most
643-
applications. Python uses a :code:`setup.py` script to install Python modules.
644-
The script consists of a call to :code:`setup()` which provides the information
645-
required to build a module to Distutils. If you're familiar with pip or
646-
easy_install, setup.py does the same thing.
647-
642+
Python extensions and modules are built differently from source than most applications.
648643
These modules are usually installed using the following line:
649644

650645
.. code-block:: console
651646
652-
$ python setup.py install
653-
654-
There are also a list of commands and phases that you can call. To see the full
655-
list you can run:
656-
657-
.. code-block:: console
658-
659-
$ python setup.py --help-commands
660-
Standard commands:
661-
build build everything needed to install
662-
build_py "build" pure Python modules (copy to build directory)
663-
build_ext build C/C++ extensions (compile/link to build directory)
664-
build_clib build C/C++ libraries used by Python extensions
665-
build_scripts "build" scripts (copy and fixup #! line)
666-
clean (no description available)
667-
install install everything from build directory
668-
install_lib install all Python modules (extensions and pure Python)
669-
install_headers install C/C++ header files
670-
install_scripts install scripts (Python or otherwise)
671-
install_data install data files
672-
sdist create a source distribution (tarball, zip file, etc.)
673-
register register the distribution with the Python package index
674-
bdist create a built (binary) distribution
675-
bdist_dumb create a "dumb" built distribution
676-
bdist_rpm create an RPM distribution
677-
bdist_wininst create an executable installer for MS Windows
678-
upload upload binary package to PyPI
679-
check perform some checks on the package
647+
$ pip install .
680648
681649
682650
We can write package files for Python packages using the :code:`Package` class,
683651
but the class brings with it a lot of methods that are useless for Python packages.
684652
Instead, Spack has a :code:`PythonPackage` subclass that allows packagers
685-
of Python modules to be able to invoke :code:`setup.py` and use :code:`Distutils`,
686-
which is much more familiar to a typical python user.
687-
688-
To see the defaults that Spack has for each a methods, we will take a look
689-
at the :code:`PythonPackage` class:
690-
691-
.. code-block:: console
692-
693-
$ spack edit --build-system python
694-
695-
We see the following:
696-
697-
698-
.. literalinclude:: _spack_root/lib/spack/spack/build_systems/python.py
699-
:language: python
700-
:lines: 176-204,273-290
701-
:linenos:
702-
703-
Each of these methods have sensible defaults or they can be overridden.
653+
of Python modules to be able to invoke :code:`pip`.
704654

705655
We will write a package file for Pandas_:
706656

tutorial_configuration.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ MPICH over OpenMPI. Currently, we prefer GCC and OpenMPI.
464464

465465
.. literalinclude:: outputs/config/0.prefs.out
466466
:language: console
467-
:emphasize-lines: 21
467+
:emphasize-lines: 16
468468

469469

470470
Let's override these default preferences in an environment. When you
@@ -506,7 +506,7 @@ overrides the default settings just for these two items.
506506

507507
.. literalinclude:: outputs/config/1.prefs.out
508508
:language: console
509-
:emphasize-lines: 21
509+
:emphasize-lines: 18
510510

511511

512512
^^^^^^^^^^^^^^^^^^^
@@ -674,10 +674,10 @@ Notice that we still haven't build ``hdf5`` with our external
674674
675675
1. hdf5: '+mpi' conflicts with '^mpich@4.0:4.0.3'
676676
2. hdf5: '+mpi' conflicts with '^mpich@4.0:4.0.3'
677-
required because conflict applies to spec ^mpich@4.0:4.0.3
678-
required because hdf5%clang+mpi requested from CLI
679-
required because conflict is triggered when +mpi
680-
required because hdf5%clang+mpi requested from CLI
677+
required because conflict applies to spec ^mpich@4.0:4.0.3
678+
required because hdf5%clang+mpi requested from CLI
679+
required because conflict is triggered when +mpi
680+
required because hdf5%clang+mpi requested from CLI
681681
682682
In this case, we cannot use the external mpich. The version is
683683
incompatible with ``hdf5``. At this point, the best option is to give

tutorial_modules.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ and by enabling ``tcl`` module files, which are disabled by default since Spack
4848
4949
$ spack config add "modules:default:enable:[tcl]"
5050
51-
51+
5252
^^^^^^^^^^^^^^^^^^^
5353
Build a module tool
5454
^^^^^^^^^^^^^^^^^^^
@@ -308,7 +308,7 @@ This can be done either editing the configuration manually, or directly from the
308308
.. code-block:: console
309309
310310
$ spack config add "modules:default:tcl:all:filter:exclude_env_vars:['CC', 'CXX', 'F77', 'FC']"
311-
311+
312312
Next you should regenerate all the module files:
313313

314314
.. literalinclude:: outputs/modules/tcl-refresh-1.out
@@ -482,7 +482,6 @@ the names are formatted to differentiate them:
482482
- "CXX"
483483
- "FC"
484484
- "F77"
485-
486485
projections:
487486
all: '{name}/{version}-{compiler.name}-{compiler.version}'
488487
netlib-scalapack: '{name}/{version}-{compiler.name}-{compiler.version}-{^lapack.name}-{^mpi.name}'
@@ -615,7 +614,7 @@ This time we will be more selective and regenerate only the ``openmpi`` module f
615614

616615

617616
.. FIXME: remove this?
618-
617+
619618
^^^^^^^^^^^^^^^^^^^^^
620619
Autoload dependencies
621620
^^^^^^^^^^^^^^^^^^^^^

tutorial_packaging.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ failed installation:
321321

322322
.. literalinclude:: outputs/packaging/build-output.out
323323
:language: console
324-
:emphasize-lines: 1,33
324+
:emphasize-lines: 1,35
325325

326326
In this case the error conveniently appears on the last line of the
327327
log *and* the output from `spack install`.
@@ -449,7 +449,7 @@ Now let's try the build again:
449449

450450
.. literalinclude:: outputs/packaging/install-mpileaks-3.out
451451
:language: console
452-
:emphasize-lines: 1,30-31
452+
:emphasize-lines: 1,31-32
453453

454454
Success!
455455

@@ -727,7 +727,6 @@ Undo the work we've done here by entering the following commands:
727727

728728
.. literalinclude:: outputs/packaging/cleanup.out
729729
:language: console
730-
:emphasize-lines: 1,3,5
731730

732731
--------------------
733732
More information

tutorial_spack_scripting.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ using the following commands:
3737

3838
.. literalinclude:: outputs/scripting/setup.out
3939
:language: console
40-
:emphasize-lines: 1,27,29,282
40+
:emphasize-lines: 1,31,33,321
4141

4242
Now we are ready to use the Spack's ``find`` and ``python`` subcommands
4343
to query the installed packages.

0 commit comments

Comments
 (0)