====== S2OPC Linux compilation steps ====== This guide compiles the S2OPC OPC UA stack from source on a Linux host running Debian 9.5 or Ubuntu, and runs its demo application. It covers the package dependencies, the build, and the **publisher/subscriber** sample (''pubsub_server'', which runs both roles in one process). For the real-time PubSub variant of the same stack over TSN, see [[.etfpubsub|S2OPC - TSN]]. //Verified against S2OPC Toolkit 1.0.0 in October 2020, on the dependency versions pinned below. The stack has moved on considerably since — see the [[technology:industry40:opcua:stack-comparison:start|stack comparison]] for current findings — so treat the version pins here as what was tested rather than as a current recommendation.// ==== Prerequisite ==== Below are the list of hardware used for setting up the demo for this user guide. But you can use a different set of hardware as per availability. - **DUT** **H/W****:** i5 Quad core - **DUT** **S/W:** Install debian 9.5 or ubuntu on the DUT - **[Note] The DUT hardware configuration is upto the users.** [[:os:linux:qsg:rt-patch|If you need steps to setup the DUT with Linux + RT patch follow this QSG.]] ==== Dependencies ==== Below Linux package dependencies need to be met for the S2OPC demo application to work. * Open terminal * Login as root ''$ su'' * Create an installation folder(parent folder) and install the below dependency packages on the DUT from the parent folder ''# mkdir S2OPC && cd S2OPC/'' == CMake (>= 3.5, tested with CMake version 3.9.4) == # wget https://github.com/Kitware/CMake/releases/download/v3.19.0-rc1/cmake-3.19.0-rc1.tar.gz # tar -xvzf cmake-3.19.0-rc1.tar.gz # cd cmake-3.19.0-rc1/ # ./configure # make # make install == Mbedtls (tested with mbedtls version 2.16.0) == # cd .. # apt-get install autoconf # apt-get install libtool # wget https://github.com/ARMmbed/mbedtls/archive/mbedtls-2.16.0.tar.gz # tar -xvzf mbedtls-2.16.0.tar.gz # cd mbedtls-mbedtls-2.16.0/ # make # make install == Expat XML parser (tested with libexpat version 2.2.9) == # cd .. # git clone https://github.com/libexpat/libexpat.git # cd libexpat/expat/ # ./buildconf.sh # ./configure # mkdir build # cd build # cmake -DCMAKE_INSTALL_INCLUDEDIR=/usr/local/lib .. && sudo make install == Check framework (tested with libcheck version 0.14) == # cd ../../.. # wget https://github.com/libcheck/check/releases/download/0.14.0/check-0.14.0.tar.gz # tar -xvzf check-0.14.0.tar.gz # cd check-0.14.0/ # mkdir build # cd build/ # ccmake .. # make # make install ==== Steps to compile S2OPC samples ==== Download and compile S2OPC sample application. Clone the toolkit 1.0 release version in the S2OPC parent folder. # cd ../../ # git clone https://gitlab.com/systerel/S2OPC.git --branch S2OPC_Toolkit_1.0.0 # cd S2OPC # ./build.sh # cd build/bin/ {{.d8c3922bbfb106fcfc582a04afdc8960.png}} ==== Steps to run OPCUA Pub/Sub samples ==== After successful compilation, the binary is available as pubsub_server in the bin directory. ''# ./pubsub_server'' This sample application runs both the publisher and subscriber demo. {{.a594c61676166636d0baf7702a27df6b.png}} ==== What else can you try? ==== If you want to edit the demo application to test out your configuration, below are the relevant information. * OPC UA Address Space — the default address space for the publisher/subscriber application is located in build/bin/pubsub_server.xml * Pub/Sub configuration — the default Pub/Sub configuration is located in build/bin/config_pubsub_server.xml * Dynamic configuration — Pub/Sub configuration and address space can be loaded at run-time from its XML representation. ==== Other demos with S2OPC ==== S2OPC stack includes a few other helpful features and demo applications to help you with your evaluation. * OPCUA Client server examples * OPCUA Pub/Sub runtime information model and configuration update * Real time OPCUA PubSub over TSN * OPC UA demo on Windows, Vxworks, Zephyr and FreeRTOS * Cyber security certifications ---- For more help with setting up your evaluation and toolkits, contact us at [[adopt.opctsn@aeicor.com?subject=S2OPC - Setting up support|adopt.opctsn@aeicor.com]] \\ You can also reach S2OPC support at [[https://www.s2opc.com|https://www.s2opc.com]]