ANSI C Based OPC UA Client/Server SDK  1.9.0.430
Recompiling the SDK and Examples (Linux)

To compile the SDK from source, at least GCC version 4.7.2 is required.

In addition, it is assumed that all required third-party libraries are correctly installed.

Compile the SDK and Examples with the delivered Bash scripts

The source version of the SDK for Linux is shipped with two bash scripts to build the SDK and the examples in debug and release mode with default settings.

Unpack the SDK:

tar -xvzf uasdk<productname>-src-linux-<ggc version>-<sdk version>.tar.gz

Change to the extracted folder named “sdk”. Execute the script buildSdk.sh to build the SDK:

./buildSdk.sh

To build all examples delivered with the SDK execute the script buildExamples.sh:

./buildExamples.sh

Create Makefiles for the SDK

Install CMake with your Linux distribution’s package manager or download and build the source distribution of CMake from https://cmake.org/download/.

Unpack the SDK:

tar -xvzf uasdk<productname>-src-linux-<ggc version>-<sdk version>.tar.gz

Change to the extracted folder “sdk”, create a subfolder named “bld” and start ccmake from within, using the file CMakeLists.txt in sdk/src/:

mkdir bld
cd bld
ccmake ../src/

Press “c” to configure and change the settings to your liking, e.g. set the build type and change the install prefix (see screenshot). We’re using a new folder “dist” inside “sdk” for this example.

compilesdklinux_ccmake_installprefix.png

When finished, press “c” to configure again, followed by “g” to generate the makefile and exit ccmake. Now we are ready to compile the SDK:

make

When finished, install the SDK to the folder specified at “CMAKE_INSTALL_PREFIX”:

make install

Create Makefiles for the Examples

Creating makefiles for the examples is quite similar as described above for the SDK. Create a new folder below “sdk”, e.g. named “bldexamples”, and start ccmake from within, this time using the CMake file inside sdk/examples:

mkdir bldexamples
cd bldexamples
ccmake ../examples/

Press “c” to configure, set C_MAKE_BUILD_TYPE, set “CMAKE_INSTALL_PREFIX” to the same folder as set above for the SDK.

compilesdklinux_ccmake_examples.png

When finished, press “c” to configure again, followed by “g” to generate the makefile for the examples and exit ccmake.

Now we can build and install the examples:

make
make install

When finished, the binaries can be found in the subfolder bin of the folder specified at “CMAKE_INSTALL_PREFIX” (see screenshot).

compilesdklinux_ccmake_results.png