diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 11e325ff6..7b830fc61 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -14,6 +14,7 @@ build: apt_packages: - iputils-ping - build-essential + - curl - gfortran - csh - zsh diff --git a/docs/writing_buildspecs/compilation.rst b/docs/writing_buildspecs/compilation.rst index b9268a84d..5ba337da1 100644 --- a/docs/writing_buildspecs/compilation.rst +++ b/docs/writing_buildspecs/compilation.rst @@ -1,16 +1,16 @@ Compilation Example -================== +==================== Hello World Example -------------------- +-------------------- In this section, we will show to compile source code with compiler and compiler flags. To get started, let's start with a simple hello world example we have available in C and C++ as shown below -.. literalinclude:: ../tutorials/compilation/hello_world.c +.. literalinclude:: ../tutorials/compilation/hello.c :language: c -.. literalinclude:: ../tutorials/compilation/hello_world.cpp +.. literalinclude:: ../tutorials/compilation/hello.cpp :language: c++ Shown below is an example buildspec file that will compile the above source code with the gcc compiler. @@ -18,12 +18,12 @@ The ``compilers`` section is used to specify the compiler to use that is selecte a regular expression to search for compiler. The compilers are defined in buildtest configuration file see :ref:`compilers` for more details. -.. literalinclude:: ../../tutorials/compilation/hello_world_buildspec.yml +.. literalinclude:: ../tutorials/compilation/hello_world_compilation.yml :language: yaml :emphasize-lines: 6-7, 9-10 -Buildtest will define environment variables like ``BUILDTEST_CC`` and ``BUILDTEST_CXX`` that point to compiler wrapper -for the selected compiler. +Buildtest will define environment variables like ``BUILDTEST_CC`` and ``BUILDTEST_CXX`` that point to the C and C++ +compiler wrapper for the selected compiler. Let's try to run the code and inspect the test output and test file. @@ -33,6 +33,12 @@ Let's try to run the code and inspect the test output and test file. .. command-output:: buildtest inspect query -o -t hello_world_c_cpp +Please note that the compiler definition for ``builtin_gcc`` is a canonical name to reference to system GNU +compiler that is set to `/usr/bin/gcc`, `/usr/bin/g++`. The compiler details can be extracted from the configuration +file via ``buildtest config compilers list`` command. Shown below is the YAML output of the compiler details. + +.. command-output:: buildtest config compilers list --yaml + STREAM Benchmark Example ------------------------ @@ -42,7 +48,7 @@ we will need to download the source code and compile the source code. We will us The `cflags` option is responsible for setting C compiler flags which is set to environment variable ``BUILDTEST_CFLAGS`` that we can access in the ``run`` section. The ``env`` section is used to set environment variables that are used in the ``run`` section. -.. literalinclude:: ../../tutorials/compilation/stream.yml +.. literalinclude:: ../tutorials/compilation/stream.yml :language: yaml :emphasize-lines: 9-13,16