1. Introduction

This document contains information on how to configure the Techila SDK when using Techila Distributed Computing Engine in the following environment:

  • Google Cloud Platform Marketplace

If you are using Techila Distributed Computing Engine in some other environment than the one listed above, you will need to configure your Techila SDK according to the instructions Getting Started.

Please note that screenshots in this post are from a Microsoft Windows operating system. If you are performing the configuration on a different operating system, the appearance of screens might differ.

2. Configuration Steps

Please also note that in order to perform the configuration steps described here, you will also need access to the plugin components included in the TechilaSDK.zip package. The TechilaSDK.zip can be downloaded from the Techila Configuration Wizard, after you have launched your Techila Distributed Computing environment.

If you have not downloaded the plugin components, please download the package (TechilaSDK.zip) before continuing.

Please follow the configuration steps for the programming language you are using:

2.1. MATLAB

Note! In order to complete the configuration, you will need the following:

  • MATLAB, 2012b-2018b, 64-bit

  • MATLAB Compiler

  • C-compiler compatible with your MATLAB Compiler

Please also note that in order to perform the steps described here, you will also need access to Techila SDK.

If you have not downloaded the Techila SDK, please download the plugin package (TechilaSDK.zip) before continuing. The TechilaSDK.zip can be downloaded from the Techila Configuration Wizard, after you have launched the Techila Distributed Computing environment.

  1. Extract the previously downloaded TechilaSDK.zip to your computer, e.g. to your home directory.

    When extracted, the TechilaSDK.zip file will create a directory called techila with the folder structure illustrated in the example screenshot below. In this example, the TechilaSDK.zip file was extracted to C:\.

    matlab1
  2. Launch MATLAB.

  3. Verify that you have the MATLAB Compiler by executing ver in MATLAB and checking the output.

    matlab2
  4. In MATLAB, change your current working directory to techila/lib/Matlab in the Techila SDK.

  5. Execute command the following command in MATLAB:

    installsdk()

    This command updates the MATLAB’s search path to include the Techila SDK’s techila/lib/Matlab path.

    matlab3
  6. Test the network connection to the Techila Server by executing the following command in MATLAB.

    techilainit()

    If the network connection test was successful, the function should return the value 0 as illustrated in the example screenshot below.

    matlab4
  7. Execute the following command in MATLAB and follow the on-screen instructions configure your MATLAB compiler:

    mbuild -setup

    The screenshot below illustrates what the output looks like when Microsoft Windows SDK 7.1 has been configured as the C compiler.

    matlab5

2.2. Python

Note! In order to complete the configuration, you will need the following:

  • Java Development Kit (JDK) or Java Runtime Environment (JRE) (version 6 or newer)

  • Supported Python version

    • 2.7.11 64-bit

    • 3.5.1 64-bit

Other versions can also be used, but require additional configuration as described here Python Version Definition.

  1. Extract the previously downloaded TechilaSDK.zip to your computer, e.g. to your home directory.

    When extracted, the TechilaSDK.zip file will create a directory called techila with the folder structure illustrated in the example screenshot below. In this example, the TechilaSDK.zip file was extracted to C:\.

    matlab1
  2. Launch a Command Prompt (Windows) or terminal (Linux)

  3. Change your current working directory to 'techila/lib/python' in the Techila SDK.

  4. Execute command the following command to install the 'techila' Python package:

    python setup.py install

    After executing the command, the output should resemble the one shown below:

    python1
  5. Change your current working directory so that you are NOT in the 'techila/lib/python' directory.

  6. Launch Python, and execute the following commands to test the network connection to the Techila Server:

    import techila
    techila.init()
    techila.uninit()

    Note! If you did not change your current working directory before launching python, the 'techila.init()' command will generate an error stating that 'Unable to get sdkroot: (-1)'.

    If the network connection test was successful, the function return without any errors as illustrated in the example screenshot below.

    python2

2.2.1. Python Version Definition

If you attempt to use a Python version that is not supported in your Techila Distributed Computing Engine environment, you will receive the following error message:

Error creating Python Project (-303)

An example screenshot of this error message is shown below

pythonversion

The bulleted numbers are explained below.

  1. The python version in this example is 2.7.10

  2. The Techila system tries to use runtime components that match the local version (in this case 2.7.10)

  3. Because the Techila Server did not have runtime components for python version 2.7.10, this results in error -303.

The easiest workaround in this case is to create an environment variable TECHILA_PYTHON_VERSION, which can be used to override the import process for the local version. Set the value of the environment variable as shown below:

For python 2: TECHILA_PYTHON_VERSION=2711

For python 3: TECHILA_PYTHON_VERSION=351

After setting the environment variable, restart your python environment to ensure that the environment variable takes effect.

2.3. R

