Skip to content

Compile From Source

Abel Cheung edited this page Nov 30, 2023 · 2 revisions

If looking for old instructions for 0.7.0 version or older, follow the old instructions. rifiuti2 switched over to CMake since 0.8.0.

For the impatient

$ tar -Jxf rifiuti2-0.8.0-Source.tar.xz  # or do git checkout
$ cmake -S rifiuti2-0.8.0 -B _build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo
$ cmake --build _build
$ cd _build && ctest -T test --progress; cd ..
$ cmake --install _build --prefix <somewhere>  # for packagers

Compile Requirements

  • cmake ≥ 3.17
  • ninja (good old make should work too if cmake is not using Ninja generator, but not rigorously tested)
  • glib ≥ 2.40 (deveopment headers and libraries)
  • pkgconf (some Linux might only have the obsolete pkg-config)
  • C compiler — both gcc and clang are tested
  • (Solaris only) iconv/extra package
  • (optional) xmllint utility from libxml2 is used for some tests

On Windows

Only MSYS2 is supported; rifiuti2 doesn't build with Visual Studio yet. It is easiest to install all requirements with following command, once you obtain a MSYS2 shell of desired environment:

$ pacboy -S toolchain:p glib2:p cmake:p libxml2:p

Distributed Windows binaries are built under MINGW32 and UCRT64 MSYS2 environments.

Build Procedure

  1. Extract source archive, or use a git checkout folder directly if you are feeling brave.

  2. Configure step: out-of-tree build is the standard recommanded practice for cmake. The TL;DR procedure on top of document uses folder named _build outside source tree to place all built content. Various config can be changed in this step.

    • Say if one wants to use non-default compiler (default is cc found in path), add -D CMAKE_C_COMPILER=/path/to/compiler
    • Default build type is RelWithDebInfo. One can change it to -D CMAKE_BUILD_TYPE=Debug for a debug build, for example.
  3. Build step: cmake --build _build creates all executables under _build folder. The programs are now ready for use.

  4. Test step: though not strictly necessary, it is recommended to perform this step to ensure safety. Note that ctest must be executed inside build folder.

rifiuti2 can be used immediately without installing.

If compile or test step fails, please report problem, describing your OS and compile environment, and attach relevant testsuite log file(s) if needed.

Clone this wiki locally