Installing Open Splice DDS
To develop ContextNet applications we need an implementation of the DDS (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 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 folderC:\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 theC:\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 andC:\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 OpenSplicex86_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 toopensplice.bat
to make it a batch executable file. - Run this file
opensplice.bat
as administrator (Right-click on the file and chooseRun 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 Entersource .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.xml
<OpenSplice> <Domain> <Name>ospl_sp_ddsi</Name> <Id>0</Id> <SingleProcess>true</SingleProcess> <Service name="ddsi2"> <Command>ddsi2</Command> </Service> <Service name="durability"> <Command>durability</Command> </Service> <Service enabled="false" name="cmsoap"> <Command>cmsoap</Command> </Service> <Listeners> <StackSize>256000</StackSize> </Listeners> </Domain> <DDSI2Service name="ddsi2"> <General> <NetworkInterfaceAddress>AUTO</NetworkInterfaceAddress> <AllowMulticast>true</AllowMulticast> <EnableMulticastLoopback>true</EnableMulticastLoopback> <CoexistWithNativeNetworking>false</CoexistWithNativeNetworking> </General> <Compatibility> <!-- see the release notes and/or the OpenSplice configurator on DDSI interoperability --> <StandardsConformance>lax</StandardsConformance> <!-- the following one is necessary only for TwinOaks CoreDX DDS compatibility --> <!-- <ExplicitlyPublishQosSetToDefault>true</ExplicitlyPublishQosSetToDefault> --> </Compatibility> </DDSI2Service> <DurabilityService name="durability"> <Network> <Alignment> <TimeAlignment>false</TimeAlignment> <RequestCombinePeriod> <Initial>2.5</Initial> <Operational>0.1</Operational> </RequestCombinePeriod> </Alignment> <WaitForAttachment maxWaitCount="10"> <ServiceName>ddsi2</ServiceName> </WaitForAttachment> </Network> <NameSpaces> <NameSpace name="defaultNamespace"> <Partition>*</Partition> </NameSpace> <Policy alignee="Initial" aligner="true" durability="Durable" nameSpace="defaultNamespace"/> </NameSpaces> </DurabilityService> <TunerService name="cmsoap"> <Server> <PortNr>Auto</PortNr> </Server> </TunerService> </OpenSplice>