I try to use the sun grid engine with the DRMAA api by following the tutorial found at: http://gridscheduler.sourceforge.net/howto/drmaa_java.html. For this I need to load the c library located in /srv/sge/lib/lx24-amd64/drmaa.so. Now I execute my command with this code: java -jar scriptName.jar -Dshared.library.path=/srv/sge/lib/lx24-amd64/ as described in https://blogs.oracle.com/templedf/entry/drmaa_and_the_shared_library. But still I get the this exception:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no drmaa in java.library.path
This exception is thrown when trying to retrieve the session:
session = SessionFactory.getFactory().getSession();
OS is linux 64 bit, java is 64 bit and SGE is 64 bit, so this is all compatible.
Does anyone know what is going wrong?
The case seems to be that in some distributions the libdrmaa.so has a library version number libdrmaa.so.1.0 while the libdrmaa.so without version number is missing. The drmaa.jar seems to just look for the one without. You can check which of the libdrmaa.so libraries are available in your system using
Which (in my case) either says
or
The second case is the good one!
For Fedora distributions I reported this as a bug and it seems that they fix it in F18 and F19 soon. https://bugzilla.redhat.com/show_bug.cgi?id=671880
It is an easy fix in Fedora to simply install the package "gridengine-devel" where this soft-link is included.
If the libdrmaa.so without version number is not there and you are on another distribution, you can fix it manually as system administrator by typing