Note! In order to complete the configuration, you will need the following:

  • Java Development Kit (JDK) or Java Runtime Environment (JRE) (version 6 or newer)

  • 3.4.3 64-bit (other versions can also be used, but require additional configuration as described here R Version Definition.

    1. Extract the previously downloaded TechilaSDK.zip to your computer, e.g. to your home directory.

      When extracted, the TechilaSDK.zip file will create a directory called 'techila' with the folder structure illustrated in the example screenshot below. In this example, the TechilaSDK.zip file was extracted to 'C:\'.

      matlab1
    2. Create an environment variable TECHILA_SDKROOT and set the value to point to the 'techila' directory. For example, if the 'techila' directory is located in C:\techila, then set the value to 'C:\techila'.

    3. Launch R

    4. In R, Change your current working directory to techila/lib/R in the Techila SDK.

    5. Execute following commands to install the R.Utils, rJava andd techila packages:

      install.packages("R.utils")
      install.packages("rJava")
      install.packages("techila", type = "source", repos = NULL, INSTALL_opts = "--no-multiarch")

      After executing the commands, the output should resemble the one shown below:

      r1
    6. Execute the following commands in R to test the network connection to the Techila Server:

      library(techila)
      init()

      If the network connection test was successful, the function should return without generating errors. The output of the above commands is illustrated in the screenshot below.

      r2

2.3.1. R Version Definition

If you receive error code -303 when running an R example, the typical reason for this is that you are using an R programming language version which is not supported by your Techila Distributed Computing Environment. The screenshot below illustrates what this error looks like when running one of the R examples in the Techila SDK.

rversion

The easiest workaround in this case is to create an environment variable TECHILA_R_VERSION, which can be used to override the import process for the local version. Set the value of the environment variable as shown below:

TECHILA_R_VERSION=343

After setting the environment variable, restart your R environment to ensure that the environment variable takes effect.

2.4. C

Note! In order to complete the configuration, you will need the following:

  • Compiler capable of compiling C code (e.g. the C compiler included in the GNU Compiler Collection (gcc))

  • Java Development Kit. Note! Java Runtime Environment (JRE) will not work, because the C compilation process will require access to the jni.h file, which is not include in the JRE.

Before using the TDCE C API, the following environment variables need to be defined as described below.

Environment Variable Content Operating System

JAVA_HOME

Must point to the Java Development Kit installation directory.

Windows, Linux

LD_LIBRARY_PATH

<full path>/techila/lib

Linux

PATH

<full path>\techila\lib

Windows

Below are step-by-step instructions for making the necessary changes required for compiling C applications that use the TDCE C API.

  1. Extract the previously downloaded TechilaSDK.zip to your computer, e.g. to your home directory.

    When extracted, the TechilaSDK.zip file will create a directory called 'techila' with the folder structure illustrated in the example screenshot below. In this example, the TechilaSDK.zip file was extracted to 'C:\'.

    matlab1
  2. Next you will need to create environment variables as described below. Please follow the instructions for the operating system you are using.

    • Windows

      1. Using Windows Control Panel, create JAVA_HOME environment variable and set the value of the variable to match your Java installation directory.

      2. Using Windows Control Panel, modify the PATH environment variable to contain the location of your 'techila\lib' directory. For example, if the path on your computer is C:\techila\lib, add this path to your PATH environment variable. Note! If you do not have a PATH variable defined, create the variable and set the value to match your 'techila\lib' directory location.

    • Linux

      1. Add the following line to .bashrc or other shell startup script.

        • export JAVA_HOME=<path of Java installation directory>

        • export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<full path>/techila/lib

      2. If necessary, launch a new shell to make the changes take effect.

2.5. CSharp

This Chapter contains steps for creating an environment variable that will be used to define the location of the 'techila_settings.ini' configuration file. Instructions are also provided for updating the project references in Visual Studio 2010.

2.5.1. Create TECHILA_SETTINGS_FILE Environment Variable

The TECHILA_SETTINGS_FILE environment variable will need to be used to define the location of your techila_settings.ini configuration file. This will ensure that the configuration file is automatically found when executing the example material included in the Techila SDK. Note! If this environment variable is not set, the system might not be able find the configuration file.

  1. Launch the Windows Control Panel

  2. Select "System" and "Advanced system settings"

  3. In the "System Properties" select the "Advanced" tab

  4. Click the "Environment Variables.." button

  5. In the "Environment Variables" window, under "User variables" click the "New.." button

  6. Enter the following information to the fields:

    Variable name: TECHILA_SETTINGS_FILE Variable value: <path to your techila_settings.ini file>

    In the example below, the 'techila_settings.ini' in directory 'C:\techila' would be used

    Click the OK button to create the environment variable.

    csharp1

2.5.2. Update Visual Studio References

In order to access TDCE from your application, the following two components from the Techila SDK will need to be added as Visual Studio references. These files contain the TDCE C# API functionality.

  • TechilaManagement.dll (located in 'techila\lib' in the Techila SDK)

  • TechilaExecutor.exe (located in 'techila\lib' in the Techila SDK)

Please add these references whenever developing a new, TDCE-enabled application. Below are step-by-step instructions for adding the references to a new C# console application using Visual Studio 2010.

  1. Extract the previously downloaded TechilaSDK.zip to your computer, e.g. to your home directory.

    When extracted, the TechilaSDK.zip file will create a directory called 'techila' with the folder structure illustrated in the example screenshot below. In this example, the TechilaSDK.zip file was extracted to 'C:\'.

    matlab1
  2. Launch Visual Studio and create the project.

    csharp2
  3. Define name and location for the project.

    csharp3
  4. In the Solution Explorer view, right-click on References and click Add Reference.

    csharp4
  5. Using the file dialog, select the Browse tab and navigate to the 'techila/lib' directory in the Techila SDK. Select the following files from the directory and click OK.

    • TechilaManagement.dll

    • TechilaExecutor.exe

      csharp5
  6. The new references should now be visible in the project references as shown below.

    csharp6
  7. Set the 'Copy Local' setting to 'True' for both of the references that you added. This is required in orders to ensure that references will be copied to the same directory with the executable code when the solution is compiled in visual studio.

    csharp7