[torquedev] Libtorque on Mac OS X
scott at epistemy.com
Thu Jul 15 02:02:47 MDT 2010
I've porting 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).
I've tried asking on TorqueUsers, but the only people with experience running TORQUE on Macs seem to be on 10.4 or earlier (where the problem doesn't manifest itself). Does anyone know what files I would need to edit in the source to add the workaround? I've had a look, but I only know enough to be dangerous when it comes to C. For that matter, should the workaround not be placed in the source when the configure script detects that the build is on a Mac?
tel: +44 131 564 0232
Scott.Wilson at 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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the torquedev