Catapult Compilation Guide

Contents

  1. 1. Introduction
    1. 1.1. New Versions of this Document
    2. 1.2. Purpose
    3. 1.3. Contributors
    4. 1.4. Revision History
  2. 2. Getting the Source Code
    1. 2.1. Released Version
    2. 2.2. CVS Checkout
    3. 2.3. CVS Snapshot
  3. 3. Compilation
    1. 3.1. Build Tools
    2. 3.2. Libraries
    3. 3.3. Compilation of the Libraries
    4. 3.4. Compilation Itself
  4. 4. Installation
  5. 5. Next Steps
  6. 6. Contact Info

1. Introduction

1.1. New Versions of this Document

The latest version of the openMSX Catapult manual can be found on the openMSX home page:

http://openmsx.sourceforge.net/catapult-manual/

The latest version of the openMSX manual can also be found there:

http://openmsx.sourceforge.net/manual/

You can also use these URLs to get up-to-date versions of the hyper links if you printed out this manual.

1.2. Purpose

This guide is about Catapult, the (optional) GUI for openMSX. You can find more information about openMSX on the openMSX home page. You can also download the emulator itself from there.

openMSX is in alpha state, which means that some things work but not all features are implemented yet. Many emulation features are implemented, but in terms of user interface it is rather bare bones. That's why we decided to create a GUI for it, so most users can use it a little bit more comfortably. For people who want to (or have to) compile Catapult themselves, we have written this guide. It explains how you can get it running on your system, i.e. how to get the sources and compile them. Note that some software distributions may have packaged openMSX Catapult and will enable you to install it directly using package management tools. We refer to the documentation of the tools of the distribution you are using to install openMSX Catapult. If you use such a package, you can skip the largest part of this manual and start reading at chapter 5. Next Steps.

This guide describes how you can get the openMSX sources and compile them. The level of support for compilation depends on the operating system:

Linux
Most openMSX developers run some form of Linux, so this is the platform on which compilation is supported best. Compilation instructions for Linux are mostly also valid for other UNIX-like operating systems.
Windows
Most Windows users will just download the binary release. But if you want to follow the latest developments or like to play with the code a bit, it is possible to compile Catapult on Windows yourself. The former main Catapult developer used mainly Windows, so compilation is very well supported on this platform as well. This manual gives a few pointers in the right direction for that.
FreeBSD
Catapult was compiled successfully on FreeBSD 4 and 5. FreeBSD is not a platform we support officially, but whenever a user finds compilation problems on FreeBSD, we fix them, so usually FreeBSD compilation should work.
Mac OS X
Unfortunately, we have not been able to get Catapult working on Mac OS X. There is a port of wxWidgets (the base of Catapult), but version 2.4 doesn't support toggle buttons yet and we did not get the menu working (amongst other things) with version 2.6.
other operating systems
Catapult theoretically can compile on every system where you have g++ (the C++ compiler of GCC) and the required libraries are available. However, in practice every system is slightly different and a new operation system will not work out-of-the-box. Still, it shouldn't take much effort to make Catapult build on a new OS.

If you need help compiling Catapult, please contact us. If you needed any modifications to make Catapult compile, please send those modifications to us, so we can make Catapult ever more portable.

Disclaimer: We do not claim this guide is complete or even correct. What you do with the information in it is entirely at your own risk. We just hope it helps you enjoy Catapult (and with that openMSX) more.

1.3. Contributors

The following people contributed to this document in one way or another:

Thanks to all of them!

1.4. Revision History

This section gives an overview of the changes that were made to this document. It doesn't contain every single modification (use the CVS log for that), only the big picture.

2004-04-25 Herman Oudejans
Initial version based on the openMSX manuals by Manuel Bilderbeek, Jorrith Schaap and Maarten ter Huurne.
2004-10-04 Herman Oudejans
Added touch.exe to the compilation packages
2005-02-06 Herman Oudejans
Updated this manual for compilation with wxWidgets 2.5 and for compilation with MinGW.
2005-12-30 Manuel Bilderbeek
Updates for compilation with wxWidgets 2.6.

2. Getting the Source Code

Catapult is a sub-project of openMSX, developed using the tools SourceForge.net freely offers to open source projects. The code is stored in CVS, an open source version management system. Catapult is released at every openMSX release. It can be released in between openMSX releases as well, if there is a lot of development that we want to share with the users without waiting for the next openMSX release.

There are several options for getting the source code:

Released Version
These are tested versions, which should give you little problem compiling and running. However, as Catapult development is often quite fast, they may not have all the latest features. Also there could be bugs that have been fixed since the last release.
CVS Checkout
Through anonymous CVS you can get the same development version the Catapult developers are using. This is the bleeding edge: the latest stuff, which may be great or may be horribly broken. Usually Catapult CVS compiles and runs fine, but we're only human, so once in a while it breaks. Also there may be changes that are not documented yet.
CVS Snapshot
A snapshot is created from a recent CVS checkout, in a tar.gz archive. A snapshot is therefore quite similar to a CVS checkout, but it doesn't require you to install and use CVS.

