[torquedev] Libtorque on Mac OS X

Scott Wilson scott at epistemy.com
Fri Jul 16 02:33:14 MDT 2010

Where does it live? The closest I can find is src/Libpbs/libtorque.la - I can't find any libtorque.c in the src directory: I presume I'm looking in the wrong place or for the wrong thing.


Scott Wilson

On 16 Jul 2010, at 00:33, Joshua Bernstein wrote:

> Hi Scott,
> Sadly I haven't unpacked my new MBP yet, so I'm only able to build 
> TORQUE on OS X 10.5 where this doesn't seem to be a problem.
> You should be able to just add a #define as you suggest inside of the 
> libtorque C file, so the symbol is actually defined in there.
> -Josh
> Scott Wilson wrote:
>> Hello all,
>> 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?
>> Thanks,
>> Scott
>> *Scott Wilson*
>> Developer
>> *Epistemy*
>> Energy Academy
>> Riccarton
>> EH14 4AS
>> *tel: *+44 131 564 0232
>> Scott.Wilson at epistemy.com <mailto://scott.wilson@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
>> ------------------------------------------------------------------------
>> _______________________________________________
>> torquedev mailing list
>> torquedev at supercluster.org
>> http://www.supercluster.org/mailman/listinfo/torquedev
> _______________________________________________
> torquedev mailing list
> torquedev at supercluster.org
> http://www.supercluster.org/mailman/listinfo/torquedev

More information about the torquedev mailing list