IOI'2009 Competition Environment

The working environment for IOI'2009 consists of:
        C/C++ and Pascal compilers and other essential programs,
        text editors and IDEs,
        various other programs, and
        documentation.

Compilers and Other Essential Tools

The C/C++ compiler is gcc, v.4.2. The Pascal compiler is Free Pascal (fpc), v.2.2

The debugger is gdb, v.6.8-debian; it natively supports all three programming languages. While gdb is a console program, one can also use ddd, which is a GUI on top of it.

gnome-terminal, xterm, and konsole are available as console (“terminal”) programs, with bash being the command interpreter. Besides bash, for navigating directories one can use nautilus (a GUI program not unlike MS Explorer), or mc (the “Midnight Commander”, a TUI program).

Text Editors & IDEs

These fall into three groups:

The language-specific and multi-purpose environments are set up to use the respective compilers, i.e. gcc/g++ and/or fpc.

Code::Blocks

Code::Blocks is a relatively new IDE for C++ (and some other languages), available on Linux and MS Windows.

KDevelop

KDevelop is an IDE for C++ and other programming languages, available on several operating systems.

Note. KDevelop will not compile a C++ file alone: one has to create a ‘project’ first.

Lazarus

Lazarus is an IDE for the Free Pascal compiler. Also included is an additional patch to allow debugging console applications in Linux: http://bugs.freepascal.org/view.php?id=12172

Free Pascal IDE

A Borland Pascal-like TUI IDE that comes standardly with Free Pascal and can be started with the fp command. There are several known issues with it:

Vim

Vim is a very advanced text editor, available on all operating systems and particularly highly esteemed among programmers. Being command-based, it may require some getting used to by newcomers, but rewards the efforts by providing unmatched text editing efficiency.

The IOI'2009 installation of Vim is customised in several ways to make up a better programming environment for C/C++ than plain Vim. (Vim can also be used for writing programs in Pascal, but, as it is, no immediate support for this language is available other than syntax highlighting.)

The IDE plug-in's functionality is available through a menu “C/C++” as well as a set of key mappings. It is described in detail in the file that contains the plug-in (see the web link above). In brief, the plug-in does the following.

• Compile & Link a Program
A program file is one that has an extension of .c (for C), or .cpp, .c++, .cxx, or .cc (for C++). The command Compile and Link processes that file even if it is not in the current window. If changes were made to the text that were not yet written to the file, the command saves the program before compiling it. If the compilation fails due to syntax errors, Vim's quickfix window opens with the error messages listed in it and linking to the C/C++ source if clicked.

• Run a Program
If the executable file is older than the program source file, the program is first compiled and linked (and prior to that, possibly saved, as mentioned above). If compilation fails, the program is not run.

• Run Redirected
It is possible to run a program in several special ways, redirecting the standard input, output, or both to files named in and out, or to a selected area within the edited text.

A tab page may contain files with no C/C++ extensions or no extensions at all, such as input, output, help files, etc., but there must be only one program file in order to use the Compile and Run commands of the plug-in (otherwise, an error is reported to the user). One can still work with several programs simultaneously, provided that each resides in a separate tab page.

• Additionally, the IDE plug-in provides commands that list the contents of the directory of the current file, and run a command shell in that directory. As these actions are of general use, not immediately related to programming, they can be executed regardless of the presence of a program file. On the other hand, running a shell in the directory where a certain program is is particularly useful.

Help on C, C's stdlib and STL is available through the following “fast key sequences” in normal mode of Vim:

 \cc C and stdlib reference – contents
 \cw help on a specified C function, statement, etc.
 \cr context help on a C function, statement, etc. (based on the position of the text cursor)
 \tc STL reference – contents
 \tw help on a specified STL topic
 \te an example of use of a specified STL topic
 \tr context help on an STL topic (based on the position of the text cursor)

The help text on the standard C library is based on The GNU C Library Reference Manual.
The help text on STL is the “STL programmer's guide” from SGI.

Emacs and XEmacs

Emacs (GNU Emacs) is an advanced text editor, available on most popular operating systems, known for its customizability as an IDE and other purposes. XEmacs is a clone of Emacs.

Geany

Geany is a lightweight cross-platform GTK+ text editor based on Scintilla with basic Integrated Development Environment (IDE) features. It is designed to have limited dependency on separate packages and short load times. It is available for a wide range of operating systems, such as Windows, Linux, Mac OS X, BSD and Solaris. Among the supported programming languages are C, Java, JavaScript, PHP, HTML, CSS, Python, Perl, Ruby, Pascal and Haskell.

SciTE

SciTE is a relatively new but highly popular text editor with simple facilities for building and running programs in many languages. However, in many respects, SciTE's standard configuration does not fit the needs of using it at IOI. Consequently, its IOI'2009 installation is customised through heavy (re)configuring, including cutting off unneeded features.

With IOI'2009 SciTE, it is possible to build and run programs in C, C++ and Pascal. A text file is recognised as a program source in one of these languages if its name has an extension .c (for C), .cpp, .c++, .cxx, or .cc (for C++), or .pas (for Pascal). Program files in other languages are not recognised in this version of SciTE.

Building and running a program is possible through the Tools menu, or using the corresponding keys and key combinations. The output from the compiler, as well as the interaction with the program itself, take place in the so called output pane, which by default occupies the right part of the editor window but is initially hidden (it shows up when compiling etc., or when open explicitly.)

Here is a list of the most important keys to use in connection with programs and the output pane.

It is possible to run a program in special ways, redirecting the standard input, or the input and output, to files named in and out.

Note. Currently, the shell which SciTE runs within its output pane contains a bug which makes it not possible to execute programs reading from the keyboard as standard input. Because of this, one must either redirect the input to a file, or use a true console instead of the output pane to run a program.

Kate

Kate is a text editor for the K desktop environment, of which it has become a built-in part. For IOI'2009 Kate, the KateBuild plug-in has been included.

KWrite

KWrite is a lightweight text editor, a ‘smaller’ version of Kate.

gedit

gedit is the ‘official text editor’ of the GNOME desktop environment.

JOE

JOE is a console-based text editor. The user interacts with it by means of a set of key combinations, specific to this editor. There are also modes where JOE imitates WordStar, Emacs, and Pico – an editor which nano (see below) was created to improve on.

nano

nano is a console-based text editor with just a very basic functionality. Its use of key combinations as commands resembles that of Emacs.

mcedit

This is the text editor of the Midnight Commander file manager (mentioned above), but can be used independently of it.

xwpe

A package of four TUI, console programs: we, wpe, xwe, and xwpe. They are different versions of the same basic editor and development environment. The development of xwpe has stopped in 2003.

Note. Running xwpe crashes the terminal.

Other Programs

A number of other programs are available to the contestants on IOI'2009.

These include the popular Unix/Linux tools:

Also included are:

perl 5.8
a general-purpose programming language especially suitable for text processing
python 2.5
a general-purpose programming language
Firefox
the browser
evince
a document viewer (reads PDF, PostScript, DjVu, and DVI)
AbiWord
a word processor (like OpenOffice Writer or MS Word)

Documentation

Documentation in HTML form is available within the operating environment and is linked from the desktop.

Documentation on the languages, libraries, compilers, and various other programs is also present in man and info formats through the programs of the same names. For example:
        man program  or  info program  shows a reference page on a program, e.g.  man uniq  or  info uniq,
        man 3 printf  or  info printf  displays information on the printf function,
        info libc  displays a reference page on the C standard library, and
        man maninfo manman info,  and  info info  show information on the man and info programs themselves.