Releases are intended for general users, CVS and CVS snapshots are intended for (would be) developers, heavy testers and people who want to follow new developments closely. It might be a good idea to play with a release first. If you like what you see and want to get in deeper, you can switch to CVS later. If you update often, it is best to use a CVS checkout rather than a CVS snapshot, because with a checkout you can do efficient incremental updates, saving network bandwidth and compile time.

If you downloaded a version that is either a lot older or a lot newer than this guide, it is a good idea to read the guide included in your downloaded version instead of the version you're reading right now. You can find the Compilation Guide in the directory Catapult/doc/manual.

2.1. Released Version

You can download a released version of Catapult from the download page at SourceForge. The latest version is probably the best one. At least try to get one matching the version of openMSX you are using.

After downloading, type:

tar xzvf Catapult-VERSION.tar.gz

in which VERSION is the Catapult version you downloaded, or use the file name you saved the tar.gz file with. The directory that is created by uncompressing the tar.gz file is called the top of the source tree.

Note: Windows doesn't natively support tar or gzip, but there are enough utilities available to decompress these sources anyway. Examples of such utilities are PowerArchiver 6.1 (free), Wiz (free), 7-zip (free) or WinZip (commercial).

2.2. CVS Checkout

Getting a CVS checkout means you use CVS to retrieve the latest version of the source code of Catapult. This means you will need to install a CVS client. This package is usually simply named cvs. There are graphical front-ends for CVS, but this guide will tell you how to use CVS from the command line. More information about CVS can be found on the CVS Home site. On this site you can also find a CVS command line tool for Windows.

With the following line you can login to the openMSX CVS server:

cvs -d:pserver:anonymous@openmsx.cvs.sourceforge.net:/cvsroot/openmsx login

In this line you specified where you want to retrieve the files from (host name of the CVS server), as who you want to retrieve the stuff (since you're not a developer, anonymous will do), and what project you want to retrieve (openmsx in this case, since Catapult is a sub-project of openMSX).

You will be prompted for a password. The password for user anonymous is empty, so just press enter.

Example output:

jorrith@jardel openmsx $ cvs -d:pserver:anonymous@openmsx.cvs.sourceforge.net:/cvsroot/openmsx login
Logging in to :pserver:anonymous@openmsx.cvs.sourceforge.net:2401/cvsroot/openmsx
CVS password:
jorrith@jardel openmsx $

Now you can retrieve the latest sources with the following command:

cvs -z3 -d:pserver:anonymous@openmsx.cvs.sourceforge.net:/cvsroot/openmsx checkout Catapult

This will create a directory called Catapult for you in the current directory. This directory created by CVS is the called top of the source tree. In addition to the Catapult code, you will see CVS administration directories which are all called CVS. Do not mess with these, otherwise CVS will get confused.

If you want to update your source tree later, go to the top of the source tree and type:

cvs update -d

The -d option tells CVS to check out new directories that were created since your last checkout/update.

2.3. CVS Snapshot

Snapshots for this version of Catapult are not available anymore, because we are working on a total rewrite of Catapult. It doesn't seem useful to provide snapshots for sources that do not change anymore. You can download an SVN snapshot of the Catapult rewrite from the openMSX web site.

3. Compilation

Before you can start compiling Catapult, you have to make sure your system has all the necessary build tools installed, as well as the libraries Catapult depends upon. The former you have probably already done if you have compiled openMSX itself before Catapult. The following sections list the packages you need.

3.1. Build Tools

For compilation in Linux, you need Make and a C++ compiler. If you have compiled packages from source before (like openMSX), you probably have these installed already.

make
GNU implementation of the Make tool. Make interprets rules that define how a project should be built.
g++
The GNU C++ compiler. Version 3.2 or later is necessary; 2.95 is not supported for openMSX, so we also don't support it for Catapult. To be on the safe side: we recommend 3.4 or later.

For compilation in Windows you will need one of the following:

Microsoft Visual C++
Catapult was written with version 6.0. Whether it also compiles on higher versions is unknown at this point. You also need to download sed.exe from GNU Home and touch.exe from UnxUtils. Although this may still work, we haven't tested this in ages, so in case of problems, please revert to the MinGW method described below.
The combination of Minimal System (msys) and Minimalist GNU for Windows (MinGW)
This is the same combination that is needed to compile openMSX on Windows. Although compilation works, the generated executable will be larger than the binary released version (which is compiled with Visual C++) and will also need the MinGW runtime DLL.

3.2. Libraries

Catapult depends on a few libraries. Using Linux you must have the runtime packages of these libraries installed to be able to run Catapult. The runtime package for the "Foo" library is typically called libfoo. Also, for compiling Catapult you need the development packages of these libraries installed as well. Development packages are typically named libfoo-dev or libfoo-devel. Windows users need to have the proper DLL's installed (foo.dll) to be able to run Catapult. Compiling in Windows means that you also need the lib-files (foo.lib).

If there are no binary versions of the required libraries available for your system or you rather compile them yourself, please see the next section for a few hints about compiling them from their sources.

First of all, you need some wxWidgets (formerly known as wxWindows) packages or libraries. On a Debian testing system, the packages are called:

libwxgtk2.6-0
wxWindows Cross-platform C++ GUI toolkit (GTK+ runtime). This is the main runtime wxWidgets library
libwxgtk2.6-dev
This package contains the necessary headers to compile.

Although other versions are available, we recommend to use wxWidgets 2.6. For Windows there are no binary releases available. Please read the next section for instructions for compiling wxWidgets from source.

Furthermore, you need the XML library that is also used in openMSX itself. In Debian its packages are called:

libxml2 and libxml2-dev
XML C library, originally developed for GNOME.

3.3. Compilation of the Libraries

For some distributions it's necessary to manually compile the libraries. This section gives a few pointers to get it to work. It's not intended to be a substitute for the documentation supplied with the libraries. The wxWidgets sources can be found at wxWidgets Home and the libxml2 sources are available at Libxml2 Home.

Building the libxml2 library should be easy enough with the docs available.

Compilation of wxWidgets 2.6 couldn't be more straightforward. The docs provided are easy to follow and it takes only a few steps. There is no need to give any pointers here about this library. We do give the proper configure command line here:

./configure --disable-shared --disable-fontmap --disable-unicode --disable-html --enable-xrc --enable-controls --with-msw --enable-monolithic

Because of bugs in wxWidgets 2.6, you need to patch the source code of wxWidgets if you use the --disable-fontmap option. To do this, do the following in your MSYS terminal, in the source directory of wxWidgets:

cd src/xrc
patch -p0 < /path/to/Catapult/build/3rdparty/xmlres_without_fontmap.patch

This patch was written for wxWidgets 2.6.4, the latest stable 2.6 version. If you are using another version, you'll have to adapt the patch manually (which is not hard, but you have to know what you're doing).

