building.rst 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. Building the Library
  2. ====================
  3. Building the Single-File Release
  4. --------------------------------
  5. Using the GCC compiler, the following calls build the library on Linux.
  6. .. code-block:: bash
  7. gcc -std=c99 -fPIC -c open62541.c
  8. gcc -shared open62541.o -o libopen62541.so
  9. Building with CMake on Ubuntu or Debian
  10. ---------------------------------------
  11. .. code-block:: bash
  12. sudo apt-get install git build-essential gcc pkg-config cmake python python-lxml
  13. # enable additional features
  14. sudo apt-get install libexpat1-dev # for XML-encodingi
  15. sudo apt-get install liburcu-dev # for multithreading
  16. sudo apt-get install check # for unit tests
  17. sudo apt-get install graphviz doxygen # for documentation generation
  18. cd open62541
  19. mkdir build
  20. cd build
  21. cmake ..
  22. make
  23. # select additional features
  24. ccmake ..
  25. make
  26. Building with CMake on Windows (Visual Studio)
  27. ----------------------------------------------
  28. - Get and install Python 2.7.x (Python 3.x should work, too) and CMake: https://python.org/downloads, http://www.cmake.org/cmake/resources/software.html
  29. - Get and install Visual Studio 2015 Preview: https://www.visualstudio.com/downloads/visual-studio-2015-ctp-vs
  30. - Download the open62541 sources (using git or as a zipfile from github)
  31. - Open a command shell (cmd) with Administrator rights and run
  32. .. code-block:: bat
  33. <path-to-python>\Scripts\pip.exe install lxml
  34. - Open a command shell (cmd) and run
  35. .. code-block:: bat
  36. cd <path-to>\open62541
  37. mkdir build
  38. cd build
  39. <path-to>\cmake.exe .. -G "Visual Studio 14 2015"
  40. :: You can use use cmake-gui for a graphical user-interface to select single features
  41. - Then open "build\open62541.sln" in Visual Studio 2015 and build as usual
  42. Build Options
  43. -------------