Building and installing rocPyDecode with CMake

Building and installing rocPyDecode with CMake#

Note

sudo access might be required to build and install with CMake.

rocPyDecode can be built using CMake. rocPyJpegDecode will only be built if rocJPEG is already installed. If rocJPEG isn’t installed, rocPyJpegDecode will be omitted from the installation.

Once rocPyDecode has been built and installed, tar and deb packages can be generated for distribution. Wheel distribution files can also be created.

The rocPyDecode source code and installation scripts are available from the rocPyDecode GitHub Repository.

The develop branch is the default branch and is intended for users who want to preview new features or contribute to the rocPyDecode or rocPyJpegDecode code base. If you don’t intend to preview new features or contribute to the codebase, clone the branch that corresponds to your version of ROCm.

Before building and installing rocPyDecode, run rocPyDecode-requirements.py from the rocPyDecode root directory:

python3 rocPyDecode-requirements.py

If you’re installing on Ubuntu 22.04, install libstdc++-12-dev:

apt install libstdc++-12-dev

To build rocPyDecode, create a build directory in the rocPyDecode root directory:

mkdir build

Change directory to build, then use cmake to generate a makefile.

cd build
cmake ../

By default rocPyDecode and rocPyJpegDecode will be built and installed for all versions of Python available on the system. In some instances, such as when rocPyDecode and rocPyJpegDecode are being built and installed in a conda environment in a Docker container, there may be a hidden Python installation. rocPyDecode and rocPyJpegDecode won’t be built or installed for this version of Python unless the -DPYTHON_FOLDER_SUGGESTED=path_to_python_installation cmake directive is used. This will add the hidden Python installation to the list of targets.

For example, this will add the version of Python installed at /opt/miniconda3/bin/python to the target list:

cmake -DPYTHON_FOLDER_SUGGESTED=/opt/miniconda3/bin/python3 ../

You can also build and install rocPyDecode and rocPyJpegDecode for a specific Python version. Use the -DPYTHON_VERSION_SUGGESTED=version_num cmake directive to build and install only for the specified Python version.

For example, the following command will build rocPyDecode and rocPyJpegDecode only for Python 3.12:

cmake -DPYTHON_VERSION_SUGGESTED=3.12  ../

Note

PYTHON_VERSION_SUGGESTED and PYTHON_FOLDER_SUGGESTED are mutually exclusive and can’t be used together.

Once the makefile has been generated, make and install rocPyDecodee:

make -j8
sudo make install

You can also generate deb files and zipped tar files for distribution:

make package

You can then install the deb packages with apt install. For example:

sudo apt install ./rocpydecode_0.6.0-local_amd64.deb
sudo apt install ./rocpydecode-test_0.6.0-local_amd64.deb

Note

The deb files and tar files will include rocPyJpegDecode if rocJPEG was installed on the system before rocPyDecode was installed.