Skip to content

manual build

The Tumultuous Unicorn Of Darkness edited this page Sep 17, 2023 · 10 revisions

Instructions to manually build CPU-X


Install dependencies

On GNU/Linux

If you want to install CPU-X on GNU/Linux, you need to install these dependencies before continuing.
Don't forget to install appropriate -dev or -devel packages.

On FreeBSD

If you want to install CPU-X on FreeBSD/GhostBSD, you need to have GTK3+, NCurses or both.

First, you can install some packages if there are not installed:

# pkg install git pkgconf libtool automake cmake ncurses libstatgrab 

If you want to use GTK3+ GUI (normally GTK3+ is already installed in GhostBSD), install this package too:

# pkg install gtkmm30

LibCPUID

Libcpuid is available in some repositories, be can be out-of-the-date. This is steps to do to install it manually:

$ git clone https://github.com/anrieff/libcpuid
$ cd libcpuid
$ libtoolize
$ autoreconf --install
$ ./configure
$ make -j`nproc`
# make install

Note: on *BSD systems, you need to do a wordaround for pkgconfig:

# ln -s /usr/local/lib/pkgconfig/libcpuid.pc /usr/local/libdata/pkgconfig/

CMake build options

CPU-X is a modular software, you can disable some functionalities, as you wish.

You can disable components before build by passing argument -D<var>=0 to CMake. A list of variables with description can be obtained with cmake -LH command.

List of these variables:

  • -DWITH_GTK=0 will disable support of GUI in GTK3+
  • -DWITH_NCURSES=0 will disable support of TUI in NCurses
  • -DWITH_GETTEXT=0 will disable support for internationalization
  • -DWITH_LIBCPUID=0 will avoid calls to Libcpuid (not recommended)
  • -DWITH_LIBPCI=0 will avoid calls to Libpci (not recommended)
  • -DWITH_LIBGLFW=0 will avoid calls to Libglfw (UMD Version label in Graphics tab)
  • -DWITH_VULKAN=0 will avoid calls to Libvulkan (Vulkan Version and Vulkan TR labels in Graphics tab)
  • -DWITH_OPENCL=1 will allow calls to Libopencl (disabled due to issues: #238, #258, #264)
  • -DWITH_LIBPROCPS=0 will avoid calls to Libprocps (not recommended)
  • -DWITH_LIBSTATGRAB=0 will avoid calls to Libstatgrab (not recommended)
  • -DWITH_DMIDECODE=0 will not compile built-in Dmidecode (not recommended)
  • -DWITH_BANDWIDTH=0 will not compile built-in Bandwidth (not recommended)
  • -DFORCE_LIBSTATGRAB=1 will force to link with Libstatgrab instead of Libprocps

Example:

$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DWITH_NCURSES=0

Build and install CPU-X

When all prerequisites are satisfied, you can download and install CPU-X:

$ git clone https://github.com/TheTumultuousUnicornOfDarkness/CPU-X.git CPU-X && cd $_
$ cmake -B build -DCMAKE_BUILD_TYPE=Release
$ cmake --build build
# cmake --install build

Test CPU-X

To run tests, first install required dependencies. Then, in the source directory, invoke the test target. Example:

$ cmake -B build -DCMAKE_BUILD_TYPE=Debug # add '-GNinja' if you want to use Ninja build system
$ make -C build test # or 'ninja -C build test' if you use Ninja