installing.rst 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. .. _installing:
  2. Installing open62541
  3. ====================
  4. Manual installation
  5. -------------------
  6. You can install open62541 using the well known `make install` command.
  7. This allows you to use pre-built libraries and headers for your own project.
  8. To override the default installation directory use ``cmake -DCMAKE_INSTALL_PREFIX=/some/path``.
  9. Based on the SDK Features you selected, as described in :ref:`build_options`, these features will also
  10. be included in the installation. Thus we recommend to enable as many non-experimental features as possible
  11. for the installed binary.
  12. The recommended cmake options for a default installation are:
  13. .. code-block:: bash
  14. git submodule update --init --recursive
  15. mkdir build && cd build
  16. cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_NAMESPACE_ZERO=FULL ..
  17. make
  18. sudo make install
  19. This will enable the following features in 0.4:
  20. * Discovery
  21. * FullNamespace
  22. * Methods
  23. * Subscriptions
  24. The following features are not enabled and can be optionally enabled using the build options as described in :ref:`build_options`:
  25. * Amalgamation
  26. * DiscoveryMulticast
  27. * Encryption
  28. * Multithreading
  29. * Subscriptions
  30. .. important::
  31. We strongly recommend to not use ``UA_ENABLE_AMALGAMATION=ON`` for your installation. This will only generate a single ``open62541.h`` header file instead of the single header files.
  32. We encourage our users to use the non-amalgamated version to reduce the header size and simplify dependency management.
  33. In your own CMake project you can then include the open62541 library using:
  34. .. code-block:: cmake
  35. # optionally you can also specify a specific version
  36. # e.g. find_package(open62541 1.0.0)
  37. find_package(open62541 REQUIRED COMPONENTS Events FullNamespace)
  38. add_executable(main main.cpp)
  39. target_link_libraries(main open62541::open62541)
  40. A full list of enabled features during build time is stored in the CMake Variable ``open62541_COMPONENTS_ALL``
  41. Prebuilt packages
  42. -----------------
  43. Pack branches
  44. ^^^^^^^^^^^^^
  45. Github allows you to download a specific branch as .zip package. Just using this .zip package for open62541 will likely fail:
  46. * CMake uses ``git describe --tags`` to automatically detect the version string. The .zip package does not include any git information
  47. * Specific options during the build stack require additional git submodules which are not inlined in the .zip
  48. Therefore we provide packaging branches. They have the prefix `pack/` and are automatically updated to match the referenced branch.
  49. Here are some examples:
  50. * `pack/master.zip <https://github.com/open62541/open62541/archive/pack/master.zip>`_
  51. * `pack/1.0.zip <https://github.com/open62541/open62541/archive/pack/1.0.zip>`_
  52. These pack branches have inlined submodules and the version string is hardcoded. If you need to build from source but do not want to use git,
  53. use these specific pack versions.
  54. Prebuild binaries
  55. ^^^^^^^^^^^^^^^^^
  56. You can always find prebuild binaries for every release on our `Github Release Page <https://github.com/open62541/open62541/releases>`_.
  57. Nightly single file releases for Linux and Windows of the last 50 commits can be found here: https://open62541.org/releases/
  58. OS Specific packages
  59. ^^^^^^^^^^^^^^^^^^^^
  60. Debian packages can be found in our official PPA:
  61. * Daily Builds (based on master branch): https://launchpad.net/~open62541-team/+archive/ubuntu/daily
  62. * Release Builds (starting with Version 0.4): https://launchpad.net/~open62541-team/+archive/ubuntu/ppa
  63. Install them with:
  64. .. code-block:: bash
  65. sudo add-apt-repository ppa:open62541-team/ppa
  66. sudo apt-get update
  67. sudo apt-get install libopen62541-dev
  68. Arch packages are available in the AUR
  69. * Stable Builds: https://aur.archlinux.org/packages/open62541/
  70. * Unstable Builds (current master): https://aur.archlinux.org/packages/open62541-git/
  71. * In order to add custom build options (:ref:`build_options`), you can set the environment variable ``OPEN62541_CMAKE_FLAGS``