2 Installing the compiler

1 Before Installation : Requirements

1 System requirements

The compiler needs at least the following hardware:
  1. An I386 or higher processor. A coprocessor is not required, although it will slow down your program's performance if you do floating point calculations without a coprocessor, since an emulation will be used.
  2. 4 Mb of free memory. Under DOS, if you use DPMI memory management, such as under Windows, you will need at least 16 Mb.
  3. At least 500 Kb. free disk space.

2 Software requirements

1 Under DOS

The DOS distribution contains all the files you need to run the compiler and compile pascal programs.

2 Under Linux

Under LINUX you need to have the following programs installed :
  1. GNU as, the GNU assembler.
  2. GNU ld, the GNU linker.
  3. Optionally (but highly recommended) : GNU make. For easy recompiling of the compiler and Run-Time Library, this is needed.
Other than that, Free Pascal should run on almost any I386 LINUX system.

3 Under Windows

The WINDOWS distribution contains all the files you need to run the compiler and compile pascal programs. However, it may be a good idea to install the mingw32 tools or the cygwin development tools. Links to both of these tools can be found on

4 Under OS/2

While the Free Pascal distribution comes with all necessary tools, it is a good idea to install the EMX extender in order to compile and run programs with the Free Pascal compiler. The EMX extender can be found on:

2 Installing the compiler.

The installation of Free Pascal is easy, but is platform-dependent. We discuss the process for each platform separately.

1 Installing under DOS or Windows

1 Mandatory installation steps.

First, you must get the latest distribution files of Free Pascal. They come as zip files, which you must unzip first, or you can download the compiler as a series of separate files. This is especially useful if you have a slow connection, but it is also nice if you want to install only some pats of the compiler distribution. The distribution zip file contains an installation program INSTALL.EXE. You must run this program to install the compiler.

The first screen of the installation program looks like this:


And the second screen looks like


The program allows you to select:

In order to run Free Pascal from any directory on your system, you must extend your path variable to contain the C:\PP\BIN directory. Usually this is done in the AUTOEXEC.BAT file. It should look something like this :

(Again, assuming that you installed in the default location).

If you want to use the graphic drivers you must modify the environment variable GO32. Instructions for doing this can be found in the documentation of the Graph unit, at the InitGraph procedure.

2 Optional Installation: The coprocessor emulation

For people who have an older CPU type, without math coprocessor (i387) it is necessary to install a coprocessor emulation, since Free Pascal uses the coprocessor to do all floating point operations.

The installation of the coprocessor emulation is handled by the installation program (INSTALL.EXE) under DOS and WINDOWS.

2 Installing under Linux

1 Mandatory installation steps.

The LINUX distribution of Free Pascal comes in three forms: All of these packages contain a ELF version of the compiler binaries and units. the older aout binaries are no longer distributed, although you still can use the comiler on an aout system if you recompile it.

If you use the .rpm format, installation is limited to

rpm -i fpc-pascal-XXX.rpm
(XXX is the version number of the .rpm file)

If you use Debian, installation is limited to

dpkg -i fpc-XXX.deb
Here again, XXX is the version number of the .deb file.

You need root access to install these packages. The .tar file allows you to do an installation if you don't have root permissions.

When downloading the .tar file, or the separate files, installation is more interactive.

In case you downloaded the .tar file, you should first untar the file, in some directory where you have write permission, using the following command:

tar -xvf fpc.tar
We supposed here that you downloaded the file fpc.tar somewhere from the Internet. (The real filename will have some version number in it, which we omit here for clarity.)

When the file is untarred, you will be left with more archive files, and an install program: an installation shell script.

If you downloaded the files as separate files, you should at least download the script, and the libraries (in libs.tar.gz).

To install Free Pascal, all that you need to do now is give the following command:

And then you must answer some questions. They're very simple, they're mainly concerned with 2 things :
  1. Places where you can install different things.
  2. Deciding if you want to install certain components (such as sources and demo programs).
The script will automatically detect which components are present and can be installed. It will only offer to install what has been found. because of this feature, you must keep the original names when downloading, since the script expects this.

If you run the installation script as the root user, you can just accept all installation defaults. If you don't run as root, you must take care to supply the installation program with directory names where you have write permission, as it will attempt to create the directories you specify. In principle, you can install it wherever you want, though.

At the end of installation, the installation program will generate a configuration file for the Free Pascal compiler which reflects the settings that you chose. It will install this file in the /etc directory, (if you are not installing as root, this will fail), and in the directory where you installed the libraries.

If you want the Free Pascal compiler to use this configuration file, it must be present in /etc, or you can set the environment variable PPC_CONFIG_PATH. Under csh, you can do this by adding a

setenv PPC_CONFIG_PATH /usr/lib/ppc/0.99.14
line to your .login file in your home directory. (see also the next section)

3 Optional configuration steps

On any platform, after installing the compiler you may wish to set some environment variables. The Free Pascal compiler recognizes the following variables :

These locations are, however, set in the sample configuration file which is built at the end of the installation process, except for the PPC_CONFIG_PATH variable, which you must set if you didn't install things in the default places.

1 finally

Also distributed in Free Pascal is a README file. It contains the latest instructions for installing Free Pascal, and should always be read first.

4 Testing the compiler

After the installation is completed and the environment variables are set as described above, your first program can be compiled.

Included in the Free Pascal distribution are some demonstration programs, showing what the compiler can do. You can test if the compiler functions correctly by trying to compile these programs.

The compiler is called

To compile a program (e.g demo\hello.pp) simply type :
  ppc386 hello
at the command prompt. If you don't have a configuration file, then you may need to tell the compiler where it can find the units, for instance as follows:
ppc386 -Fuc:\pp\units\go32v2\rtl hello
under DOS, and under LINUX you could type
ppc386 -Fu/usr/lib/fpc/NNN/units/linux/rtl hello
(replace NNN with the version number of Free Pascal that you are using). This is, of course, assuming that you installed under C:\PP or /usr/lib/fpc/NNN, respectively.

If you got no error messages, the compiler has generated an executable called hello (no extension) under LINUX, and a file hello.exe under DOS.

To execute the program, simply type :

If all went well, you should see the following friendly greeting:
Hello world

Free Pascal Compiler