Skip to content
Snippets Groups Projects
Commit c37ea9af authored by Denis Davydov's avatar Denis Davydov
Browse files

document usage of compiler flags properties

parent f84f0459
No related branches found
No related tags found
No related merge requests found
...@@ -1831,6 +1831,25 @@ successfully find ``libdwarf.h`` and ``libdwarf.so``, without the ...@@ -1831,6 +1831,25 @@ successfully find ``libdwarf.h`` and ``libdwarf.so``, without the
packager having to provide ``--with-libdwarf=/path/to/libdwarf`` on packager having to provide ``--with-libdwarf=/path/to/libdwarf`` on
the command line. the command line.
Compiler flags
~~~~~~~~~~~~~~
In rare circumstances such as compiling and running small unit tests, a package
developer may need to know what are the appropriate compiler flags to enable
features like ``OpenMP``, ``c++11``, ``c++14`` and alike. To that end the
compiler classes in ``spack`` implement the following _properties_ :
``openmp_flag``, ``cxx11_flag``, ``cxx14_flag``, which can be accessed in a
package by ``self.compiler.cxx11_flag`` and alike. Note that the implementation
is such that if a given compiler version does not support this feature, an
error will be produced. Therefore package developers can also use these properties
to assert that a compiler supports the requested feature. This is handy when a
package supports additional variants like
.. code-block:: python
variant('openmp', default=True, description="Enable OpenMP support.")
Message Parsing Interface (MPI) Message Parsing Interface (MPI)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It is common for high performance computing software/packages to use ``MPI``. It is common for high performance computing software/packages to use ``MPI``.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment