Can the RTI dds examples run on Mac?

6 posts / 0 new
Last post
Gan
Offline
Last seen: 4 years 10 months ago
Joined: 08/08/2014
Posts: 17
Can the RTI dds examples run on Mac?

I've run them on Windows just fine, wondering if they're compatible with Mac. I remember the previous version not being able to run.

 

Thanks.

Fernando Garcia's picture
Offline
Last seen: 4 months 1 week ago
Joined: 05/18/2011
Posts: 198

Hi Gan,

Yes, most of RTI Connext DDS examples should run on Mac as well as on any other supported platform. You can go ahead and install the RTI Connext DDS host installer for Darwin and appropriate target for your Mac (i.e., x64Darwin12clang4.1 or x64Darwin14clang6.0). 

If you run into any problem, please let us know and we will help you figure out a solution. Also, out of curiosity, what problems did you have using previous versions of RTI Connext DDS on Mac?

Fernando.

Gan
Offline
Last seen: 4 years 10 months ago
Joined: 08/08/2014
Posts: 17

Hm. When I try to run the simple java example I get the error:

 

 

Matthews-MacBook-Pro:hello_simple Matt$ ./runPub.sh

 

The library libnddsjava.dylib could not be loaded by your operating system.

 

Exception in thread "main" java.lang.UnsatisfiedLinkError: no nddsjava in java.library.path

 

at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)

 

at java.lang.Runtime.loadLibrary0(Runtime.java:870)

 

at java.lang.System.loadLibrary(System.java:1119)

 

at com.rti.dds.util.NativeInterface.loadNativeLibrary(Unknown Source)

 

at com.rti.dds.util.NativeInterface.loadNativeLibraries(Unknown Source)

 

at com.rti.dds.domain.DomainParticipantFactory.<clinit>(Unknown Source)

 

at com.rti.simple.HelloPublisher.main(HelloPublisher.java:29)

 

Matthews-MacBook-Pro:hello_simple Matt$

 

Here's some of my environment variables: 

Matthews-MacBook-Pro:hello_simple Matt$ echo $NDDSHOME

/Applications/rti_connext_dds-5.2.0

Matthews-MacBook-Pro:hello_simple Matt$ echo $RTI_EXAMPLE_ARCH

x64Darwin12clang4.1

Matthews-MacBook-Pro:hello_simple Matt$ echo $RTI_JAVA_OPTION

-d64

 
Any idea why it's not running?
Fernando Garcia's picture
Offline
Last seen: 4 months 1 week ago
Joined: 05/18/2011
Posts: 198

Hi Gan,

I am able to reproduce your problem running Java 8 on OSX El Capitan. I have loading the same libraries Java 7 JRE that comes is shipped with RTI Connext DDS and it works fine. Are you running Java 8? You can test it like this:

$ `which java` -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

There are two main problems that RTI is addressing as part a fix to an issue called CORE-7070. There are two problems here:

  1. The Java Virtual Machine does not seem to automatically load libraries from the DYLD_LIBRARY_PATH. You need to explictly indicate the location from where to load libraries passing the -Djava.library.path argument when running Java (you will need to add it to runPub.sh and runPub.shas follows):
    #Run example
    $JAVA $RTI_JAVA_OPTION -Djava.library.path="$DYLD_LIBRARY_PATH" -classpath objs:"$NDDSHOME/lib/java/nddsjava.jar" com.rti.simple.HelloPublisher "$@"
  2. RTI Connext DDS libraries were not linked using the -install_name @loader_path/option and therefore when you apply the changes in 1, the JVM will only be able to load libnddsjava.dylib, which will not resolve its dependency on libnddsc.dylib and libnddscore.dylib. To work around this issue you can do the following:
    install_name_tool -change libnddsc.dylib @loader_path/libnddsc.dylib $DYLD_LIBRARY_PATH/libnddsjava.dylib
    install_name_tool -change libnddscore.dylib @loader_path/libnddscore.dylib $DYLD_LIBRARY_PATH/libnddsjava.dylib
    install_name_tool -change libnddscore.dylib @loader_path/libnddscore.dylib $DYLD_LIBRARY_PATH/libnddsc.dylib

Please let me know you can get the example to run using this workaround. The issue will be addressed in future RTI Connext DDS releases.

Thanks,
Fernando.

Gan
Offline
Last seen: 4 years 10 months ago
Joined: 08/08/2014
Posts: 17

Works wonderfully.

Offline
Last seen: 3 years 11 months ago
Joined: 11/10/2016
Posts: 1

Was this issue resolved? I still see this. Appreciate any help. Thanks.