[torqueusers] Libtorque on Mac OS X

Scott Wilson scott at epistemy.com
Mon Jul 12 05:05:08 MDT 2010


On 12 Jul 2010, at 10:55, Mariusz Mamoński wrote:

> On 12 July 2010 10:52, Scott Wilson <scott at epistemy.com> wrote:
>> Hello all,
>> I've finally figured out enough JNI to get Dan Templeton's Sun Grid Engine
>> Java DRMAA bindings ported to TORQUE (a task made much easier by their
>> well-written nature), but I'm running into a problem when running them on
>> our OS X test system:
>> 
>> Exception in thread "main" java.lang.reflect.InvocationTargetException
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at
>> org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:56)
>> Caused by: java.lang.UnsatisfiedLinkError:
>> /Users/scott/Documents/jdrmaa/src/libdrmaa.jnilib:  Symbol not found:
>> _environ   Referenced from: /usr/local/lib/libtorque.2.dylib   Expected in:
>> flat namespace  in /usr/local/lib/libtorque.2.dylib
>> at java.lang.ClassLoader$NativeLibrary.load(Native Method)
>> at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1823)
>> at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1738)
>> at java.lang.Runtime.loadLibrary0(Runtime.java:823)
>> at java.lang.System.loadLibrary(System.java:1045)
>> at com.Epistemy.drmaa.SessionImpl$1.run(SessionImpl.java:64)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at com.Epistemy.drmaa.SessionImpl.<clinit>(SessionImpl.java:62)
>> at
>> com.Epistemy.drmaa.SessionFactoryImpl.getSession(SessionFactoryImpl.java:60)
>> at com.Epistemy.DRMAA.test.DRMAATest.main(DRMAATest.java:15)
>> ... 5 more
>> 
>> The test machine is an Intel Xeon XServe running Mac OS X Server version
>> 10.6.4 and TORQUE 2.4.8.
>> The problem seems to be that the _environ symbol, which is known to be
>> declared but not defined on OS X
>> (e.g. http://lists.apple.com/archives/Darwin-development/2003/Apr/msg00177.html
>> and follow ups). There is a simple workaround - add #define environ
>> (*_NSGetEnviron()) - to the library, which I've tried doing in my code to no
>> avail. I'm not experienced enough with C to be certain that this is any of
>> the TORQUE code, but it seems to be libtorque that's being expected to
>> provide _environ (although it isn't explicitly referenced from the C code I
>> compiled into libdrmaa.jnilib).
>> Does anyone have experience of using libtorque, either directly or through
>> the C DRMAA bindings, on Mac OS X 10.5 or 10.6? Does anyone know what files
> I have Mac OS X but  quite old Tiger release (10.4) and i do not
> observe such problems. Which DRMAA C bindings are you using: the
> newest one?

I believe the _environ variable was correctly made available (or at least not declared to be available) on 10.4 and prior. I'm using the DRMAA bindings that are created when you build TORQUE (2.4.8) with ./configure --enable-drmaa . I presume this means they are up to date - I haven't had any earlier versions of TORQUE or PBS installed.

>> I would need to edit in the source to add the workaround?
>> Thanks,
>> Scott
>> 
>> Scott Wilson
>> Developer
>> Epistemy
>> Energy Academy
>> Riccarton
>> EH14 4AS
>> 
>> tel: +44 131 564 0232
>> Scott.Wilson at epistemy.com
>> http://www.epistemy.com/
>> Epistemy Limited is a company registered in Scotland, number SC365481.
>> Registered office: Epistemy Limited c/o Technology and Research Services,
>> Heriot-Watt University, Riccarton, Edinburgh, EH14 4AS
>> 
>> _______________________________________________
>> torqueusers mailing list
>> torqueusers at supercluster.org
>> http://www.supercluster.org/mailman/listinfo/torqueusers
>> 
>> 
> 
> 
> BR,
> -- 
> Mariusz
> _______________________________________________
> torqueusers mailing list
> torqueusers at supercluster.org
> http://www.supercluster.org/mailman/listinfo/torqueusers

Scott

Scott Wilson
Epistemy


More information about the torqueusers mailing list