Skip to content

Build Instructions

Paul Guyot edited this page Mar 16, 2021 · 33 revisions

General remarks

Einstein can currently be built for:

  • macOS and iOS using Xcode
  • Linux using CMake
  • (deprecated) Linux using Perforce Jam
  • Android using Android Studio

To run, Einstein requires a specially compiled Newton ROM extension (REx) file, and a Newton ROM dump.

Please see Known Issues for some issues you may encounter while running Einstein.

About the ROM extension (REx)

For your convenience, a pre-built binary of the Einstein REx is included under the _Data_ directory. (Note: The REx is not the ROM. We cannot distribute the ROM. Please read "About the ROM" below.)

On macOS and iOS builds, the REx is automatically copied into the Einstein app bundle, you don't need to worry about it. On Linux builds, the REx file must be copied into Einstein's data directory. You specify a path to this directory at runtime.

The source code to the REx is in the "Drivers" directory. Please see Building-Rex to build it.

About the ROM

Einstein requires an 8 MB Newton ROM dump image (8,388,608 bytes exactly) to run. Please see Dumping The Rom 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 an iOS device, use iTunes File Sharing to copy the ROM file to the device as described on the iOS page.

If you are running the iOS build in the simulator and the ROM file is missing, a message will be logged to the Xcode console that tells you the path where the ROM file should be copied to.

For macOS, the ROM file can be located at runtime.

On Linux builds, the ROM file must be copied into Einstein's data directory. You specify a path to this directory at runtime.

An MD5 checksum of a known working ROM dump is 70dc5f5f3102e44f15dc93f356b98add.

Building on macOS, for macOS, using Xcode

  1. Get the latest Xcode from Apple and install it.
  2. Open Einstein.xcodeproj, located in _Build_/Xcode
  3. Choose Einstein as your Active Target.
  4. Build!

Building on macOS, for iOS, using Xcode

  1. Get the latest Xcode with iOS SDK from Apple and install it.
  2. Open Einstein.xcodeproj, located in _Build_/Xcode
  3. Choose iOSEinstein as your Active Target.
  4. From the same menu, choose whether you are building for Simulator or Device (actual hardware).
  5. Build!

If you are running on an iOS Device, you will need to copy the ROM file to the device using iTunes File Sharing.

If you are running in the iOS Simulator, a message in the Xcode console will tell you the path you need to copy the ROM file to.

Building on Linux, for Linux

See Linux (x86) build and run instructions for instructions using CMake.

Building on Linux with Jam (deprecated)

The following build process has been tested on a virtual machine running a completely fresh install of Ubuntu 16.04.1 Desktop (64-bit) configured with 2 GB of RAM. You may have trouble building with less RAM.

  • Install dependencies
    • sudo apt install git
    • sudo apt install jam
    • sudo apt install gcc-multilib
    • sudo apt install g++-multilib
    • sudo apt install libx11-dev
    • sudo apt install libx11-dev:i386
    • sudo apt install portaudio19-dev
    • sudo apt install libexpat-dev
  • Clone the Einstein repository
    • git clone https://github.com/pguyot/Einstein.git
  • Build the "K" supporting library
    • cd Einstein/K/_Build_/Jam
    • jam
      • Expect quite a few warnings and other messages
      • If you see a message failed Link build.LINUX/KLibsTests ... failed updating 1 target(s), that's OK, as long as ./build.LINUX/libk.a now exists
  • Build Einstein
    • cd ../../../_Build_/Jam
    • jam -starget=linux -sjittarget=generic -sC++FLAGS="-I../../libffi-linux/include -L../../libffi-linux/lib" -sCCFLAGS="-L../../libffi-linux/lib"
      • Expect quite a few warnings and other messages
      • This might take a few minutes! Be patient!
      • build.LINUX/einstein should now exist
  • Now to run it
    • cd build.LINUX
    • mkdir data
    • cp ../../../_Data_/Einstein.rex data/
    • (copy your Newton ROM file named "717006" to data/)
    • LD_LIBRARY_PATH=../../../libffi-linux/lib
    • export LD_LIBRARY_PATH
    • ./einstein data

Building for Android using AndroidStudio 3

You will need AndroidStudio 3 or higher installed on you developer machine. I use a Mac, but Windows and Linux should work just as well. In AndroidStudio, install an Android SDK (Nougat 7.0 or higher) and the corresponding NDK (on the Mac, this is in the AndroidStudio Menu Preferences, in the dialog tree "Appearence & Behaviour >> System Settings >> Android SDK", in the tab "SDK Platforms", "check Android 7.0 (Nougat)", and in the tab "SDK Tools", check "NDK". Click "OK" and let it all install).

Next, clone the Einstein repository using "git" or whatever other tool you like: git clone https://github.com/pguyot/Einstein.git

In AndroidStudio, select "File >> Open..." and navigate to the Einstein repository, the "_Build_/AndroidStudio". Click "OK" and AndroidStudio will load the entire Einstein project.

Click on "Run", the green triangle in the top right menubar. The "Select Deployment Target" dialog will open. Here, you can either connect to an Android device in Developer mode via USB, or use (or create) an Android Virtual Device for debugging on your host computer. Remember that the virtual device will also need the Newton ROM and Einstein Rex in /sdcard/Dowload/Einstein. They are typically named '717006.rom' and 'Einstein.rex'.

To generate a Package that others can download to their devices, you need to obtain a Key for signing the APK and then run "Build >> Generate Signed APK..."

Legacy builds

Legacy Build Instructions for currently unmaintained platforms are available.