3.4. Compilation Itself

We have made compilation of Catapult itself as easy as possible. In most cases Linux or msys users only have to open a shell, go to the top of the source tree and type:

make

You can build different flavours by setting the CATAPULT_FLAVOUR environment variable. The following values are supported:

debug
No optimisation and full debug symbols
devel
Some optimisation but still full debug symbols available (this is the recommended flavour for testing)
i686
Fully optimised and no debug symbols (this is the default flavour)
opt
Basically the same as i686, but also for non Intel targets
ppc
Specifically for Power PC processors
win32
Optimised for PIII but runnable with Pentium MMX and higher

In Visual Studio, just open build\wxCatapult.dsw, choose a target and build it.

Depending on how fast your system is, this may take several seconds to several minutes.

If you get errors during compilation, verify that you installed all required libraries, both the run time and development packages. If that doesn't help, or we forgot to list a library Catapult depends on, contact the openMSX developers. Make sure you provide us with the error message(s) you got.

4. Installation

To install Catapult in Linux, run the following command:

make install

This installs Catapult, by default in /opt/openMSX-Catapult. You can change this location by modifying the config.mk file. Note that only root has rights to write to system-wide directories such as /opt, so you may have to do su before make install.

Windows doesn't really provide us with an installation system, so it's up to you to make sure the files are in the right directory. Please follow these pointers to make sure it should work:

If all went well, you should have Catapult installed now. You can test it by starting Catapult from the command line:

catapult

or by double clicking the icon in Windows.

Using Catapult should be intuitive, but if it's not, please read the Catapult User's Manual. This should give a complete description on how to use Catapult.

If you got stuck somewhere in the compilation and installation process, please contact us. The next chapter will tell you how.

6. Contact Info

Since Catapult is still in heavy development, feedback and bug reports are very welcome!

If you encounter problems, you have several options:

  1. If you're a regular user and want to discuss openMSX and Catapult and possible problems, join our openmsx-user mailing list. More info on the openMSX mailing lists, including an archive of old messages, can be found at SourceForge.
  2. Go to our IRC channel: #openMSX on irc.freenode.net and ask your question there.
  3. If you want to address the openMSX developers directly, post a message to the openmsx-devel mailing list. More info on the openMSX mailing lists, including an archive of old messages, can be found at SourceForge.
  4. Use one of the openMSX trackers at SourceForge. At the moment of writing, there are four trackers: Bugs, Support Requests, Patches and Feature Requests.

For experienced users: if you get a crash, try to provide a gdb backtrace.

In any case, try to give as much information as possible when you describe your bug or request.

$Id: compile.html,v 1.23 2007/10/22 17:48:25 manuelbi Exp $