Building From Source

Building from tarball

ddcutil can be built from its tarball in the usual way. Unpack the tar file, change to its directory, and issue the commands:

# ./configure
# make
# sudo make install

Note that additional steps are required to build ddcutil with ADL support. See ADL support.

configure options

The configure script has several custom options. Some reflect features under development, or tools used for development. The publicly supported options are:

Option Purpose
--with-adl Build with support for ADL connected monitors. See below
--enable-usb Build with support for USB connected monitors. Setting --disable-usb reduces size and package requirements. (Default is --enable-usb.)
--enable-drm Build with DRM support, used for enhanced diagnostics. Setting --disable-drm reduces size and package requirements. (Default is --enable-drm.)
--enable-lib Build with shared libraries. Needed for API support. (Default is --enable-lib.)
--enable-swig Build with Python API. (Default is --disable-swig.)
--enable-doxygen Build API documentation using Doxygen (if it is installed). (Default is --disable-doxygen)

Required packages

Because of the variation among distributions, only general guidelines can be given for ddcutil prerequisites. Ultimately, you'll have to try to build ddcutil and see what breaks.

ddcutil requires the following packages for both building and execution:

  • i2c-tools
  • glib-2.0 (Note: glib-2.0 can be packaged with different names, e.g. libglib2.0-0, and may entail installing multiple packages.)
  • libgudev (e.g. libgudev1)
  • libusb-1.0 (e.g. libusb-1.0-0)
  • libudev (e.g. libudev1)
  • libdrm2

On most platforms, development related files (e.g. headers files) are in separate packages having a "-dev" or similar suffix in their names. ddcutil needs development packages for:

  • glib2.0 (e.g. libglib2.0-0)
  • libusb (e.g. libusb-1_0-devel, libusb-1.0-0-dev)
  • python (e.g. python-all-dev)
  • udev or systemd (udev may be part of systemd, e.g. libudev-devel, libudev-dev)
  • x11 (e.g. libx11-dev)
  • xrandr (e.g. libxrandr-dev)
  • libdrm2 (e.g. libdrm-devel)

At least on Ubuntu, the i2c.h header file is found in a separate package.
If the following package exists, it is required to build ddcutil.

  • libi2c-dev

Error messages in this regard from autoconf can be misleading. If autoconf complains that a package is not found but it seems to be installed, it's likely that the associated development package (with a suffix like "-dev") needs to be installed.

Building requires that the core build files be installed (e.g. build-essential on Ubuntu) and also the pkg-config system.

  • pkg-config

Building from git

The git repository for ddcutil is here

  • Building ddcutil from git requires that the autotools related packages be installed.
    The exact packages vary from distribution to distribution. On Ubuntu, these include:

    • autoconf
    • automake
    • autotools-dev
    • libtool
    • m4

To configure the build, change to the main ddcutil directory and execute the file:

# ./autogen.sh

Or issue the individual commands:

# aclocal
# autoconf
# automake

Then to configure, build, and install ddcutil:

# ./configure
# make
# sudo make install

Common issues:

  • Building with support for the AMD proprietary video driver (fglrx) requires that configure be executed using the -with-adl-headers argument. See ADL support.
  • If you see a message "required file './ltmain.sh.' not found", run libtoolize (See https://www.gnu.org/software/automake/manual/html_node/Error-required-file-ltmain_002esh-not-found.html)
  • May get the following warning when running automake
src/Makefile.am:38: warning: compiling 'cmdline/cmd_parser_aux.c' in subdir requires 'AM_PROG_CC_C_O' in 'configure.ac'

This is an autotools versioning issue. It appears that this warning can be ignored.
- (need notes on other warnings that can be ignored)

Development configuration options.

There are several configure options that exist for developing ddcutil. They are listed here for completeness, and should be left disabled.

  • --enable-callgraph
  • --enable-failisim
  • --enable-gobject-api
  • --enable-testcases