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
The configure script has several custom options. Some reflect features under development, or tools used for development. The publicly supported options are:
|--enable-usb||yes||Build with support for USB connected monitors. Setting --disable-usb reduces size and package requirements. (Default is --enable-usb.)|
|--enable-drm||yes||Build with DRM support, used for enhanced diagnostics. Setting --disable-drm reduces size and package requirements. (Default is --enable-drm.)|
|--enable-lib||yes||Build the shared library. (Default is --enable-lib.)|
|--enable-x11||yes||Build using X11 services, used for enhanced diagnostics. Setting --disable-x11 allows for use on systems lacking X11. (Default is --enable-x11.)|
|--enable-asan||no||Build for execution with the Google Address Space Sanitizer.|
|--enable-envcmds||yes||Controls whether commands environment and usbenvironment are included.|
|--enable-udev||yes||Controls whether udev is used.|
- Option --disable-envcmds forces --disable-drm, and --disable-x11
- Option --enable-targetbsd forces --disable-envcmds, --disable-udev, and --disable-usb
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:
- glib-2.0 (Note: glib-2.0 can be packaged with different names, e.g. libglib2.0-0, and may entail installing multiple packages.) Minimum version: 2.32
- libgudev (e.g. libgudev1)
- libusb-1.0 (e.g. libusb-1.0-0) Minimum version 1.0.15
- libudev (e.g. libudev1)
- libdrm2 Minimum version: 2.4.16
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:
- libc6 (e.g. libc6-dev)
- 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)
On older versions of Ubuntu, the i2c.h header file is found in a separate package.
If the following package exists, it is required to build ddcutil.
However, as of libi2c 4.0, i2c.h is no longer part of this package.
Error messages from configure regarding missing packages can be misleading. If configure 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. the files listed in build-essential on Ubuntu) and also the pkg-config system.
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, Minimum version: 2.50
- automake, Minimum version: 1.13
To configure the build, change to the main ddcutil directory and execute the file:
Or issue the individual commands:
# aclocal # autoconf # automake
Then to configure, build, and install ddcutil:
# ./configure # make # sudo make install
Shared library configuration
By default, command "sudo make install" installs the shared library files (libddcutil.so.n.n and symbolic links) in directory /usr/local/lib. In order to be available, command ldconfig must be run and it must find the shared library file. "sudo make install" automatically calls ldconfig after installing the library. For ldconfig to find the file, directory /usr/local/lib should be in a file in /etc/ld.so.conf.d. This is the case in Ubuntu.
For further details, see: Shared Library Configuration
- 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.
TO DO: add 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.
For notes on building ddcui, see Building ddcui