Getting Started
From Libcpu
Contents |
Get LLVM
Source
We are based on the release version of LLVM-2.6
./configure && make && make install
Binaries
Binaries of LLVM 2.8 can be downloaded from here (updated 2011-12-30).
The package expects to be extracted in root and will create the path opt/llvm/2.6 (or whatever the version is). You will want the following in your ~/.profile:
export PATH=/opt/llvm/2.6/bin/:$PATH
If you want to create a cross compiled version for MacOS X, you can use my build script.
Get libcpu from the repository
See Services.
Get cmake
CMake version 2.8 or higher is required. Unfortunately (as of January 3, 2010) Ubuntu's default CMake is still at 2.6.x, so you'll have to build it yourself.
On a Mac: install MacPorts, then
sudo port install cmake
You can also download a binary package of CMake for Mac OS X if you don't want to install MacPorts.
Other dependencies
You also need:
- Python 2.6
- Flex & Bison
Make sure, that you have installed them through your favorite package manager, if they don't ship with your OS distribution.
Building
make
If you just want to build, you won't interact with cmake directly: There is a standard "Makefile" that abstracts the build process.
Running Some Tests
6502: cbmbasic
test/scripts/cbmbasic.sh
It should show the "COMMODORE BASIC V2" banner and accept BASIC commands.
M88K/MIPS/ARM
There is a unified test that runs an iterative Fibonacci calculation both natively and in emulation, compared the results and prints out timing information. The following three wrapper scripts call it:
test/scripts/arm_fib.sh test/scripts/m88k_fib.sh test/scripts/mips_fib.sh
M88K/OpenBSD
./build/libcpu/run_m88k test/bin/m88k/openbsd/date
Subsitute "date" with other binaries form the same directory. Note that the first run will usually be slow and print some debug numbers in "{}". It creates a cache in /tmp/libcpu-*.entries, and subsequent runs will be faster.
You can try more binaries from here: http://ftp.eu.openbsd.org/pub/OpenBSD/4.1/mvme88k/
Bug Reporting
We have now a Bugtracker
