Skip to content

Linux (x86) build and run instructions

Matthias Melcher edited this page Feb 5, 2022 · 6 revisions

Note: Please check BUILDING.md for the most current build instructions.

NB: this is NOT for cross-compilation.

Einstein currently only runs correctly on 32-bit platforms. Chances are, if you installed your Linux distribution since 2012 or so, you are running a 64-bit (x86_64 or amd64) native kernel and have mostly 64-bit native libraries and tools installed. Until Einstein is updated to be 64-bit clean, you will need to install the 32-bit editions of the necessary libraries and tools in order to build Einstein. This architecture will probably be called i686, but it could also be i586 or "i386", depending on your distribution.

Installing prerequisites

Install these packages and any prerequisites your package manager tells you to install.

Fedora Linux

sudo dnf install gcc gcc-c++ cmake git
sudo dnf --forcearch=i686 install libc-devel libstdc++-devel libffi-devel libX11-devel libXau-devel pulseaudio-libs-devel

CentOS

sudo yum install gcc gcc-c++ cmake git
sudo yum install libc-devel.i686 libstdc++-devel.i686 libffi-devel.i686 libX11-devel.i686 libXau-devel.i686 pulseaudio-libs-devel.i686

Compiling

  1. Clone the Einstein repo somewhere using git. Let's call this directory [repo-dir]
  2. cd [repo-dir]/_Build_/CMake
  3. ./build.sh to run cmake and then compile. If this succeeds, you will end up with an einstein binary in the current directory.

Compiling for developers

  1. ./build.sh debug will compile einstein with debugging symbols.
  2. You can change the cmake options by running ccmake -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-32-linux.cmake ../..

Environment setup

Before you run Einstein for the first time, it is a good idea to setup a directory to contain the files that Einstein requires, such as your ROM file.

  1. Create a directory, for example, $HOME/.einstein/
  2. Copy your ROM file to this directory, and name it 717006
  3. Copy [repo-dir]/_Data_/Einstein.rex to this directory.
  4. Set the environment variable EINSTEIN_HOME, eg. put the line export EINSTEIN_HOME=$HOME/.einstein/ in your ~/.bash_profile file, assuming you use bash as your shell.
  5. Logout and login again, or, from your current terminal, run . ~/.bash_profile to refresh your environment variables.

Run the emulator

  1. Open a terminal.
  2. [repo-dir]/_Build_/CMake/einstein --help to print command-line help.
  3. Run the emulator as [repo-dir]/_Build_/CMake/einstein and it will open a new window for the Newton screen, and give you an einstein> prompt in the terminal. Type help in the terminal to see help.