General remarks
Einstein relies on a framework called "K" which is included in the SVN repository. It is built using Xcode or Perforce Jam.
For now, the Einstein ROM Extension (REX) can only be built using Apple Newton C++ Tools and Apple Newton Toolkit, available on UNNA as part of the NewtonDev environment and running in Mac OS 9 or Classic on Mac OS X.
For your convenience, a binary of the Einstein REX is available under the _Data_/ directory.
Building on MacOS X, for MacOS X, using Xcode 3
- Get the latest Xcode from Apple and install it.
- Open Einstein.xcodeproj, located in _Build_/Xcode3
- Choose "Einstein" as your Active Target.
- Build!
Building on MacOS X, for iOS 3.2 and up, using Xcode 3
- Get the latest Xcode with iOS SDK from Apple and install it.
- Open Einstein.xcodeproj, located in _Build_/Xcode3
- Choose "iOSEinstein" as your Active Target.
- From the same menu, choose whether you are building for Simulator or Device (actual hardware).
- From the same menu, choose either iPad or iPhone as a target. (for example: iPhone Simulator 4.2)
- due to a bug in Xcode, the iPad emulator version will not launch correctly - the iPhone simulator however will
- due to another bug, once you built an iOS version, you can not switch back to build a native OS X version. If you want to switch back to native development, you must hold down the Alt key when clicking on the 'Overview' pulldown menu
- Build!
About the ROM
Einstein requires an 8 MB Newton ROM dump image (8,388,608 bytes exactly) to run. Please see DumpingTheRom for more information about extracting the ROM image from your owned Newton device.
Development efforts are currently concentrated on the 717006 ROM, which corresponds to Apple's last official release of Newton OS -- version 2.1.
For iOS builds, it must be named 717006.rom and in the application's Documents folder at runtime.
For the iOS simulator, the path to this file will be something like: /(Home)/Library/Application Support/iPhone Simulator/(SDK Version)/Applications/(Einstein UUID)/Documents/717006.rom
For running on an iOS device, use iTunes to copy the ROM file to the device as described on the iOS page.
For running on Mac OS X, the ROM file can be selected at runtime.
An MD5 checksum of a known working ROM dump is 70dc5f5f3102e44f15dc93f356b98add.
Building on Unix (including MacOS X) and Cygwin, as a native build, using Jam
- Install Jam 2.5. Not btjam, not ftjam, regular jam. You can get it from MacPorts on MacOS X. On Ubuntu, the debian package jam is fine. You can also compile it from source: ftp://ftp.perforce.com/pub/jam/jam-2.5.zip
- Make sure you have libstdc++-devel installed as well.
- K is part of the repository. You may have to update Makefiles. Unfortunately it vanished from SourceForge
- Compile K with Jam with cd <path_to_K>/_Build_/Jam/ && jam
- Get libffi. On MacOS X, I suggest getting with MacPorts. There seem to be pre-built copies for various platforms in the Einstein project in svn too.
- Compile Einstein with Jam with cd <path_to_einstein>/_Build_/Jam/ && jam -sK=<path_to_K> or cd <path_to_einstein>/_Build_/Jam/ && jam -sK=<path_to_K> -sC++FLAGS=-I/path/to/libffi/include -sCCFLAGS=-I/path/to/libffi/include -sLINKFLAGS=-I/path/to/libffi/include if libffi isn't installed in a standard path that the compiler will find. For example:
jam -sjittarget=generic -sC++FLAGS="-I/usr/local/include -I/root/einstein/Einstein/libffi-linux/include/ -L/root/einstein/Einstein/libffi-linux/lib" -sCCFLAGS="-I/usr/local/include -I/root/einstein/Einstein/libffi-linux/include/ -L/root/einstein/Einstein/libffi-linux/lib" -sK=/root/K/
Notes
If you got libffi with MacPorts as suggested, you don't need to specify its path on the command line. You will very probably need to edit the Jamfile to cope with your target.
On Unix (including MacOS X), as cross build, using Jam
The general method is the following:
- Install Jam 2.5. Not btjam, not ftjam, regular jam. You can get it from MacPorts on MacOS X. On Ubuntu, the debian package jam is fine. You can also compile it from source: ftp://ftp.perforce.com/pub/jam/jam-2.5.zip
- Get K (preferably from CVS) at http://sourceforge.net/projects/KLibs/
- Edit K's Jamfile so it will work with your setup.
- Compile K with Jam with cd <path_to_K>/_Build_/Jam/ && jam -starget=<cross_target>
- Edit Einstein's Jamfile so it will work with your setup.
- Compile Einstein with Jam with cd <path_to_einstein>/_Build_/Jam/ && jam -sK=<path_to_K> -starget=<cross_target>
How I built cross-binaries
- OpenZaurus 3.4.5: with crosstool compilers, cf OpenZaurusBuildInstructions.
- Nokia 770 OS 2005: with crosstool compilers (built with gcc3 on the Mac).
- Debian x86: with crosstool compilers.
- Nokia 770/800 OS 2006: with Code Sourcery compilers ported with MacPorts, cf NokiaBuildInstructions.
Building on OS X 10.5 using X Code and K from CVS I got 19 errors relating to missing symbols - fns that were actually in the K source tree , but not being seen... I had to add the K (Static - Release) framework by 1. Going to the 'Targets' tab, 2. Right clicking on the 'link binary with libraries' option 3. Choose 'Add existing frameworks', 4. Add a framework not from the list, select the K (Static - Release) in <K>K/Build/Xcode/build/K.build/Default/K\ OSX\ \(Static\ -\ Release\).build
It does add 70 or so files - so I am sure this isn't really the right solution! It does work, but it'd be nice to know the 'correct' way
Building on Ubuntu 8.10 using the provided ffi didn't work, I had to install libffi-dev and then it built without errors(note that everything except libeinstein and einstein had built before)
I haven't got it to work yet, the emulator runs but no window shows up - but I thought someone else might appreciate the news about building...
Finally built today on Debian Lenny. K libs definately must come from cvs - I could not get another version from another set of build instructions to compile.
Running a 717006 ROM image built from debug, loads and attempts to boot successfully using 2007.07 in wine, but the native Linux build complains about a corrupt Einstein.rex.
Substituting Einstein.rex from Data (included with source) or Einstein.rex from Windows 2007.07 build yield the same result.
Checked permissions, line endings on .source file, where I noticed the requirement for building in MPW.
I'm downloading an MPW image to run under BasiliskII, but I'd like to know this is necessary.
Here's the MD5 sum of my Einstein.rex: 06e0a0a4134e950d561506dda0e1b01a
Where did KLibs go? Sourceforge gives a 404. :-(
KLibs appear to now be included in the main SVN repository for Einstein and do not require a separate download.
juddy@juddy.org: All distributions contain a working Einstein.rex . It is possible to recompile this, but it requires quite some setup in BasiliskII.
I fail at building for iOS. pls anyone give me the binaries for iOS 4.0, my email is XX vladkorotnev XX AT XX gmail DOT com
remove XX and spaces and replace at with "@" and DOT with "."
I have the 717006.aif ROM file that worked with Einstein 2006.6, originally sourced from the Lantern DDK. However, the iPhone/iPad build of Einstein really doesn't like this file. Any ideas how I can get it working with this build of Einstein? Thanks.
I am looking to build Einstein for iOS 4 to use on my iPod touch. I am having trouble locating the X-code project necessary to build the application. Does anybody know where I can find this file, and the necessary dependencies that I would need? I have 64-bit Xcode 3.2.3 on my mac. Any help would be really great!
Never mind, I figured it out.
I'm trying to dump the ROM from my MessagePad?. Where can I find the ROM Dumper package mentioned in the User Manual.
Does this work on iOS 3.1.3? I tried to compile it, but it just starts a black screen then crashes...
Where are the Jam targets for Windows, or is the Windows build from MS Visual C? Any objections if I use Open Watcom compiler for Windows for Jam?
How exactly does one go about building this on Linux these days. The version of KLibs that's included seems to have no sort of build environment for Jam and I just can't get a build to finish...
The Jam targets are for OS X command line and should work for Linux as well. I am not sure about Cygwin on MS Windows. I don't know Jam enough. Remember that the project was created pre 2007 and the Jam files were not updated since AFAIK. The MS Windows version uses FLTK for its user interface and compiles using Visual STudio (2005, IIRC).
I have no objections to any compiler you like to use. If you manage to set up a new build environment without too many changes to the source code and conforming to the existing style, please send it to me and I will add it to the repository.
madcrow.maxwell: The K libraries can still be downloaded from the CVS repository mentioned above and can be built using their own environment. The included K files are for building with Xcode.
gopiballava: the current iOS (iPhone) build on Oct 4th 2010 does not supportROM files in debug image format.
Is ROMDumper.pkg meant to be in Drivers -> packages. If so, it's not there in the source tree. Does anyone know where I can download this from.
Never mind. I found the ROMDumper.pkg. I was looking for it in the source tree and not in the EinsteinPlatform?.
Hi ppl, does anyone know if Einstein for iPhone support Debugger Images now?
Not yet. Once it does, it will show in the RSS feed.
Btw., you can still get "K libs" from sourceforge: http://sourceforge.net/projects/klibs/ (note the spelling with the small "k" - someone should update the README)