README.linux 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. % README.linux 2024-10-04
  2. % Tested on Ubuntu 20.04.4 LTS, Ubuntu 22.04 LTS, Ubuntu 24.04 LTS and
  3. % Fedora Linux 40 (Workstation Edition)
  4. 1. Prerequisites for building zint
  5. ==================================
  6. Prerequisites are git, cmake, make, gcc and gcc-c++, e.g. Ubuntu/Debian
  7. sudo apt install git cmake build-essential
  8. or Fedora (git, make and gcc should already be installed)
  9. sudo dnf install cmake gcc-c++
  10. libpng is optional but necessary for PNG support, e.g. Ubuntu/Debian
  11. sudo apt install libpng-dev
  12. or Fedora
  13. sudo dnf install libpng-devel
  14. Then either download the source code tarball
  15. wget -O zint-2.13.0-src.tar.gz \
  16. https://sourceforge.net/projects/zint/files/zint/2.13.0/zint-2.13.0-src.tar.gz/download
  17. tar xf zint-2.13.0-src.tar.gz
  18. cd zint-2.13.0-src
  19. or clone the latest source
  20. git clone https://git.code.sf.net/p/zint/code zint
  21. cd zint
  22. 2. Prerequisites for building zint-qt
  23. =====================================
  24. zint-qt can be built with either Qt5 (preferred) or Qt6. First, install mesa (for OpenGL), e.g.
  25. Ubuntu/Debian
  26. sudo apt install mesa-common-dev libglu1-mesa-dev
  27. or Fedora
  28. sudo dnf install mesa-libGL mesa-libGL-devel
  29. zint-qt has issues running on Wayland so sets X11 as the Qt platform (via the environment variable
  30. "QT_QPA_PLATFORM=xcb") on startup unless already set.
  31. 2.1. Using Qt packages
  32. ----------------------
  33. If packages for Qt exist for your distro, it might be easiest to use them, although knowing
  34. what their ever-changing names and contents are isn't. A complication is that zint-qt uses 2 Qt
  35. components beyond the basic setup: Qt UI Tools (for dynamically loading the symbology-specific
  36. tabs), and Qt SVG (for rendering icons).
  37. E.g. on Ubuntu 22.04 or 24.04
  38. sudo apt install qtbase5-dev qttools5-dev qttools5-dev-tools libqt5svg5-dev
  39. or Ubuntu 20.04
  40. sudo apt install qt5-default qt5-uitools
  41. or Fedora (not recommended)
  42. sudo dnf install qt5-qtbase-devel qt5-qttools-devel qt5-qttools-static qt5-qtsvg-devel
  43. You may need to tell CMake where to find the ".cmake" modules:
  44. export CMAKE_MODULE_PATH=<cmake-module-path>/Qt5
  45. e.g. CMAKE_MODULE_PATH=/usr/lib/x86_64-linux-gnu/cmake/Qt5
  46. 2.2. Using the Qt Maintenance Tool
  47. ----------------------------------
  48. Alternatively, for a more consistent experience, sign up and download the Qt Maintenance Tool
  49. from
  50. https://www.qt.io/download-qt-installer
  51. On Ubuntu/Debian you may need to install xinerama to run the tool:
  52. sudo apt install libxcb-xinerama0
  53. Launch the tool and install the "Desktop gcc 64-bit" component for either Qt 5.15.2 (preferred)
  54. or Qt 6 (>= 6.1).
  55. Once Qt is installed you may need to tell CMake where it is:
  56. export CMAKE_PREFIX_PATH=<qt-version-dir>/gcc_64
  57. e.g. export CMAKE_PREFIX_PATH=/opt/Qt/5.15.2/gcc_64
  58. 3. Build
  59. ========
  60. The rest is standard CMake
  61. cd zint
  62. mkdir build
  63. cd build
  64. cmake ..
  65. make
  66. sudo make install
  67. 4. CMake options
  68. ================
  69. A number of options are available:
  70. ZINT_COVERAGE:BOOL=OFF # Set code coverage flags
  71. ZINT_DEBUG:BOOL=OFF # Set debug compile flags
  72. ZINT_FRONTEND:BOOL=ON # Build frontend
  73. ZINT_NOOPT:BOOL=OFF # Set no optimize compile flags
  74. ZINT_SANITIZE:BOOL=OFF # Set sanitize compile/link flags
  75. ZINT_SHARED:BOOL=ON # Build shared library
  76. ZINT_STATIC:BOOL=OFF # Build static library
  77. ZINT_TEST:BOOL=OFF # Set test compile flag
  78. ZINT_UNINSTALL:BOOL=ON # Add uninstall target
  79. ZINT_USE_PNG:BOOL=ON # Build with PNG support
  80. ZINT_USE_QT:BOOL=ON # Build with Qt support
  81. ZINT_QT6:BOOL=OFF # If ZINT_USE_QT, use Qt6
  82. which can be set by doing e.g.
  83. cmake -DZINT_SANITIZE=ON ..
  84. For details on ZINT_TEST and building the zint test suite, see "backend/tests/README".