====== Installing Open Splice DDS ====== To develop ContextNet applications we need an implementation of the DDS ([[wp> Data_distribution_service|Data Distribution Service (DDS)]]) protocol. There are several vendor that implements this protocol. During development its common to use an open source implementation of DDS, in this case, OpenSplice. This tutorial aims on guiding the developer on installing OpenSplice DDS. OpenSplice DDS is available for GNU/Linux and Microsoft Windows, for both architectures, 32-bit and 64-bit. The instructions below provide a step-by-step tutorial for installing OpenSplice DDS community. ==== General Instructions ==== - First, download OpenSplice DDS Community at the following URL {{icon>external-link-square}} [[http://www.prismtech.com/dds-community/software-downloads]]. PrismTech, the company behind OpenSplice, require you to register/create an account in their web site before downloading OpenSplice. Finally, pay attention to download the correct version for your operating system. - Create a directory named ''OpenSplice'' to put the downloaded library. For example, for Windows create a folder ''C:\OpenSplice'', while in GNU/Linux create the directory ''/opt/OpenSplice'' and in Mac OS X create the directory ''/usr/local/opt/OpenSplice''. - Unzip the downloaded .zip file to a temporary folder. Copy the ''HDE'' folder from the temporary folder to the OpenSplicre directory created in the previous step. The resulting path of this operation in Windows is the ''C:\OpenSplice\HDE'' folder, while in GNU/Linux is the ''/opt/OpenSplice/HDE'' folder. - In case you are using Microsoft Windows, install the Visual C++ Runtime. The installer is located at ''C:\OpenSplice\HDE\x86_64.win64\redist\install_vcredist.bat'' for 64-bit and ''C:\OpenSplice\HDE\x86_64.win64\redist\install_vcredist.bat'' - Now we need to create environment variables in the operation system to point to the OpenSplice native libraries. This process is different for each operation system. Thus, follow the instructions below for your operation system. ===== Windows ===== - Create an empty text file named ''opensplice.txt'' inside the OpenSplice ''x86_64.win64'' directory (''C:\OpenSplice\HDE\x86_64.win64\'') - Paste the following content in this file: setx /m OSPL_HOME %~dp0 set OSPL_HOME=%~dp0 setx /m PATH "%OSPL_HOME%bin;%OSPL_HOME%lib;%OSPL_HOME%examples\lib;%PATH%" setx /m OSPL_TMPL_PATH %OSPL_HOME%etc\idlpp setx /m OSPL_URI file://%OSPL_HOME%etc\config\ospl.xml - Change the ''opensplice.txt'' file to ''opensplice.bat'' to make it a batch executable file. - Run this file ''opensplice.bat'' as administrator (Right-click on the file and choose ''Run as administrator'') This will set the environment variables needed for OpenSplice to be used by the ContextNet. ===== GNU/Linux ===== - Create an empty file named ''opensplice.sh''. - Paste the following content in this file: * ''OSPL_HOME=/opt/OpenSplice/HDE/x86_64.linux'' * ''PATH=$OSPL_HOME/bin:$PATH'' * ''LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OSPL_HOME/lib'' * ''CPATH=$OSPL_HOME/include:$OSPL_HOME/include/sys:${CPATH:=}'' * ''OSPL_URI=file:%%//%%$OSPL_HOME%%/%%etc%%/%%config%%/%%ospl.xml'' * ''export OSPL_HOME PATH LD_LIBRARY_PATH CPATH OSPL_TMPL_PATH OSPL_URI'' - Make the file executable using the ''%%chmod%%'' command (''%%sudo chmod +x opensplice.sh%%''). - Move the file to the ''%%/%%etc%%/%%profile.d'' folder in the system, resulting in the following ''%%/%%etc%%/%%profile.d%%/%%opensplice.sh'' file. - Finally, restart the system. ===== Mac OS X ===== - Open a terminal window. - Go to your user folder. In order to do this, you can type "cd" in the command line and press Enter. - Edit the file ''.bash_profile'' - Add the following to the end of the ''.bash_profile'' file: (OBS: In this tutorial the OpenSplice is installed at the ''/usr/local/opt'' folder) **For OpenJDK:** * ''# Setting OpenSplice in PATH'' * ''OSPL_HOME=/usr/local/opt/OpenSplice/HDE/x86_64.darwin10_clang'' * ''PATH=$OSPL_HOME/bin:$PATH'' * ''DYLD_LIBRARY_PATH=$OSPL_HOME/lib${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH'' * ''CPATH=$OSPL_HOME/include:$OSPL_HOME/include/sys:${CPATH:=}'' * ''OSPL_URI=file:%%//%%$OSPL_HOME/etc/config/ospl.xml'' * ''export OSPL_HOME PATH DYLD_LIBRARY_PATH CPATH OSPL_URI'' **For Oracle JDK:** * ''# Setting OpenSplice in PATH'' * ''OSPL_HOME=/usr/local/opt/OpenSplice/HDE/x86_64.darwin10_clang'' * ''PATH=$OSPL_HOME/bin:$PATH'' * ''JAVA_LIBRARY_PATH=$OSPL_HOME/lib${JAVA_LIBRARY_PATH:+:}$JAVA_LIBRARY_PATH'' * ''CPATH=$OSPL_HOME/include:$OSPL_HOME/include/sys:${CPATH:=}'' * ''OSPL_URI=file:%%//%%$OSPL_HOME/etc/config/ospl.xml'' * ''export OSPL_HOME PATH JAVA_LIBRARY_PATH CPATH OSPL_URI'' 5. To apply the changes, you can either restart the system, close and open the terminal or simple type on the terminal: * ''cd'' press Enter * ''source .bash_profile'' press Enter This will reload your .bash_profile content. ===== Final Remarks ===== For both operating systems, it is necessary to modify the file pointed by the ''OSPL_URI'' variable. In the case of Microsoft Windows, the file location is ''C:\OpenSplice\HDE\x86_64.win64\etc\config\ospl.xml'', while at GNU/Linux it is located at: ''/opt/OpenSplice/HDE/x86_64.linux%%/%%etc%%/%%config%%/%%ospl.xml''. Replace the file content by the following (you can also download the file by clicking in the tab): ospl_sp_ddsi 0 true ddsi2 durability cmsoap 256000 AUTO true true false lax false 2.5 0.1 ddsi2 * Auto