
.. meta::
  :description: Install ROCm Bandwidth Test
  :keywords: install, rocm bandwidth test, AMD, ROCm


Building the environment
--------------------------

To build ROCmBandwidthTest, users must ensure that the build platform has the following conditions satisfied.


Build the procedure
====================

This section lists the steps to build ROCmBandwidthTest.

1. Create a build directory in the project folder - `roc_bandwidth_test`.

.. code-block:: shell

    mkdir ./build


2. Set working directory to be the new build directory.

.. code-block:: shell

    cd ./build



3. Invoke Cmake to interpret build rules and generate native build files. The argument for cmake should be the root folder of ROCmBandwidthTest test suite.

.. code-block:: shell

    # Assume that ROCR Runtime has its libraries & headers are located in the path :
    # libraries : _ABSOLUTE_PATH_TO_ROCR_LIBS_/lib
    # headers   : _ABSOLUTE_PATH_TO_ROCR_LIBS_/include/hsa
    # Note : Observe that both include & lib folder are under common path (_ABSOLUTE_PATH_TO_ROCR_LIBS_)
    
    # Builds Debug version
    # Assumes pwd is _ABSOLUTE_PATH_TO_RBT/roc_bandwidth_test/build

    cmake -DCMAKE_BUILD_TYPE="Debug"   \
        -DCMAKE_MODULE_PATH="_ABSOLUTE_PATH_TO_RBT/rocm_bandwidth_test/cmake_modules"  \
        -DCMAKE_PREFIX_PATH="_ABSOLUTE_PATH_TO_ROCR_LIBS_"
        ..
    
    # Builds Release version - default
    # Assumes pwd is _ABSOLUTE_PATH_TO_RBT/roc_bandwidth_test/build
    cmake -DCMAKE_MODULE_PATH="_ABSOLUTE_PATH_TO_RBT/rocm_bandwidth_test/cmake_modules"  \
        -DCMAKE_PREFIX_PATH="_ABSOLUTE_PATH_TO_ROCR_LIBS_"       


4. Invoke the native build rules generated by cmake to build the various object, library and executable files.

.. code-block:: shell

    make


5. Invoke the install command to copy build artifacts to pre-defined folders of ROCmBandwidthTest suite. Upon completion, the artifacts are copied to the `bin` and `lib` directories of build directory.

.. code-block:: shell

    make install


.. NOTE::

All executables will be found in the `<build_directory>` folder.

