To compile logfilegen from the source you need GCC/g++ or Clang with C++17 version support. If you did not compiled programs before, install GCC/g++ or Clang, cmake and make utility to your system.
Use the tarball with the latest release, it is always stable. Altough logfilegen has several manually written makefiles, the prefered way to compile logfilegen is CMake/make pair.
Unpack the source, go to the logfilegen source dir, and, as root or with sudo, run:
mkdir b
cd b
cmake ..
make
make install
mkdir b
cd b
cmake -DUSE_CLANG ..
make
make install
mkdir b
cd b
cmake -DUSE_STATIC=ON ..
make
make install
logfilegen has support for Prometheus/OpenMetrics format metrics exposion via built-in server code or, as an optional and experimatal feature, via prometheus-cpp library. Currently, the built-in server code works faster. But if you want to play around with prometheus_cpp:
mkdir b
cd b
cmake -DUSE_PROMCPP=ON ..
make
make install
More simple, but less powerful and less flexlible way to compile logfilegen, is the use on manual written Makefiles:
make
make install
And to uninstall:
make uninstall
make CXX=clang++
There are some ready-to-use examples below to build logfilegen with Makefiles on some systems or distros:
Download and unpack the tarball. Go to the unpacked source directory.
Install dependencies (do sudo apt update
if didn’t before):
sudo apt install make g++
make
sudo make install
Download and unpack the tarball. Go to the unpacked source directory.
Install dependencies:
sudo yum install git make gcc-c++
make
sudo make install
Download and unpack the tarball. Go to the unpacked source directory.
Install dependencies:
pkg_add llvm
pkg_add make
make --makefile=Makefile.OpenBSD
make install