I've got a 64-bit build of Starlink on my Mac and I'd like to be able
to load those libraries into java (and ship 64-bit osx in the next
Starlink release to so that people can use all their memory).
Now for the pain, by default on OSX it seems that java 1.5.x runs up
in 32-bit mode unless you use the -d64 command line option. The java
binary can run in 32-bit, 64-bit intel mode or 32-bit powerpc mode.
For java 1.6.x it looks like I only have a 64-bit mode java. I wonder
what Brad has on his 32-bit macbook...(all except the very first intel
macbooks support 64-bit mode). Currently the default java is 1.5.x but
that may change when Snow Leopard is released.
I have successfully built a jniast native binary in 64-bit mode using
java 1.6.x. I needed to manually tweak the src/jni/mk script to force
it to use "-arch x86_64".
For this to work properly though I think we need to automatically add
"-arch ${os.arch}" to the build so that the C code is compiled to
match the java mode. Also, how do I tell ant to use -d64 when building
(not a problem for java 1.6)? And possibly also change the system wide
starlink java so that it runs up in 64-bit mode.
Note that in principal all -arch options can be supplied at once. The
main problem with that is that the build system then tries to pull
apart the .a library from /star to get the object code so this fails.
Also, once we have all the jnilib libraries we can lipo them together
and have a single library to load and the OS will sort out which bit
to use. Probably not worth the effort given that it will still need to
understand how to load linux et al.
I have committed a patch to build.xml to let jniast know where to find
the jniast jar file.
--
Tim Jenness
Joint Astronomy Centre
|