Building Open Einstein

This post has already been read 12809 times!

Here are some more detailed instructions on getting Open Einstein built on MacOSX Intel, using the JAM complier and targeting the Nokia 770. I also built it for MacOSX, to run locally on my macbook.

The published directions are here, and you should read them first and familiarize yourself with them.

Install MacPorts

* MacPorts-1.5.0-10.4.dmg

Open a terminal and then use macports to install the following packages:

$ sudo port install gettext
$ sudo port installlibffi
$ sudo port install jam
$ sudo port install arm-none-linux-gnueabi-gcc

Then you must add

/opt/local/bin

to your $PATH on the Mac (edit .bash_login in your home directory), then restart your terminal or read in the new bash_profile.

Pull down Klibs and Build

K is located at SourceForge (http://sourceforge.net/projects/KLibs/)

$ cvs -d:pserver:anonymous@klibs.cvs.sourceforge.net:/cvsroot/klibs login 
[Enter] for password

$ cvs -z3 -d:pserver:anonymous@klibs.cvs.sourceforge.net:/cvsroot/klibs co -P K

$ cd $PATH_TO_KLibs/_Build_/Jam

$ jam -starget=nokia2006

Klibs should build with out problems. If you want to build for the Mac, just leave off the -starget parameter.

Pull down Open Einstein and Build

$ svn checkout http://einstein.googlecode.com/svn/trunk/ einstein

$ cd einstein/Einstein/_Build_/Jam

$ jam -sK=$PATH_TO_KLibs -starget=nokia2006 -sjittarget=GENERIC

Now there is a new folder in the /_Build_/Jam directory called build.ARM-LINUX-Nokia2006. This folder will contain the einstein binary for the Nokia 770.

Move files over to 770

You need three files:

  • einstein – the ARM binary of einstein.
  • Einstein.rex – the ROM extension for einstein (it has the NewTest app to test your emulation speed).
  • ROM file – the actual ROM file from a newton. Read the Open Einstein Manual on how to create one using your existing Newton and a Tcp/Ip connection.
  • [You should set up sshd on 770, change password of ‘user’ to something you know, change the ip address below to match your 770 local ip. Use ifconfig -a to check the local 770 ip.]

    Now copy the files:

    $ scp $PATH_TO_EINSTEIN/_Build_/Jam/build.ARM-LINUX-Nokia2006/einstein user@192.168.155.155:
    $ scp $PATH_TO_EINSTEIN/_Data_/Einstein.rex user@192.168.155.155:
    $ scp $NEWTON_ROM user@192.168.155.155:
    

    Once they are copied over, you can start Open Einstein like this:

    /home/user # ./einstein -l log2 -m 737041 .
    Welcome to Einstein console.
    This is Einstein Platform 2007.
    Creating image...
    Max units count = 986
    Max units count = 1026
    Booting...
    Type help for help on available commands.
    einstein> power
    

    And you should see the Newton Start up on your device. Below is a screen shot of the Newton running on my MacBook, in Xwindows:

    oe_mac_1.png

    10 thoughts on “Building Open Einstein

    1. […] Building Open Einstein Here are some more detailed instructions on getting Open Einstein built on MacOSX Intel, using the JAM complier and targeting the Nokia 770. I also built it for MacOSX, to run locally on my macbook. […]

    2. I just built it using your exact instructions above, and it the binary runs on the N800 fine. However, it never seems to open a display.

      I’m using the 717006 ROM, and I can get as far as the einstein> prompt, but issuing the “power” command doesn’t cause the UI to appear. In fact, nothing happens.

      Any ideas on what I should try?

    3. It found my Xlibs automatically… so did it build or not?

      Also, I’m assuming you built Klib beforehand.

    4. 770NoBuild

      OK, sorry for the voluminous comments, I thought I was too tired to fix it myself, and I was almost right. :-) I caused the second problem by editing the Jamfile to have C++FLAGS += “-I/usr/X11R6/include/X11”

    5. 770NoBuild

      Whoops, noticed the No such file complaints about the X headers, so I installed the X11 SDK, and no I get loads of these errors:

      from ../../app/TCLIApp.cp:53:
      /opt/local/lib/gcc/arm-none-linux-gnueabi/3.4.4/../../../../arm-none-linux-gnueabi/sys-include/wctype.h:245: error: `__locale_t’ has not been declared
      /opt/local/lib/gcc/arm-none-linux-gnueabi/3.4.4/../../../../arm-none-linux-gnueabi/sys-include/wctype.h:251: error: `__locale_t’ has not been declared
      /opt/local/lib/gcc/arm-none-linux-gnueabi/3.4.4/../../../../arm-none-linux-gnueabi/sys-include/wctype.h:254: error: `__locale_t’ has not been declared
      /opt/local/lib/gcc/arm-none-linux-gnueabi/3.4.4/../../../../arm-none-linux-gnueabi/sys-include/wctype.h:258: error: `__locale_t’ has not been declared
      /opt/local/lib/gcc/arm-none-linux-gnueabi/3.4.4/../../../../arm-none-linux-gnueabi/sys-include/wctype.h:262: error: `__locale_t’ has not been declared
      /opt/local/lib/gcc/arm-none-linux-gnueabi/3.4.4/../../../../arm-none-linux-gnueabi/sys-include/wctype.h:267: error: `__locale_t’ has not been declared
      /opt/local/lib/gcc/arm-none-linux-gnueabi/3.4.4/../../../../arm-none-linux-gnueabi/sys-include/wctype.h:270: error: `__locale_t’ has not been declared
      /opt/local/lib/gcc/arm-none-linux-gnueabi/3.4.4/../../../../arm-none-linux-gnueabi/sys-include/wctype.h:275: error: `__locale_t’ has not been declared
      /opt/local/lib/gcc/arm-none-linux-gnueabi/3.4.4/../../../../arm-none-linux-gnueabi/sys-include/wctype.h:280: error: `__locale_t’ has not been declared
      /opt/local/lib/gcc/arm-none-linux-gnueabi/3.4.4/../../../../arm-none-linux-gnueabi/sys-include/wctype.h:285: error: `__locale_t’ has not been declared
      /opt/local/lib/gcc/arm-none-linux-gnueabi/3.4.4/../../../../arm-none-linux-gnueabi/sys-include/wctype.h:290: error: `__locale_t’ has not been declared
      /opt/local/lib/gcc/arm-none-linux-gnueabi/3.4.4/../../../../arm-none-linux-gnueabi/sys-include/wctype.h:295: error: `__locale_t’ has not been declared
      /opt/local/lib/gcc/arm-none-linux-gnueabi/3.4.4/../../../../arm-none-linux-gnueabi/sys-include/wctype.h:299: error: `__locale_t’ has not been declared
      /opt/local/lib/gcc/arm-none-linux-gnueabi/3.4.4/../../../../arm-none-linux-gnueabi/sys-include/wctype.h:304: error: `__locale_t’ has not been declared
      /opt/local/lib/gcc/arm-none-linux-gnueabi/3.4.4/../../../../arm-none-linux-gnueabi/sys-include/wctype.h:313: error: `__locale_t’ has not been declared
      /opt/local/lib/gcc/arm-none-linux-gnueabi/3.4.4/../../../../arm-none-linux-gnueabi/sys-include/wctype.h:316: error: `__locale_t’ has not been declared
      /opt/local/lib/gcc/arm-none-linux-gnueabi/3.4.4/../../../../arm-none-linux-gnueabi/sys-include/wctype.h:320: error: `__locale_t’ has not been declared
      /opt/local/lib/gcc/arm-none-linux-gnueabi/3.4.4/../../../../arm-none-linux-gnueabi/sys-include/wctype.h:325: error: `__locale_t’ has not been declared

      arm-none-linux-gnueabi-g++-2005q3 -c -o “build.ARM-LINUX-Nokia2006/TCLIApp.cp.o” -I/usr/X11R6/include/X11 -DTARGET_OS_LINUX=1 -Wall -Wno-multichar -Wno-unknown-pragmas -W -Wshadow -Wpointer-arith -Wwrite-strings -Wconversion -DRELEASE=1 -DPA_USE_COREAUDIO=0 -DPA_LITTLE_ENDIAN=1 -DWORDS_LITTLEENDIAN=1 -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=4 -I../../libffi-nokia2006/include -O -I”/Users/peter/K” -I”../../portaudio//pa_common” -I”../..” -I”../../Emulator” -I”../../Emulator/JIT” -I”../../Emulator/ROM” -I”../../Emulator/Screen” -I”../../Emulator/Serial” -I”../../Emulator/Sound” -I”../../Monitor” -I”../../_Tests_” -I”../../app” -I”../../Emulator/JIT/Generic” “../../app/TCLIApp.cp”

      …failed C++ build.ARM-LINUX-Nokia2006/TCLIApp.cp.o …
      …skipped einstein for lack of libeinstein.a…
      …failed updating 3 target(s)…
      …skipped 3 target(s)…

      Help?

    6. 770NoBuild

      Thanks for the directions, I followed them but did not get a binary. Instead I get the following failure, any help greatly appreciated!

      –Peter

      …found 515 target(s)…
      …using 63 temp target(s)…
      …updating 6 target(s)…
      C++ build.ARM-LINUX-Nokia2006/TX11ScreenManager.cp.o

      arm-none-linux-gnueabi-g++-2005q3 -c -o “build.ARM-LINUX-No
      kia2006/TX11ScreenManager.cp.o” -I/usr/X11R6/include/ -DTARGET_OS_L
      INUX=1 -Wall -Wno-multichar -Wno-unknown-pragmas -W -Wshadow -Wpoin
      ter-arith -Wwrite-strings -Wconversion -DRELEASE=1 -DPA_USE_COREAUD
      IO=0 -DPA_LITTLE_ENDIAN=1 -DWORDS_LITTLEENDIAN=1 -DSIZEOF_SHORT=2 –
      DSIZEOF_INT=4 -DSIZEOF_LONG=4 -I../../libffi-nokia2006/include -O
      -I”/Users/peter/K” -I”../../portaudio//pa_common” -I”../..” -I”../.
      ./Emulator” -I”../../Emulator/JIT” -I”../../Emulator/ROM” -I”../../
      Emulator/Screen” -I”../../Emulator/Serial” -I”../../Emulator/Sound”
      -I”../../Monitor” -I”../../_Tests_” -I”../../app” -I”../../Emulato
      r/JIT/Generic” “../../Emulator/Screen/TX11ScreenManager.cp”

      …failed C++ build.ARM-LINUX-Nokia2006/TX11ScreenManager.cp.o …
      …skipped libeinstein.a for lack of libeinstein.a(TX11ScreenManage
      r.cp.o)…
      C++ build.ARM-LINUX-Nokia2006/UScreenTests.cp.o

      arm-none-linux-gnueabi-g++-2005q3 -c -o “build.ARM-LINUX-No
      kia2006/UScreenTests.cp.o” -I/usr/X11R6/include/ -DTARGET_OS_LINUX=
      1 -Wall -Wno-multichar -Wno-unknown-pragmas -W -Wshadow -Wpointer-a
      rith -Wwrite-strings -Wconversion -DRELEASE=1 -DPA_USE_COREAUDIO=0
      -DPA_LITTLE_ENDIAN=1 -DWORDS_LITTLEENDIAN=1 -DSIZEOF_SHORT=2 -DSIZE
      OF_INT=4 -DSIZEOF_LONG=4 -I../../libffi-nokia2006/include -O -I”/U
      sers/peter/K” -I”../../portaudio//pa_common” -I”../..” -I”../../Emu
      lator” -I”../../Emulator/JIT” -I”../../Emulator/ROM” -I”../../Emula
      tor/Screen” -I”../../Emulator/Serial” -I”../../Emulator/Sound” -I”.
      ./../Monitor” -I”../../_Tests_” -I”../../app” -I”../../Emulator/JIT
      /Generic” “../../_Tests_/UScreenTests.cp”

      …failed C++ build.ARM-LINUX-Nokia2006/UScreenTests.cp.o …
      …skipped EinsteinTests for lack of libeinstein.a…
      C++ build.ARM-LINUX-Nokia2006/TCLIApp.cp.o

      arm-none-linux-gnueabi-g++-2005q3 -c -o “build.ARM-LINUX-No
      kia2006/TCLIApp.cp.o” -I/usr/X11R6/include/ -DTARGET_OS_LINUX=1 -Wa
      ll -Wno-multichar -Wno-unknown-pragmas -W -Wshadow -Wpointer-arith
      -Wwrite-strings -Wconversion -DRELEASE=1 -DPA_USE_COREAUDIO=0 -DPA_
      LITTLE_ENDIAN=1 -DWORDS_LITTLEENDIAN=1 -DSIZEOF_SHORT=2 -DSIZEOF_IN
      T=4 -DSIZEOF_LONG=4 -I../../libffi-nokia2006/include -O -I”/Users/
      peter/K” -I”../../portaudio//pa_common” -I”../..” -I”../../Emulator
      ” -I”../../Emulator/JIT” -I”../../Emulator/ROM” -I”../../Emulator/S
      creen” -I”../../Emulator/Serial” -I”../../Emulator/Sound” -I”../../
      Monitor” -I”../../_Tests_” -I”../../app” -I”../../Emulator/JIT/Gene
      ric” “../../app/TCLIApp.cp”

      …failed C++ build.ARM-LINUX-Nokia2006/TCLIApp.cp.o …
      …skipped einstein for lack of libeinstein.a…
      …failed updating 3 target(s)…
      …skipped 3 target(s)…

    7. Well I’m definitely running the latest version of 2007 :/

      that’s too bad. Maybe I’ll give it a shot, after I finish the other 2 N800 projects I keep putting off ;)

    8. Then again, if you have ITOS 2006 on your N800, it should work fine.

    9. Paul G. says no, not with out a little hacking. His quote from http://code.google.com/p/einstein/wiki/
      NokiaBuildInstructions:

      “I believe that the Nokia 800 with OS2007 has a different version of libXau. It’s now libXau.so.6 instead of libXau.so.0. The above method will compile against libXau.so.0 (which I directly copied from a Nokia 770 with OS2006), and therefore the binary will not run. I would be grateful if someone with a Nokia 800 and OS2007 could check that and possibly fix the problem by either:

      1. Create a specific nokia2007 target with the new libXau
      2. or try to use -L instead, so that the binary will run on both platforms and dynamically choose the proper binary. ”

      If you have a N800 w/ 2007 it sounds like you can try– I’m sure Paul will help. Hopefully he sees this post and may reply to it.

    10. Will this also work for N800, do you think?

    Leave a Reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.