Field now works on Linux
Field, the current source tree, now works on Linux. Thus this page is completely out of date and irrelevant. Until we switch over to the new repository, contact us directly (field@openendedgroup.com) to get added to the group of alpha testers.
Stop reading now.
How to port Field
Lot's of people want Field to work on platforms other than the Mac. We (at OpenEnded group) think that this is an excellent idea. But not only do we think that we're not the ones to do it — we've proved it. Despite the heroic work of other people (specifically Kerry Moffitt) we just can't seem to keep our eye on this ball. Our livelihoods as artists depend on Field working on the Mac, everything else is hard to keep on schedule.
Shall we give it another shot?
The rest of this page is very developery — if you want to use Field on Windows or Linux, there's nothing to see here yet. Sorry.
Where we're at
Currently we have integrated most (hopefully all) of the original work done on the Windows port — which, at the time, was work that generally applied to any other port. Because of that effort we were able to get FIeld on the screen executing print "hello world" when you option clicked on a box. In Windows. It was pretty cool, but horrible to look at (for the reasons below).
Render nodes
We've also recently made significant progress porting Field's scenegraph graphics library to Linux / Windows — this is really a much simpler task than porting all of Field's UI. We're interested in running multiple "render nodes" on more commodity (read: non-Apple) hardware while keeping the UI where it's always been. If this sounds interesting you should drop us a line.
Everything
Getting all of Field on either Windows or Linux is what most people would like to see. Both platforms share roughly the same key problems:
- Field depends on native code for a few things. Most of these are in 'extras' (for example OpenCL); some of them — the ones in field.util.MiscNative — are pretty optional. Already there these is an nativeAvailable variable that is designed to cause the whole thing to fail gracefully if the native library doesnt load. I wouldn't bother porting MiscNative.
- Field does depend on Apple's CoreImage for drawing images on the canvas (and then later processing them) and loading textures for its graphics system and this is in core. We can safely if (Platform.getOS()!=Platform.OS.mac) these out for now and replace some of this functionality later.
- Field uses the Quaqua look and feel which started off as Mac OS X only but recently works on Soy Latte / X11. Recently we redrew the handful of bitmaps that Field actually deploys and Field's color scheme has always been "different". It's possible, but untested, that Field actually has a platform independent look and feel now.
How to start
The first task is to clone the repository and get it compiling in Eclipse on Windows (or linux &c). There's the assumption that you'll be able to blast through much of this yourself. Field has all kinds of dependancies on all manner of jars and things — it's accreted a whole bunch of stuff over the years. But the real things that, without which Field will not work, are:
- JOGL — we're using the last of the 1.x series.
- JAI — there's some Java Advanced Imaging code in there. Not much, but you might as well install the latest version
- Mercurial — likewise, just install it.
- AppleJavaExtensions.jar — apple provide a stub jar that does nothing for their library that handles opening documents and being a good Mac desktop citizen. You should install these on your non-mac:
- Jython — it might be best if you install your own version of this as well.
There are other things that are more superfluous — iText pdf library and things like. You can find all the jars you need inside the field.app "bundle".
How to really start Field
The next task is to figure out how to get Field to actually run. A good thing to look at is the Info.plist for the (Mac only) field.app. Thats where the classpath for Field is setup and where all manner of command line options (in Java parlance -D options) are passed in.
Things which seem to be key:
- First of all, the class with the actual static public void main(...) — field.launch.Launcher
- Next some key properties -Dtrampoline.class=field.bytecode.protect.StandardTrampoline, -Dmain.class=field.Blank2. Field has a bytecode-rewriting classloader that needs to get in front of all of the class loading hence this little indirection.
- Some Jython related things: -Dpython.cachedir=, um, whatever is a good temp dir in Windows. -Dpython.path= should point to two 'colon or semicolon separated' things — the python directory "inside" field.app (where Field keeps it's python library and some .py files for talking to Field). And the "extensions" directory inside the field.app. Field won't start unless it can see things like FluidTools.py and TweakTools.py. And using Field won't be nearly as fun as it could be if it can't see the Python standard library that comes with Jython.
- The overlay window (a transparent window that Field uses to be able to draw things without repainting the main window) seems to cause issues — let's put -DnoOverlay=1.
- You'll need to edit field.core.Platform to provide a way of saying we're not on the Mac. Let this be your first contribution to the codebase!
We end up with a command line, on Linux, of something like:
java -Dpython.path=((something)) -Djava.library.path=/usr/lib/jni/ -classpath /home/marc/field/development/classes/:/home/marc/Desktop/AppleJavaExtensions/AppleJavaExtensions.jar:/home/marc/field/distribution/application/field.app/Contents/Resources/Java/asm-all-2.1.jar:/usr/share/java/jogl.jar:/home/marc/field/distribution/application/field.app/Contents/Resources/Java/jython-complete.jar:/usr/share/java/gluegen-rt.jar:/home/marc/field/distribution/application/field.app/Contents/Resources/Java/ field.launch.Launcher -trampoline.class field.bytecode.protect.StandardTrampoline -main.class field.Blank2
There are probably tweaks and additions that need to be made. If you have made it to the point of running Field and are looking at exceptions and stack-traces then you should be emailing marc 'at' openended group dot com frequently.
And
Field on Windows or Linux (or Java Web Start) would be fantastic. If you want to make it happen, we'll support you. And if you are the driving force behind it we'll give you all the kudos that one open source developer can give to another.